线上部分机器上的memcached需要设置开机自启动
查看启动项命令如下:
systemctl list-unit-files |grep enable 查看所有启动项
设置开启自启动
添加到systemctl自启动服务,ln -s到systemctl目录下
systemctl enable memcached.service
修改/etc/sysconfig/memcached中的参数启动
cat /etc/sysconfig/memcached
PORT="11211" --- 端口
USER="memcached"
MAXCONN="4094" --- 启动连接数
CACHESIZE="125000" --- 启动内存大小
OPTIONS=" -t 16 " --启动线程数
常用命令:
禁止开机自启动
systemctl disable memcached.service
是否开机自启动
systemctl is-active memcached.service
查看所有已经启动的服务:systemctl list-units --type=service
重新加载配置文件:systemctl daemon-reload
重启服务: systemctl restart memcached.service
创建memached 用户
chattr -i /etc/passwd /etc/shadow /etc/group
usermod -s /sbin/nologin memcached
useradd -s /sbin/nologin memcached
参考:
https://blog.csdn.net/tl4832194/article/details/109781230
https://www.cnblogs.com/itbsl/p/13539583.html