您的位置:首页 > 数据库 > Memcache

Centos7下关于memcached的安装和简单使用

2017-05-14 19:21 363 查看
在这里,由于用编译安装memcached服务端过于复杂,因此我选用依赖管理工具 yum 来实现 memcached 的服务端安装:

[root@localhost /]# yum install -y memcached

-y 表示自动应答,即默认安装所有需要用到的依赖包

在这一步之后,我们就安装完了。

我们尝试去启动一下memcached:

[root@localhost /]# /usr/bin/memcached -b -l 127.0.0.1 -p 11211 -m 150 -u root

-b 守护进程模式(退出终端窗口之后使程序还在运行),-l 指定IP地址127.0.0.1 ,-p 指定端口号11211,-m 为memcached分配多少内存(单位:M),-u 指定使用哪个用户启动memcached

查看memcached是否在运行:

[root@localhost /]# ps -ef | grep memcached
//或
[root@localhost /]# pstree -p | grep memcached


如果能够看到存在memcached进程,那就说明我们的 memcached 服务端已经安装成功了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: