Write down the problem, the way you think

  1. Ali cloud North China 2 Beijing area of the machine room is ready to migrate, our server was bought in 2016, just in the list of migration, so we received a notice from Ali, the notice is relatively simple, probably means that the external IP is unchanged, if the RDS database needs to switch to the mixed mode

  2. After making an appointment for the migration time, you can wait for the restart time. After the restart, Ali Cloud sent a short message about the completion of the migration and can start the service

  3. I didn’t think too much about it, because the Java project was a long time ago, so I started the process of deployment.

  4. To start the ZooKeeper service, go to the bin directory on the three ZooKeeper clients and run the following command :sh zkserver. sh start, run sh zkserver. sh Status Checks the status. One leader and two Follwers are sufficient

  5. Then start the redis database, run /redis-server & (background startup) to start the service, run redis-cli -h 127.0.0.1 -p 6379 -a ‘password’ to go to the Redis console and set the password command :CONFIG set Requirepass password. After the password is set, run the CONFIG get requirepass command to check whether the password is set successfully

  6. Run the./start.sh command to start the dubbo service. When the dubbo service fails to start, check the log, indicating that the mysql connection timed out. After confirming the next password, found forgot, ah. So reinstall mysql, found that is still the error, can not think of why, and then put a work order on Ali cloud, Ali cloud work order reply asked,mysql address is not Intranet…. After the server migration, RDS and the previous ECS server are not Intranet relations, resulting in connection failure…. Replace the line immediately

  7. Dubbo successfully started, so start consumer,nohup Java -jar ‘jar file ‘. The problem again, and sure enough, it’s always difficult trip, look at the journal, prompt unable to find a provider service providers can not find, also prompted an Intranet address request, so want to under the network address changed, so the network address related configuration in the project, and found that only the annotation used this address, so why would prompt the IP away Fee can not find the service, the final search Google ‘there is a similar problem, but he is because of the use of VPN, the solution is to modify the hosts’ file, white mapping IP modified, so I quickly open the hosts file, as expected is the previous Intranet IP address, for a new project to start OK done!

  8. App project ok, then start the management background, official website, one day, done

  9. App always hung up in the evening, check the log, redis could not get the error of connection, use redis- CLI to check the current number of connections is 1, so it is excluded, and then directly start the foreground service without using nohup command, observe the error log: There is insufficient memory for the Java Runtime Environment to continue.Native memory allocation (mmap) failed to map 65536 bytes for committing reserved memory.An error report file with more information is saved as: /home/hs_err_pid22464.log

  10. Google, said is the memory problem, so open ali cloud to view, memory 90% more

  11. Then under the analysis where take up so much memory, through the command: ps – aux | sort – k4nr | head found many of the tasks before still running in the diagram below:

kill -9 pid