其他分享
首页 > 其他分享> > memcached-1.6.9的SASL认证部署

memcached-1.6.9的SASL认证部署

作者:互联网

一 环境

centos7.9
memcached-1.6.9.tar.gz
libevent-2.1.12-stable.tar.gz

二 安装依赖包

yum install -y cyrus-sasl cyrus-sasl-devel cyrus-sasl-lib cyrus-sasl-plain
yum groupinstall -y "Development tools"

三 编译安装

tar -xf libevent-2.1.12-stable.tar.gz
cd libevent-2.1.12-stable
./configure --prefix=/usr/local/libevent_2.1.12 --disable-openssl
make && make install
tar -xf memcached-1.6.9.tar.gz
cd memcached-1.6.9
./configure --prefix=/opt/module/memcached-1.6.9 --with-libevent=/usr/local/libevent_2.1.12/ --enable-sasl
make && make install

SASL配置

cd /etc/sysconfig/
cp saslauthd saslauthd.old
sed -i "s/MECH=pam/MECH=shadow/" /etc/sysconfig/saslauthd
增加用户名为:hello@unicom-sms 并输入密码
saslpasswd2 -c -a memcached hello@unicom-sms  
用户列表
sasldblistusers2
数据库授权
chmod o+r /etc/sasldb2
启动服务
service saslauthd start
chkconfig --level 235 saslauthd on

启动memcached

设置memcached的启动环境用户变量
echo "# memcached need sasl" >> ~/.bashrc
echo "export SASL_CONF_PATH=~/memcached-1.6.9/memcached.conf" >> ~/.bashrc
source ~/.bashrc
启动memcached
/opt/module/memcached-1.6.9/bin/memcached -S -d -l 172.16.71.3 -p 11211 -u yxtuser -c 1024 -m 1024 -U 0 -P /tmp/memcached.pid

标签:1.6,tar,--,sasl,libevent,SASL,memcached
来源: https://www.cnblogs.com/dbstack/p/14633245.html