Linux_Memcached 安装笔记

来源:互联网 发布:oracle sql 语法大全 编辑:程序博客网 时间:2024/05/24 05:28

环境:Vmware Workstation 10,CentOS-7-x86_64-DVD-1511.iso,Xshell 4.0,ip:192.168.216.140.

[root@localhost ~]# yum list memcached

已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.tuna.tsinghua.edu.cn
* updates: mirrors.tuna.tsinghua.edu.cn
可安装的软件包
memcached.x86_64 1.4.15-10.el7_3.1 updates

[root@localhost ~]# yum install memcached

[root@localhost ~]# service memcached start

Redirecting to /bin/systemctl start memcached.service

[root@localhost ~]# service memcached status

Redirecting to /bin/systemctl status memcached.service
● memcached.service - Memcached
Loaded: loaded (/usr/lib/systemd/system/memcached.service; disabled; vendor preset: disabled)
Active: active (running) since 六 2017-05-27 11:57:31 CST; 3s ago
Main PID: 2588 (memcached)
CGroup: /system.slice/memcached.service
└─2588 /usr/bin/memcached -u memcached -p 11211 -m 64 -c 1024

5月 27 11:57:31 localhost systemd[1]: Started Memcached.
5月 27 11:57:31 localhost systemd[1]: Starting Memcached…

或者

[root@localhost local]# systemctl start memcached.service

[root@localhost local]# systemctl status memcached.service

● memcached.service - Memcached
Loaded: loaded (/usr/lib/systemd/system/memcached.service; disabled; vendor preset: disabled)
Active: active (running) since 五 2017-06-23 16:35:26 CST; 4s ago
Main PID: 2637 (memcached)
CGroup: /system.slice/memcached.service
└─2637 /usr/bin/memcached -u memcached -p 11211 -m 64 -c 1024

6月 23 16:35:26 localhost systemd[1]: Started Memcached.
6月 23 16:35:26 localhost systemd[1]: Starting Memcached…

开放端口号11211
注意:下面命令中“–”是两个“-”,csdn显示有误。

[root@localhost bin]# firewall-cmd –zone=public –add-port=11211/tcp –permanent

success

[root@localhost bin]# firewall-cmd –reload

success

[root@localhost ~]# yum list telnet

已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.sohu.com
* extras: mirrors.sohu.com
* updates: mirrors.tuna.tsinghua.edu.cn
可安装的软件包
telnet.x86_64 1:0.17-60.el7 base

[root@localhost ~]# yum install telnet

[root@localhost ~]# telnet 127.0.0.1 11211

Trying 127.0.0.1…
Connected to 127.0.0.1.
Escape character is ‘^]’.

set age 0 0 2
25
STORED
get age
VALUE age 0 2
25
END
stats items
STAT items:1:number 2
STAT items:1:age 931
STAT items:1:evicted 0
STAT items:1:evicted_nonzero 0
STAT items:1:evicted_time 0
STAT items:1:outofmemory 0
STAT items:1:tailrepairs 0
STAT items:1:reclaimed 0
STAT items:1:expired_unfetched 0
STAT items:1:evicted_unfetched 0
END
stats cachedump 1 0
ITEM age [2 b; 1496817916 s]
ITEM name [8 b; 1496817916 s]
END

原创粉丝点击