首先安装l memached 所需的 libevent 库
yum -y install gcc yum -y install gcc-c++ yum -y install openssl-devel #官网下载 https://libevent.org/ tar -zxvf libevent-2.1.12-stable.tar.gz cd libevent-2.1.12-stable/ ./configure --prefix=/usr/local/libevent make && make install
安装 memached
安装:
#官网下载 http://memcached.org/ tar -zxvf memcached-1.6.9.tar.gz cd memcached-1.6.9/ ./configure --prefix=/usr/local/memcache --with-libevent=/usr/local/libevent make && make install
# --with-libevent = 刚才安装libevent 的路劲 启动: /usr/local/memcache/bin/memcached -m 64m -d -u root -l 0.0.0.0 (-m 内存 -d 守护进程 -u 用户 -l 所有人链接) netstat -tunpl|grep 11211 外界链接:
# 查看防火墙 开方端口/没有则开启/重启防火墙 firewall-cmd --zone=public --list-ports firewall-cmd --zone=public --add-port=11211/tcp --permanent firewall-cmd --reload windwos 链接(telnet ):
cmd-> telnet 192.168.175.128 11211 停止: pkill memcached netstat -tunpl|grep 11211