1.查看进程
[root@localhost ~]# ps -ef | grep elasticsearc | grep -v grep
记录进程的 进程ID
2.查看进程所打开的端口
[root@localhost ~]# netstat -anop | grep 44104
根据第一步得出的进程ID过滤,netstat一定要加-p参数
可以看到elasticsearch使用的端口为9200 和 9300
相反:也可以根据端口号,找到打开此端口的进程,同样也是使用进程ID过滤