Linux下安装Redis服务

<p>http://redis.io/download</p><p>https://github.com/antirez/redis</p><p>http://www.oschina.net/p/redis</p><pre class="brush:bash;toolbar:false">#安装配置 wgethttp://download.redis.io/releases/redis-2.8.12.tar.gz tarxzfredis-2.8.12.tar.gz cdredis-2.8.12 make redis-server/etc/redis.conf #启动redis服务 [root@localhostopt]#redis-server/opt/software/redis-2.8.12/redis.conf [26721]24Jun15:13:49.440*Increasedmaximumnumberofopenfilesto10032(itwasoriginallysetto1024). _._ _.-``__&#39;&#39;-._ _.-```.`_.&#39;&#39;-._Redis2.8.12(00000000/0)64bit .-``.-```.```/_.,_&#39;&#39;-._ (&#39;,.-`|`,)Runninginstandalonemode |`-._`-...-`__...-.``-._|&#39;`_.-&#39;|Port:6379 |`-._`._/_.-&#39;|PID:26721 `-._`-._`-./_.-&#39;_.-&#39; |`-._`-._`-.__.-&#39;_.-&#39;_.-&#39;| |`-._`-.__.-&#39;_.-&#39;|http://redis.io `-._`-._`-.__.-&#39;_.-&#39;_.-&#39; |`-._`-._`-.__.-&#39;_.-&#39;_.-&#39;| |`-._`-.__.-&#39;_.-&#39;| `-._`-._`-.__.-&#39;_.-&#39;_.-&#39; `-._`-.__.-&#39;_.-&#39; `-.__.-&#39; `-.__.-&#39; [26721]24Jun15:13:49.441#Serverstarted,Redisversion2.8.12 [26721]24Jun15:13:49.441#WARNINGovercommit_memoryissetto0!Backgroundsavemayfailunderlowmemorycondition.Tofixthisissueadd&#39;vm.overcommit_memory=1&#39;to/etc/sysctl.confandthenrebootorrunthecommand&#39;sysctlvm.overcommit_memory=1&#39;forthistotakeeffect. [26721]24Jun15:13:49.441*Theserverisnowreadytoacceptconnectionsonport6379 se [1]+Stoppedredis-server/opt/software/redis-2.8.12/redis.conf [root@localhostopt]#ps-ef|grepredis root2672122675015:13pts/100:00:00redis-server*:6379 root2710622675015:21pts/100:00:00grepredis</pre><p>#查看服务</p><pre class="brush:bash;toolbar:false">ps-ef|grepredis</pre><p>#测试服务</p><pre class="brush:bash;toolbar:false">127.0.0.1:6379&gt;settesthaha OK 127.0.0.1:6379&gt;gettest &quot;haha&quot;</pre><p>#关闭redis服务</p><p>redis-cli shutdown</p><p>#客户端</p><p>https://github.com/xetorthio/jedis</p><p>https://github.com/taobao/tedis</p><p>#其他命令</p><p> redis-server ,redis-cli,redis-benchmark,redis-stat,作用如下:</p><p> redis-server Redis服务器的daemon启动程序</p><p> redis-cli Redis命令行操作工具。当然,你也可以用telnet根据其纯文本协议来操作</p><p> redis-benchmark Redis性能测试工具,测试Redis在你的系统及你的配置下的读写性能</p><p> redis-stat Redis状态检测工具,可以检测Redis当前状态参数及延迟状况</p>
RangeTime:0.005536s
RangeMem:206.02 KB
返回顶部 留言