启动memcached 服务,遇到的问题:
[root@oracle lib]# /usr/local/memcache/bin/memcached -umemcache &
[1] 41834
[root@oracle lib]# /usr/local/memcache/bin/memcached: error while loading shared libraries: libevent-2.1.so.6: cannot open shared object file: No such file or directory
原因:找不到libevent-2.1.so.6库文件
解决办法:因为之前已经安装了libevent-devel,所以建立连接即可
[root@oracle bin]# ln -s /usr/local/lib/libevent-2.1.so.6 /usr/lib64/libevent-2.1.so.6
启动并检查:
# useradd -r -s /sbin/nologin memcache
添加 memcache 用户,此用户不用登录,不设置密码
# /usr/local/memcache/bin/memcached -umemcache &
启动 memcache 服务,并设置为后台运行
# netstat -an | grep :11211
检查 memcache 是否正常启动,并监听了 11211 端口
[root@oracle bin]# ./memcached restart -umemcache &
[1] 42026
[root@oracle bin]# netstat -anpt
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN 13395/smbd
tcp 0 0 0.0.0.0:55647 0.0.0.0:* LISTEN 2097/rpc.statd
tcp 0 0 0.0.0.0:2049 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:49219 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 30612/mysqld
tcp 0 0 0.0.0.0:11211 0.0.0.0:* LISTEN 42026/./memcached
tcp 0 0 0.0.0.0:875 0.0.0.0:* LISTEN 18111/rpc.rquotad
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 13395/smbd
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1935/rpcbind
tcp 0 0 0.0.0.0:28949 0.0.0.0:* LISTEN 18116/rpc.mountd
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 7319/vsftpd
tcp 0 0 0.0.0.0:45686 0.0.0.0:* LISTEN 18116/rpc.mountd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2264/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 2137/cupsd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2665/master
tcp 0 0 0.0.0.0:10459 0.0.0.0:* LISTEN 18116/rpc.mountd
tcp 0 0 192.168.197.134:2049 192.168.197.135:839 ESTABLISHED -
tcp 0 0 192.168.197.134:22 192.168.197.1:58734 ESTABLISHED 33237/sshd
tcp 0 0 192.168.197.134:3306 192.168.197.136:33541 TIME_WAIT -
tcp 0 0 192.168.197.134:3306 192.168.197.136:33539 TIME_WAIT -
tcp 0 0 192.168.197.134:22 192.168.197.1:57185 ESTABLISHED 32688/sshd
tcp 0 96 192.168.197.134:22 192.168.197.1:58426 ESTABLISHED 33103/sshd
tcp 0 0 192.168.197.134:22 192.168.197.1:56094 ESTABLISHED 32427/sshd
tcp 0 0 :::15741 :::* LISTEN 18116/rpc.mountd
tcp 0 0 :::445 :::* LISTEN 13395/smbd
tcp 0 0 :::2049 :::* LISTEN -
tcp 0 0 :::51618 :::* LISTEN 2097/rpc.statd
tcp 0 0 :::901 :::* LISTEN 13465/xinetd
tcp 0 0 :::11211 :::* LISTEN 42026/./memcached
tcp 0 0 :::34027 :::* LISTEN 18116/rpc.mountd
tcp 0 0 :::139 :::* LISTEN 13395/smbd
tcp 0 0 :::111 :::* LISTEN 1935/rpcbind
tcp 0 0 :::80 :::* LISTEN 31513/httpd
tcp 0 0 :::22 :::* LISTEN 2264/sshd
tcp 0 0 ::1:631 :::* LISTEN 2137/cupsd
tcp 0 0 ::1:25 :::* LISTEN 2665/master
tcp 0 0 :::50107 :::* LISTEN -
tcp 0 0 :::17308 :::* LISTEN 18116/rpc.mountd
参考:https://blog.csdn.net/aoshilang2249/article/details/78366355
具体已经记录在LAMP的安装文档里面