#!/bin/bashPID_PATH="/home/pids/s1mme/p.pid"function_start (){ nohup java -Dlog.debug="false" -Dfile.encoding="utf-8" -Dlog.path="/home/log/s1mme_parse" \-jar S1MME2HBase.jar \-Dhbase_batch_size="5000" \-Dredis_host="169.254.7.218" \-Dredis_port="6379" \-Dinput_path="/home/s1mme" \-Dredis_key="s1mme_file_list" \-Dzk_host="master" \-Dzk_port="2181" \-Dpop_block_ms="3000" \-Dfs_default_name="master:9000" \-Dtable_name="s1mme" >> /home/log/s1mme_parse/nohup.out & echo $! > ${PID_PATH} }function_stop (){ PID_NUM=`cat ${PID_PATH}` kill -9 ${PID_NUM} rm -f ${PID_PATH}}if [ "$1" = "start" ]; then function_startelif [ "$1" = "stop" ]; then function_stopelse printf "Usage: $0 {start|stop}\n"fi
java \-cp "libs/*" \-Xdebug -Xrunjdwp:transport=dt_socket,suspend=n,server=y,address=10031 \-Djava.rmi.server.hostname=101.132.1.1 \-Dcom.sun.management.jmxremote.port=18888 \-Dcom.sun.management.jmxremote.rmi.port=18888 \-Dcom.sun.management.jmxremote=true \-Dcom.sun.management.jmxremote.ssl=false \-Dcom.sun.management.jmxremote.authenticate=false \-Dspring.config.location=config_1/application.properties \-Dlogging.config=config_1/log4j2.xml \com.a.b.c.Main
- 10031 远程调试端口
- 101.132.1.1 jvisualvm远程连接IP,是远程IP
- 18888 远程jmx端口
#!/bin/bashremote_debug_port=10031rmi_server_hostname=ipjmx_remote_port=10041config_path=config_1main_class=Mainjava \-cp "libs/*" \-XX:+HeapDumpOnOutOfMemoryError \-XX:HeapDumpPath=/root/dumps/${remote_debug_port}.hprof \-Xdebug -Xrunjdwp:transport=dt_socket,suspend=n,server=y,address=${remote_debug_port} \-Djava.rmi.server.hostname=${rmi_server_hostname} \-Dcom.sun.management.jmxremote.port=${jmx_remote_port} \-Dcom.sun.management.jmxremote.rmi.port=${jmx_remote_port} \-Dcom.sun.management.jmxremote=true \-Dcom.sun.management.jmxremote.ssl=false \-Dcom.sun.management.jmxremote.authenticate=false \-Dspring.config.location=${config_path}/application.properties \-Dlogging.config=${config_path}/log4j2.xml \${main_class}# -javaagent:/root/btc/zw/agent/skywalking-agent.jar \