[Nginx]部署使用memcached数据库软件并实现多主机调用。
Memcached 是一个高性能的分布式内存对象缓存系统,用于动态Web应用以减轻数据库负载。
Nginx软件安装参考 https://teddyou.com/?id=12
yum -y install memcached //装包
vim /usr/lib/systemd/system/memcached.service //systemctl启动文件位置
vim /etc/sysconfig/memcached //配置文件位置
systemctl restart memcached //启动服务器
ss -nutlp | grep 11211 //查询端口,是否启动 ss=netstat 程序默认端口11211
这里实现php页面的数据库调用。
php其他参数设定参考文章 https://teddyou.com/?id=12
为实现Nginx关联memcached数据库需要安装php模块化的包。
yum -y install php-pecl-memcache //安装php模块包
systemctl restart php-fpm //重启服务即可使用
发表评论