1判断端口是否是通的
telnet
示例:telnet ip port
显示
telnet
master 8032
Trying
192.168.1.10...
Connected
to master.
Escape
character is
'^]'
. 表示是通的
lsof -i:端口号查看某个端口是否被占用
lsof
-i:8032
COMMAND
PID USER FD TYPE DEVICE SIZE
/OFF
NODE NAME
java
3493 aboutyun 220u IPv6 32517 0t0 TCP master:pro-ed (LISTEN)
使用netstat -anp|grep 8032
hdfs 665 30832 1 Jan22 ? 00:54:39 /usr/java/jdk1.7.0_80/bin/java -Dproc_datanode -Xmx1000m -Dhdfs.audit.logger=INFO,RFAAUDIT -Dsecurity.audit.logger=INFO,RFAS -Djava.net.preferIPv4Stack=true -Dhadoop.log.dir=/var/log/hadoop-hdfs -Dhadoop.log.file=hadoop-cmf-hdfs-DATANODE-BJS-TC-1-1AE.log.out -Dhadoop.home.dir=/opt/cloudera/parcels/CDH-5.8.0-1.cdh5.8.0.p0.42/lib/hadoop -Dhadoop.id.str=hdfs -Dhadoop.root.logger=INFO,RFA -Djava.library.path=/opt/cloudera/parcels/HADOOP_LZO-0.4.15-1.gplextras.p0.123/lib/hadoop/lib/native:/opt/cloudera/parcels/CDH-5.8.0-1.cdh5.8.0.p0.42/lib/hadoop/lib/native -Dhadoop.policy.file=hadoop-policy.xml -Djava.net.preferIPv4Stack=true -server -Xms17179869184 -Xmx17179869184 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled -XX:OnOutOfMemoryError=/opt/cm-5.8.0/lib64/cmf/service/common/killparent.sh -Dhadoop.security.logger=INFO,RFAS org.apache.hadoop.hdfs.server.datanode.DataNode
tcp 0 0 0.0.0.0:50010 0.0.0.0:* LISTEN 665/java
tcp 0 0 0.0.0.0:50075 0.0.0.0:* LISTEN 665/java
tcp 0 0 0.0.0.0:50020 0.0.0.0:* LISTEN 665/java
tcp 0 0 127.0.0.1:43749 0.0.0.0:* LISTEN 665/java
tcp 0 0 192.168.1.15:53372 192.168.1.6:8022 ESTABLISHED 665/java
tcp 0 0 192.168.1.15:60457 192.168.1.19:7184 ESTABLISHED 665/java
tcp 0 0 192.168.1.15:38821 192.168.1.17:8022 ESTABLISHED 665/java
unix 2 [ ACC ] STREAM LISTENING 26725528 665/java /var/run/hdfs-sockets/dn
unix 2 [ ] STREAM CONNECTED 26726036 665/java
unix 3 [ ] STREAM CONNECTED 26725535 665/java
unix 3 [ ] STREAM CONNECTED 26725534 665/java
unix 2 [ ] STREAM CONNECTED 26725526 665/java