重庆分公司,新征程启航

为企业提供网站建设、域名注册、服务器等服务

centos7配置memcached

Memcached是一套分布式的高速缓存系统,用于提升网站访问速度,尤其对于一些大型的、需要频繁访问数据库的网站,访问速度提升效果十分显著。

创新互联公司是专业的鲁山网站建设公司,鲁山接单;提供成都网站建设、成都做网站,网页设计,网站设计,建网站,PHP网站建设等专业做网站服务;采用PHP框架,可快速的进行鲁山网站开发网页制作和功能扩展;专业做搜索引擎喜爱的网站,专业的做网站团队,希望更多企业前来合作!

1.安装memcached
yum install memcached
yum install libmemcached
netstat -ntpl
systemctl status memcached
systemctl start memcached
netstat -ntupl

2.配置memcached只监听127.0.0.1
vim /etc/sysconfig/memcached
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="64"
OPTIONS="-l 127.0.0.1 -U 0“ # -U 0 不启用UDP监听

systemctl restart memcached
netstat -ntpl
systemctl status memcached

3.检查memcached运行,能看到很多信息
memstat --servers="127.0.0.1"

4.配置memcached启用sasl
vim /etc/sysconfig/memcached
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="64"
OPTIONS="-l 127.0.0.1 -U 0 -S -vv"

systemctl restart memcached
netstat -ntpl
memstat --servers="127.0.0.1"
echo $?

5.安装cyrus SASL库
yum install cyrus-sasl-devel cyrus-sasl-plain

6.配置sasl
vim /etc/sasl2/memcached.conf
mech_list: plain
log_level: 5
sasldb_path: /etc/sasl2/memcached-sasldb2

cat /etc/sasl2/memcached.conf
saslpasswd2 -a memcached -c -f /etc/sasl2/memcached-sasldb2 zeng
chown memcached:memcached /etc/sasl2/memcached-sasldb2
systemctl restart memcached
netstat -ntpl
memstat --servers="127.0.0.1"
echo $?
memstat --servers="127.0.0.1" --username=zeng --password=redhat


本文名称:centos7配置memcached
文章URL:http://cqcxhl.cn/article/gohdjp.html

其他资讯

在线咨询
服务热线
服务热线:028-86922220
TOP