如何查看memcached的端口
- 作者: 自由四季风
- 来源: 51数据库
- 2020-12-18
默认为11211.在linux下可以ps出memcached的进程号,然后对比netstat -antp中的进程号,找到端口号,自己写的一个shell,本机测试通过。
[root@Rootop ~]# netstat -antp | grep $(ps aux | grep memcached | head -n 1 | awk '{print$2}') | awk '{print$4}' | cut -d: -f2 | sort -un | grep -v "^$"
默认为11211.在linux下可以ps出memcached的进程号,然后对比netstat -antp中的进程号,找到端口号,自己写的一个shell,本机测试通过。
[root@rootop?~]#?netstat?-antp?|?grep?$(ps?aux?|?grep?memcached?|?head?-n?1?|?awk?'{print$2}')?|?awk?'{print$4}'?|?cut?-d:?-f2?|?sort?-un?|?grep?-v?"^$"
[root@Rootop ~]# netstat -antp | grep $(ps aux | grep memcached | head -n 1 | awk '{print$2}') | awk '{print$4}' | cut -d: -f2 | sort -un | grep -v "^$"
默认为11211.在linux下可以ps出memcached的进程号,然后对比netstat -antp中的进程号,找到端口号,自己写的一个shell,本机测试通过。
[root@rootop?~]#?netstat?-antp?|?grep?$(ps?aux?|?grep?memcached?|?head?-n?1?|?awk?'{print$2}')?|?awk?'{print$4}'?|?cut?-d:?-f2?|?sort?-un?|?grep?-v?"^$"
推荐阅读