Do not know why, there is a dark cloud outside the window, and do not know why, the annoying cicada suddenly become silent, the brain of the noisy moment to place the quiet, grass he, my test server and special is no reason for the collapse.
As a rookie in order to troubleshoot, the first thought is to find the log, successively analyzed the project start log, resin startup log, the JVM log completely can not see the results.
The 1.JVM log shows that the GC is normal and memory is not overflowing.
2.resin process, the boot log is not an error.
3. The project log has a warning, log4j and another log packet has a class conflict, the general warning is ignored, in order to safely delete the useless log packet, restart the resin service is still unavailable, the request will not come in.
Log parsing has no results, code recompilation The heavy server is still unresponsive and helpless. Had to kneel and lick the great god for help.
Colleagues looked at the log after the discovery of a problem, resin did not really get up.
At that time resin's stdout.log was this:
The normal start should be more than one sentence log as follows:
[20:28:53.406] Resin started in 336646ms
Indicates that resin was blocked for some reason when it was started. So I used the jstack to analyze the situation at the time of the thread.
Jstack 572781 > tmp
is the main thread of resin, in a few moments using jstack to view the state of the main thread is always the case, indicating that the main thread is blocked on this method.
A little look at the main thread of the stack, the reason is definitely related to IP and zookeeper, I will recall, recently the company because of business downsizing, housekeeping, the former ZK services were migrated,
Sure enough, I found the project in ZK configuration ping the original IP ping, then the project ZK configuration changed to domain name access, in the hosts set up an IP after the OK.
Having experienced this server outage, I learned to use Jstack to find out why the process was blocked, and to learn more about thread dumps in Java.
Another problem is that the previous resin heavy part only needs about 24s, now need 3min, do not know whether is still the ZK configuration problem, pending further investigation.
Gorgeous Split-line:
Jstack using:
Java Thread Dump:
Troubleshooting a resin server and Jstack Preliminary understanding