配色: 字号:
Ubuntu下redis部署文档
2015-12-11 | 阅:  转:  |  分享 
  
LNMP是Linux+Nginx+MySQL+PHP的简称,是一套完整的PHP网站服务器架构环境。所用Linux发行版为Ubuntu14.
04,所有需要的软件均使用Ubuntu自带apt源下载安装。Ubuntu默认登录不是root用户;所以要加sudo命令才能执行某些
命令;root用户不用加sudo就可以执行命令;如:普通用户:sudo?apt-getupdateroot用户:apt-get
update安装redis第一步:源安装root@zhangyu1:~#?apt-get?install-yredis-ser
ver第二步:查看生成文件安装完成后,会在/usr/bin目录下生成本个可执行文件,分别是redis-server、redis-c
li、redis-benchmark、redis-check-aof?、redis-check-dump,它们的作用如下:mail
to:root@zhangyu1root@zhangyu1:~#?cat?/usr/bin/redis-redis-benchma
rk???redis-check-dump??redis-sentinelredis-check-aof???redis-cli?
????????redis-serverredis-server:Redis服务器的daemon启动程序redis-cli:Red
is命令行操作工具。也可以用telnet根据其纯文本协议来操作redis-benchmark:Redis性能测试工具,测试Redi
s在当前系统下的读写性能redis-check-aof:数据修复redis-check-dump:检查导出工具第三步:编辑配置文件
mailto:root@zhangyu1root@zhangyu1:~#?vim?/etc/redis/redis.conf注释这
个#bind?127.0.0.1第四步:杀死redis(安装完成后默认是启动的)mailto:root@zhangyu1root@
zhangyu1:~#?killall?redis-server第五步:启动redis;后台运行;(之后安回车或是ctrl+c)m
ailto:root@zhangyu1root@zhangyu1:~#?nohup?/usr/bin/redis-server?&
[2]?3964nohup:?忽略输入并把输出追加到"nohup.out"[1]???已完成???????????????nohu
p?/usr/bin/redis-server第六步:查看输出文件mailto:root@zhangyu1root@zhangyu
1:~#?cat?nohup.out[3964]?10?Dec?17:25:02.023?#?Warning:?no?config
?file?specified,?using?the?default?config.?In?order?to?specify?a?
config?file?use?/usr/bin/redis-server?/path/to/redis.conf[3964]?1
0?Dec?17:25:02.025??Max?number?of?open?files?set?to?10032?_._?_.
-``__?''''-._?_.-``????`.??`_.??''''-._???????????Redis?2.8.4?(000000
00/0)?64?bit?.-``?.-```.??```\/????_.,_?''''-._?(????''??????,??????
?.-`??|?`,????)?????Running?in?stand?alone?mode?|`-._`-...-`?__..
.-.``-._|''`?_.-''|?????Port:?6379?|????`-._???`._????/?????_.-''???
?|?????PID:?3964?`-._????`-._??`-./??_.-''????_.-''?|`-._`-._????`-
.__.-''????_.-''_.-''|?|????`-._`-._????????_.-''_.-''????|http://redi
s.io/http://redis.io??`-._????`-._`-.__.-''_.-''????_.-''?|`-._`-._?
???`-.__.-''????_.-''_.-''|?|????`-._`-._????????_.-''_.-''????|?`-._?
???`-._`-.__.-''_.-''????_.-''?`-._????`-.__.-''????_.-''?`-._????????
_.-''?`-.__.-''[3964]?10?Dec?17:25:02.026?#?Server?started,?Redis?v
ersion?2.8.4[3964]?10?Dec?17:25:02.027?#?WARNING?overcommit_memor
y?is?set?to?0!?Background?save?may?fail?under?low?memory?conditio
n.?To?fix?this?issue?add?''vm.overcommit_memory?=?1''?to?/etc/sysct
l.conf?and?then?reboot?or?run?the?command?''sysctl?vm.overcommit_m
emory=1''?for?this?to?take?effect.[3964]?10?Dec?17:25:02.027??DB?
loaded?from?disk:?0.000?seconds[3964]?10?Dec?17:25:02.027??The?s
erver?is?now?ready?to?accept?connections?on?port?6379第七步:查看redis运
行情况mailto:root@zhangyu1root@zhangyu1:~#?ps?-ef?|grep?redisredis??
???1170?????1??0?09:01??????????00:00:00?/usr/bin/redis-server?:6379root??????2472??2457??0?09:13?pts/1????00:00:00?grep?--color=auto?redis
献花(0)
+1
(本文系终极妖神首藏)