有时由于某种原因,5432被占用,这时如果想关闭这个端口怎么做呢?
1.首先用如下命令查看端口占用情况:
[root@localhost local]# netstat -ano
2.然后查看占用5432端口的程序pid:
[root@localhost local]# lsof -i:5432
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
postgres 7035 postgres 3u IPv6 516068 0t0 TCP localhost:postgres (LISTEN)
postgres 7035 postgres 4u IPv4 516069 0t0 TCP localhost:postgres (LISTEN)
3.kill掉该进程
[root@localhost local]# kill -9 7035
加我私人微信,交流技术。
转载本文请联系原作者获取授权,同时请注明本文来自孙鹏科学网博客。
链接地址:http://blog.sciencenet.cn/blog-419883-662063.html
上一篇:如何在RHEL中为应用增加一个菜单项
下一篇:postgresql中关于md5认证的使用