centos7下memcached的安装配置
memcached 依赖 libevent-devel
首先安装libevent-devel
yum -y install libevent-devel
安装完毕!
继续安装memcached
yum install memcached #命令安装比较简单,还可以采用tar包安装,不过redis已经介绍过了,就不多介绍
启动服务
/usr/local/bin/memcached -d -m 10 -u root -l 127.0.0.1 -p 12000 -c 256 -P /tmp/memcached.pid
-d选项是启动一个守护进程,
-m是分配给Memcache使用的内存数量,单位是MB,我这里是10MB,
-u是运行Memcache的用户,我这里是root,
-l是监听的服务器IP地址,如果有多个地址的话,我这里指定了服务器的IP地址127.0.0.1
-p是设置Memcache监听的端口,我这里设置了12000,最好是1024以上的端口,
-c选项是最大运行的并发连接数,默认是1024,我这里设置了256,按照你服务器的负载量来设定,
-P是设置保存Memcache的pid文件,我这里是保存在 /tmp/memcached.pid,
检查是 否安装成功
[root@localhost bin]# memcached -d -m 10 -u root -l 127.0.0.1 -p 12000 -c 256 -p /tmp/memcached.pid
[root@localhost bin]# ps -aux | grep memcached
root 4352 0.0 0.0 63420 920 ? Ssl 08:49 0:00 memcached -d -m 10 -u root -l 127.0.0.1 -p 12000 -c 256 -p /tmp/memcached.pid
root 4371 0.0 0.0 112676 980 pts/0 S+ 08:49 0:00 grep --color=auto memcached
关闭memcached
kill -9 进程pid
启动与开机自动启动
安装成功后进入memcached的bin目录执行启动: ./memcached -u root -d
最好再将memcache设置为开机启动,通过vi命令打开/etc/rc.local并在尾部追加如下配置: /usr/local/memcached/bin/memcached -u root -d
最后看一下memcached的运行状态: ps -ef |grep memcached
# 如果看到这些就说明memcached运行正常
[root@localhost bin]# ps -ef |grep memcached
root 4352 1 0 08:49 ? 00:00:00 memcached -d -m 10 -u root -l 127.0.0.1 -p 12000 -c 256 -p /tmp/memcached.pid
root 4491 3262 0 08:53 pts/0 00:00:00 grep --color=auto memcached
pgrep memcached(查看进程pid)
[root@localhost bin]# pgrep memcached
4352
[root@localhost bin]# kill -9 4352
[root@localhost bin]# pgrep memchched
[root@localhost bin]#
centos7下memcached的安装配置的更多相关文章
- CentOS7下RabbitMQ服务安装配置
参考文档: CentOS7下RabbitMQ服务安装配置 http://www.linuxidc.com/Linux/2016-03/129557.htm 在linux下安装配置rabbitMQ详细教 ...
- CentOS7下RabbitMQ服务安装配置胜多负少
RabbitMQ是流行的开源消息队列系统,是AMQP(Advanced Message Queuing Protocol高级消息队列协议)的标准实现,用erlang语言开发.RabbitMQ据说具有良 ...
- CentOS7下RabbitMQ服务安装配置 (亲测有效)
erlang 21.3 rabbitmq-server 3.7.14 下载地址 链接: https://pan.baidu.com/s/1g_T1Q_6zpyO3AepS0ZPgYQ 提取码: abq ...
- Windows下memcached的安装配置
下载windows 32位或64位 memcached 下载 memcached_dll 1.将第一个包解压放某个盘下面,比如在c:\memcached.2.在终端(也即cmd命令界面)下输入 'c: ...
- CentOS7下MySQL5.7安装配置方法图文教程(YUM)
安装环境:CentOS7 64位,MySQL5.7 1.配置YUM源 在MySQL官网中下载YUM源rpm安装包:http://dev.mysql.com/downloads/repo/yum/ # ...
- Windows下Memcached的安装配置方法
1.将第一个包解压放某个盘下面,比如在c:\memcached. 2.在终端(也即cmd命令界面)下输入 'c:\memcached\memcached.exe -d install' 安装. 3.再 ...
- CentOS7下tftp服务安装配置
1.软件包安装 root用户或者普通用户使用sudo权限执行如下命令: yum install xinetd tftp tftp-server # root 用户执行 sudo yum install ...
- Centos7 下的SVN安装与配置
Centos7 下的SVN安装与配置 1.关闭防火墙 临时关闭防火墙 systemctl stop firewalld 永久防火墙开机自关闭 systemctl disable firewalld 临 ...
- CentOS7下NFS服务安装及配置固定端口
CentOS7下NFS服务安装及配置 系统环境:CentOS Linux release 7.4.1708 (Core) 3.10.0-693.el7.x86_64 软件版本:nfs-utils-1. ...
随机推荐
- POJ2594Treasure Exploration(最小路径覆盖,相交)
Treasure Exploration Have you ever read any book about treasure exploration? Have you ever see any f ...
- hdu 3874 Assign the task
Assign the task Time Limit: 15000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) ...
- js 函数arguments一种用法
无意改同事的代码发现的 function toggle(){ var _arguments=arguments; var count=0; $("#more").click(fun ...
- hdu 1180(广搜好题)
诡异的楼梯 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others)Total Subm ...
- Drupal 有用的模块
投票模块drigg https://www.drupal.org/project/drigg
- Oracle服务扫描工具Oscanner
Oracle服务扫描工具Oscanner Oracle是甲骨文公司推出的关系型数据库,适用于中大规模数据存储,如大型企业.电信.银行等行业.Kali Linux集成了Oracle服务扫描专向工具O ...
- 【UI】为项目添加类似于淘宝筛选列表勾选的ui-choose
jQuery下载的地址:http://www.htmleaf.com/jQuery/Form/201512182916.html GitHub地址:https://github.com/wangxin ...
- xamarin studio 中SpinButton ComBox Splid 鼠标放上去就会自动接收焦点,然后进行数值变化
公司做跨平台项目,用XamarinStudio 开发mac版本,语法还是C#,但是,尼玛XamarinStudio的控件就是坑爹啊. 其他的暂时不累赘,笔者画界面,一堆控件放到一个界面上,当超出屏幕时 ...
- gitignore 规则
在使用git的过程中,总有一些我们不想被跟踪的文件,例如vim的交换文件,编译产生的文件等等.这时,我们可以在项目的根目录下创建一个名为 .gitignore 的文件,列出不想被跟踪的文件模式即可.下 ...
- iOS开发 准确计算Coretext高度
- (int)getAttributedStringHeightWithString:(NSAttributedString *) string WidthValue:(int) width{ ...