telnet
- 网络通
[root@leader ~]# telnet 192.168.52.19 8123
Trying 192.168.52.19...
Connected to 192.168.52.19.
Escape character is '^]'.
Connection closed by foreign host.
- 网络不通
[root@leader ~]# telnet 192.168.52.19 8123
Trying 192.168.52.19...
telnet: connect to address 192.168.52.19: Connection refused
curl
- 网络通
[root@leader ~]# curl 192.168.52.19:8123
Ok.
- 网络不通
[root@leader ~]# curl 192.168.52.19:8123
curl: (7) Failed connect to 192.168.52.19:8123; 拒绝连接
防火墙
- 没有开放8123端口:
[root@leader ~]# curl 192.168.52.19:8123
curl: (7) Failed connect to 192.168.52.19:8123; 没有到主机的路由
[root@leader ~]# telnet 192.168.52.19 8123
Trying 192.168.52.19...
telnet: connect to address 192.168.52.19: No route to host
- 防火墙放行8123端口:
[root@only ~]# firewall-cmd --list-ports
[root@only ~]# firewall-cmd --zone=public --add-port=8123/http --permanent
Error: INVALID_PROTOCOL: 'http' not in {'tcp'|'udp'|'sctp'|'dccp'}
[root@only ~]# firewall-cmd --zone=public --add-port=8123/tcp --permanent
success
[root@only ~]# firewall-cmd --list-ports
#需要重新加载防火墙!!!
[root@only ~]# systemctl reload firewalld
[root@only ~]# firewall-cmd --list-ports
8123/tcp
- 在开放8123端口,再次测试网络策略
[root@leader ~]# telnet 192.168.52.19 8123
Trying 192.168.52.19...
Connected to 192.168.52.19.
Escape character is '^]'.
Connection closed by foreign host.
[root@leader ~]# curl 192.168.52.19:8123
Ok.
- 查看本服务器端口状态
[root@only lib]# netstat -anp | grep 60010 #没有被占用,我也没起hbase服务
[root@only lib]# netstat -anp | grep 12345 #12345的tcp端口正在被占用,我起了apache dolphinscheduler
tcp6 0 0 :::12345 :::* LISTEN 28376/java
- ps查看特定的进程pid、进程名
- 5.1. ps 带有dol的进程。下面一共有九个有效进程,一个为ps进程。
[root@only lib]# ps -ef | grep dol
dolphin+ 20205 1 0 8月29 ? 00:02:11 /opt/jdk1.8.0_161/bin/java -Dzookeeper.log.dir=/opt/zookeeper-3.8.0/bin/../logs -Dzookeeper.log.file=zookeeper-dolphinscheduler-server-only.log -XX:+HeapDumpOnOutOfMemoryError -XX:OnOutOfMemoryError=kill -9 %p -cp /opt/zookeeper-3.8.0/bin/../zookeeper-server/target/classes:/opt/zookeeper-3.8.0/bin/../build/classes:/opt/zookeeper-3.8.0/bin/../zookeeper-server/target/lib/*.jar:/opt/zookeeper-3.8.0/bin/../build/lib/*.jar:/opt/zookeeper-3.8.0/bin/../lib/zookeeper-prometheus-metrics-3.8.0.jar:/opt/zookeeper-3.8.0/bin/../lib/zookeeper-jute-3.8.0.jar:/opt/zookeeper-3.8.0/bin/../lib/zookeeper-3.8.0.jar:/opt/zookeeper-3.8.0/bin/../lib/snappy-java-1.1.7.7.jar:/opt/zookeeper-3.8.0/bin/../lib/slf4j-api-1.7.30.jar:/opt/zookeeper-3.8.0/bin/../lib/simpleclient_servlet-0.9.0.jar:/opt/zookeeper-3.8.0/bin/../lib/simpleclient_hotspot-0.9.0.jar:/opt/zookeeper-3.8.0/bin/../lib/simpleclient_common-0.9.0.jar:/opt/zookeeper-3.8.0/bin/../lib/simpleclient-0.9.0.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-transport-native-unix-common-4.1.73.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-transport-native-epoll-4.1.73.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-transport-classes-epoll-4.1.73.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-transport-4.1.73.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-tcnative-classes-2.0.48.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-tcnative-2.0.48.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-resolver-4.1.73.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-handler-4.1.73.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-common-4.1.73.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-codec-4.1.73.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-buffer-4.1.73.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/metrics-core-4.1.12.1.jar:/opt/zookeeper-3.8.0/bin/../lib/logback-core-1.2.10.jar:/opt/zookeeper-3.8.0/bin/../lib/logback-classic-1.2.10.jar:/opt/zookeeper-3.8.0/bin/../lib/jline-2.14.6.jar:/opt/zookeeper-3.8.0/bin/../lib/jetty-util-ajax-9.4.43.v20210629.jar:/opt/zookeeper-3.8.0/bin/../lib/jetty-util-9.4.43.v20210629.jar:/opt/zookeeper-3.8.0/bin/../lib/jetty-servlet-9.4.43.v20210629.jar:/opt/zookeeper-3.8.0/bin/../lib/jetty-server-9.4.43.v20210629.jar:/opt/zookeeper-3.8.0/bin/../lib/jetty-security-9.4.43.v20210629.jar:/opt/zookeeper-3.8.0/bin/../lib/jetty-io-9.4.43.v20210629.jar:/opt/zookeeper-3.8.0/bin/../lib/jetty-http-9.4.43.v20210629.jar:/opt/zookeeper-3.8.0/bin/../lib/javax.servlet-api-3.1.0.jar:/opt/zookeeper-3.8.0/bin/../lib/jackson-databind-2.13.1.jar:/opt/zookeeper-3.8.0/bin/../lib/jackson-core-2.13.1.jar:/opt/zookeeper-3.8.0/bin/../lib/jackson-annotations-2.13.1.jar:/opt/zookeeper-3.8.0/bin/../lib/commons-io-2.11.0.jar:/opt/zookeeper-3.8.0/bin/../lib/commons-cli-1.4.jar:/opt/zookeeper-3.8.0/bin/../lib/audience-annotations-0.12.0.jar:/opt/zookeeper-3.8.0/bin/../zookeeper-*.jar:/opt/zookeeper-3.8.0/bin/../zookeeper-server/src/main/resources/lib/*.jar:/opt/zookeeper-3.8.0/bin/../conf:.:/opt/jdk1.8.0_161/lib/dt.jar:/opt/jdk1.8.0_161/lib/tools.jar -Xmx1000m -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false org.apache.zookeeper.server.quorum.QuorumPeerMain /opt/zookeeper-3.8.0/bin/../conf/zoo.cfg # zk进程
dolphin+ 28215 1 0 8月29 ? 00:00:00 /bin/sh /opt/dolphinscheduler-3.0.0-installation/master-server/bin/start.sh #dolphinscheduler的master启动脚本进程;
dolphin+ 28222 28215 1 8月29 ? 00:08:31 java -server -Duser.timezone=UTC -Xms4g -Xmx4g -Xmn2g -XX:+PrintGCDetails -Xloggc:gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=dump.hprof -cp /opt/dolphinscheduler-3.0.0-installation/master-server/conf:/opt/dolphinscheduler-3.0.0-installation/master-server/libs/* org.apache.dolphinscheduler.server.master.MasterServer # 执行dolphinscheduler master-server主类启动;master-server进程;
dolphin+ 28266 1 0 8月29 ? 00:00:00 /bin/sh /opt/dolphinscheduler-3.0.0-installation/worker-server/bin/start.sh
dolphin+ 28271 28266 0 8月29 ? 00:03:55 java -server -Duser.timezone=UTC -Xms4g -Xmx4g -Xmn2g -XX:+PrintGCDetails -Xloggc:gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=dump.hprof -cp /opt/dolphinscheduler-3.0.0-installation/worker-server/conf:/opt/dolphinscheduler-3.0.0-installation/worker-server/libs/* org.apache.dolphinscheduler.server.worker.WorkerServer
dolphin+ 28322 1 0 8月29 ? 00:00:00 /bin/sh /opt/dolphinscheduler-3.0.0-installation/alert-server/bin/start.sh
dolphin+ 28327 28322 0 8月29 ? 00:02:30 java -server -Duser.timezone=UTC -Xms1g -Xmx1g -Xmn512m -XX:+PrintGCDetails -Xloggc:gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=dump.hprof -cp /opt/dolphinscheduler-3.0.0-installation/alert-server/conf:/opt/dolphinscheduler-3.0.0-installation/alert-server/libs/* org.apache.dolphinscheduler.alert.AlertServer
dolphin+ 28372 1 0 8月29 ? 00:00:00 /bin/sh /opt/dolphinscheduler-3.0.0-installation/api-server/bin/start.sh
dolphin+ 28376 28372 0 8月29 ? 00:04:46 java -server -Duser.timezone=UTC -Xms1g -Xmx1g -Xmn512m -XX:+PrintGCDetails -Xloggc:gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=dump.hprof -cp /opt/dolphinscheduler-3.0.0-installation/api-server/conf:/opt/dolphinscheduler-3.0.0-installation/api-server/libs/* org.apache.dolphinscheduler.api.ApiApplicationServer
root 34842 17964 0 00:35 pts/3 00:00:00 grep --color=auto dol
- 5.2. 查看pid为20205的进程。(仍然会有一个无效的进程)
[root@only lib]# ps -ef | grep 20205
dolphin+ 20205 1 0 8月29 ? 00:02:11 /opt/jdk1.8.0_161/bin/java -Dzookeeper.log.dir=/opt/zookeeper-3.8.0/bin/../logs -Dzookeeper.log.file=zookeeper-dolphinscheduler-server-only.log -XX:+HeapDumpOnOutOfMemoryError -XX:OnOutOfMemoryError=kill -9 %p -cp /opt/zookeeper-3.8.0/bin/../zookeeper-server/target/classes:/opt/zookeeper-3.8.0/bin/../build/classes:/opt/zookeeper-3.8.0/bin/../zookeeper-server/target/lib/*.jar:/opt/zookeeper-3.8.0/bin/../build/lib/*.jar:/opt/zookeeper-3.8.0/bin/../lib/zookeeper-prometheus-metrics-3.8.0.jar:/opt/zookeeper-3.8.0/bin/../lib/zookeeper-jute-3.8.0.jar:/opt/zookeeper-3.8.0/bin/../lib/zookeeper-3.8.0.jar:/opt/zookeeper-3.8.0/bin/../lib/snappy-java-1.1.7.7.jar:/opt/zookeeper-3.8.0/bin/../lib/slf4j-api-1.7.30.jar:/opt/zookeeper-3.8.0/bin/../lib/simpleclient_servlet-0.9.0.jar:/opt/zookeeper-3.8.0/bin/../lib/simpleclient_hotspot-0.9.0.jar:/opt/zookeeper-3.8.0/bin/../lib/simpleclient_common-0.9.0.jar:/opt/zookeeper-3.8.0/bin/../lib/simpleclient-0.9.0.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-transport-native-unix-common-4.1.73.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-transport-native-epoll-4.1.73.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-transport-classes-epoll-4.1.73.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-transport-4.1.73.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-tcnative-classes-2.0.48.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-tcnative-2.0.48.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-resolver-4.1.73.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-handler-4.1.73.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-common-4.1.73.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-codec-4.1.73.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-buffer-4.1.73.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/metrics-core-4.1.12.1.jar:/opt/zookeeper-3.8.0/bin/../lib/logback-core-1.2.10.jar:/opt/zookeeper-3.8.0/bin/../lib/logback-classic-1.2.10.jar:/opt/zookeeper-3.8.0/bin/../lib/jline-2.14.6.jar:/opt/zookeeper-3.8.0/bin/../lib/jetty-util-ajax-9.4.43.v20210629.jar:/opt/zookeeper-3.8.0/bin/../lib/jetty-util-9.4.43.v20210629.jar:/opt/zookeeper-3.8.0/bin/../lib/jetty-servlet-9.4.43.v20210629.jar:/opt/zookeeper-3.8.0/bin/../lib/jetty-server-9.4.43.v20210629.jar:/opt/zookeeper-3.8.0/bin/../lib/jetty-security-9.4.43.v20210629.jar:/opt/zookeeper-3.8.0/bin/../lib/jetty-io-9.4.43.v20210629.jar:/opt/zookeeper-3.8.0/bin/../lib/jetty-http-9.4.43.v20210629.jar:/opt/zookeeper-3.8.0/bin/../lib/javax.servlet-api-3.1.0.jar:/opt/zookeeper-3.8.0/bin/../lib/jackson-databind-2.13.1.jar:/opt/zookeeper-3.8.0/bin/../lib/jackson-core-2.13.1.jar:/opt/zookeeper-3.8.0/bin/../lib/jackson-annotations-2.13.1.jar:/opt/zookeeper-3.8.0/bin/../lib/commons-io-2.11.0.jar:/opt/zookeeper-3.8.0/bin/../lib/commons-cli-1.4.jar:/opt/zookeeper-3.8.0/bin/../lib/audience-annotations-0.12.0.jar:/opt/zookeeper-3.8.0/bin/../zookeeper-*.jar:/opt/zookeeper-3.8.0/bin/../zookeeper-server/src/main/resources/lib/*.jar:/opt/zookeeper-3.8.0/bin/../conf:.:/opt/jdk1.8.0_161/lib/dt.jar:/opt/jdk1.8.0_161/lib/tools.jar -Xmx1000m -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false org.apache.zookeeper.server.quorum.QuorumPeerMain /opt/zookeeper-3.8.0/bin/../conf/zoo.cfg
root 37070 17964 0 00:40 pts/3 00:00:00 grep --color=auto 20205
- 5.2.1.简化后的命令为:
java -Dzookeeper.log.dir=/opt/zookeeper-3.8.0/bin/../logs #指定zk日志
-Dzookeeper.log.file=zookeeper-dolphinscheduler-server-only.log # 指定 dolphinscheduler的日志文件
-XX:+HeapDumpOnOutOfMemoryError -XX:OnOutOfMemoryError=kill -9 %p # 遇到内存溢出错误进行命令:kill -9 pid
-cp /opt/zookeeper-3.8.0/bin/../zookeeper-server/target/classes:/opt/zookeeper-3.8.0/bin/../build/classes:/opt/zookeeper-3.8.0/bin/../zookeeper-server/target/lib/*.jar:/opt/zookeeper-3.8.0/bin/../build/lib/*.jar:/opt/zookeeper-3.8.0/bin/../lib/zookeeper-prometheus-metrics-3.8.0.jar:/opt/zookeeper-3.8.0/bin/../lib/zookeeper-jute-3.8.0.jar:/opt/zookeeper-3.8.0/bin/../lib/zookeeper-3.8.0.jar:/opt/zookeeper-3.8.0/bin/../lib/snappy-java-1.1.7.7.jar:/opt/zookeeper-3.8.0/bin/../lib/slf4j-api-1.7.30.jar:/opt/zookeeper-3.8.0/bin/../lib/simpleclient_servlet-0.9.0.jar:/opt/zookeeper-3.8.0/bin/../lib/simpleclient_hotspot-0.9.0.jar:/opt/zookeeper-3.8.0/bin/../lib/simpleclient_common-0.9.0.jar:/opt/zookeeper-3.8.0/bin/../lib/simpleclient-0.9.0.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-transport-native-unix-common-4.1.73.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-transport-native-epoll-4.1.73.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-transport-classes-epoll-4.1.73.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-transport-4.1.73.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-tcnative-classes-2.0.48.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-tcnative-2.0.48.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-resolver-4.1.73.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-handler-4.1.73.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-common-4.1.73.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-codec-4.1.73.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/netty-buffer-4.1.73.Final.jar:/opt/zookeeper-3.8.0/bin/../lib/metrics-core-4.1.12.1.jar:/opt/zookeeper-3.8.0/bin/../lib/logback-core-1.2.10.jar:/opt/zookeeper-3.8.0/bin/../lib/logback-classic-1.2.10.jar:/opt/zookeeper-3.8.0/bin/../lib/jline-2.14.6.jar:/opt/zookeeper-3.8.0/bin/../lib/jetty-util-ajax-9.4.43.v20210629.jar:/opt/zookeeper-3.8.0/bin/../lib/jetty-util-9.4.43.v20210629.jar:/opt/zookeeper-3.8.0/bin/../lib/jetty-servlet-9.4.43.v20210629.jar:/opt/zookeeper-3.8.0/bin/../lib/jetty-server-9.4.43.v20210629.jar:/opt/zookeeper-3.8.0/bin/../lib/jetty-security-9.4.43.v20210629.jar:/opt/zookeeper-3.8.0/bin/../lib/jetty-io-9.4.43.v20210629.jar:/opt/zookeeper-3.8.0/bin/../lib/jetty-http-9.4.43.v20210629.jar:/opt/zookeeper-3.8.0/bin/../lib/javax.servlet-api-3.1.0.jar:/opt/zookeeper-3.8.0/bin/../lib/jackson-databind-2.13.1.jar:/opt/zookeeper-3.8.0/bin/../lib/jackson-core-2.13.1.jar:/opt/zookeeper-3.8.0/bin/../lib/jackson-annotations-2.13.1.jar:/opt/zookeeper-3.8.0/bin/../lib/commons-io-2.11.0.jar:/opt/zookeeper-3.8.0/bin/../lib/commons-cli-1.4.jar:/opt/zookeeper-3.8.0/bin/../lib/audience-annotations-0.12.0.jar:/opt/zookeeper-3.8.0/bin/../zookeeper-*.jar:/opt/zookeeper-3.8.0/bin/../zookeeper-server/src/main/resources/lib/*.jar:/opt/zookeeper-3.8.0/bin/../conf:.:/opt/jdk1.8.0_161/lib/dt.jar:/opt/jdk1.8.0_161/lib/tools.jar #指定classpath路径!
-Xmx1000m #最大内存为1000M
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.local.only=false
org.apache.zookeeper.server.quorum.QuorumPeerMain # 指定主类!!!
/opt/zookeeper-3.8.0/bin/../conf/zoo.cfg # zk配置文件以参数传递!
-
5.2.2. 从上面的分析,可以知道pid为20205的进程并非为 dolphinscheduler进程,而是zookeeper进程。下面用jps -ml来验证pid为20205。
-
5.3. 使用jps -ml查看pid相关信息:
[root@only lib]# jps -ml | grep 20205
20205 org.apache.zookeeper.server.quorum.QuorumPeerMain /opt/zookeeper-3.8.0/bin/../conf/zoo.cfg #可以见到为zk服务!
- 5.4. 总结:
从第5步可以了解到,要仔细看清楚主类,并非一定为dol的直属进程。