搭建lamp环境,启动memcached 服务,报错:/usr/local/memcache/bin/memcached: error while loading shared libraries:

启动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的安装文档里面

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值