Linux根据进程号查应用的启动路径。

[root@master 2650]# jps
82912 Jps
1521 NameNode
1652 DataNode
16023 RunJar
2650 HRegionServer
2220 QuorumPeerMain
1981 NodeManager
2141 JobHistoryServer
81870 Main
16223 RunJar
[root@master 2650]# cd /proc/2650
[root@master 2650]# ls -ail
total 0
  33043 dr-xr-xr-x   9 hcb  hcb  0 Feb  4 17:34 .
      1 dr-xr-xr-x 118 root root 0 Feb  4 01:44 ..
 727525 dr-xr-xr-x   2 hcb  hcb  0 Feb  5 12:49 attr
1217754 -rw-r--r--   1 hcb  hcb  0 Feb  8 00:42 autogroup
1217750 -r--------   1 hcb  hcb  0 Feb  8 00:42 auxv
1217774 -r--r--r--   1 hcb  hcb  0 Feb  8 00:42 cgroup
1217767 --w-------   1 hcb  hcb  0 Feb  8 00:42 clear_refs
 765552 -r--r--r--   1 hcb  hcb  0 Feb  5 13:00 cmdline
1217755 -rw-r--r--   1 hcb  hcb  0 Feb  8 00:42 comm
1217780 -rw-r--r--   1 hcb  hcb  0 Feb  8 00:42 coredump_filter
1217773 -r--r--r--   1 hcb  hcb  0 Feb  8 00:42 cpuset
1217761 lrwxrwxrwx   1 hcb  hcb  0 Feb  8 00:42 cwd -> /opt/module/hbase-1.3.1

Linux查端口号有无被占用

[root@HOSTNAME=master zookeeper3.4]# netstat -an |grep 2888
tcp6       0      0 192.168.159.132:2888    192.168.159.137:36104   TIME_WAIT  
tcp6       0      0 192.168.159.132:2888    192.168.159.138:33818   TIME_WAIT  
[root@HOSTNAME=master zookeeper3.4]# netstat -an |grep 2888
tcp6       0      0 192.168.159.132:2888    192.168.159.137:36104   TIME_WAIT  
tcp6       0      0 192.168.159.132:2888    192.168.159.138:33818   TIME_WAIT  
[root@HOSTNAME=master zookeeper3.4]# ./bin/zkServer.sh  start
ZooKeeper JMX enabled by default
Using config: /opt/zookeeper/zookeeper3.4/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[root@HOSTNAME=master zookeeper3.4]# netstat -an |grep 2888
tcp6       0      0 192.168.159.132:39310   192.168.159.138:2888    ESTABLISHED
[root@HOSTNAME=master zookeeper3.4]# netstat -an |grep 2888

本文由 hcb 创作,采用 知识共享署名 3.0,可自由转载、引用,但需署名作者且注明文章出处。

还不快抢沙发

添加新评论