<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[[实践OK]Redis安装部署研究一下，开机启动...]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Mon, 24 Aug 2015 09:12:49 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	背景：从某种意义来讲用memcache做缓存已经相当成熟，对于中小型的一些高并发也是可以的，但是伴随微博的兴起（现在好像不行了），有了No-sql这样一种东西出来，但究其从底层来讲和memcache不同在memcache是基于libevent的主进程下用pipe进行通讯的多线程机制，可能是不需要锁的还提供原子锁，而那个redis呢是基于epoll啥的事件驱动的异步的（好像是柱塞的，我再查下：是非阻塞IO ，epoll加自己实现的事件框架，redis实际上是采用了线程封闭的观念，把任务封闭在一个线程，自然避免了线程安全问题，不过对于需要依赖多个redis操作的复合操作来说，依然需要锁，而且有可能是分布式锁,这块不太明白，反正有利有弊吧，有了锁性能肯定不是太好。）一个单进程在跑，其规避了memcache的全放内存，而是隔一会儿会刷新到那个较为活跃的数据到硬盘里，还支持一部分的数据结构，结构化数据可能会影响其性能，其稳定性和高效来讲，我个人觉得和memcache差不多（mm略高一丝），但对大的粒度的存储来讲，可能mm性能更好，而对于小粒度那当然是redis了，这是因为一个是基于多线程和单进程，二是epoll这玩意好像生来就有这个对大粒度的东西不是太在行，比如：apache之于用epoll写的nginx，对于长时间的重逻辑处理来讲还是apache稳定，至于为什么，这个是实践出来的。获取数据和设置数据在协议上memcache是字符的，redis是二进制？？？<br/>好了，下载一个最新稳定版本的吧：<br/>http://download.redis.io/releases/redis-3.0.3.tar.gz<br/>http://download.redis.io/releases/redis-stable.tar.gz<br/>解压缩： tar -zxvf redis-3.0.3.tar.gz<br/>cd redis-3.0.3<br/>$ make<br/>$make install<br/>$cp redis.conf /etc/<br/><br/><br/>Q:默认目录：/usr/local/bin 我不想装这儿啊。怎么办？<br/>A:make完&nbsp;&nbsp;不要install了 手工做<br/>make完了之后，cd utils，里面有个install_server.sh，执行的时候会问你要安装到哪个路径<br/>./install_server.sh <br/><textarea name="code" class="php" rows="15" cols="100">
[root@localhost utils]# ./install_server.sh 
Welcome to the redis service installer
This script will help you easily set up a running redis server

Please select the redis port for this instance: [6379] 
Selecting default: 6379
Please select the redis config file name [/etc/redis/6379.conf] /etc/redis/6379.conf
Please select the redis log file name [/var/log/redis_6379.log] /data/logs/redis/redis_6379.log
Please select the data directory for this instance [/var/lib/redis/6379] /data/db/redis/6379
Please select the redis executable path [] /usr/local/redis/
Selected config:
Port&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 6379
Config file&nbsp;&nbsp;&nbsp;&nbsp;: /etc/redis/6379.conf
Log file&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : /data/logs/redis/redis_6379.log
Data dir&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : /data/db/redis/6379
Executable&nbsp;&nbsp;&nbsp;&nbsp; : /usr/local/redis/bin/redis-server
Cli Executable : /usr/local/redis-cli
Is this ok? Then press ENTER to go on or Ctrl-C to abort.
</textarea><br/><br/><br/>参数介绍：<br/>make install命令执行完成后，会在/usr/local/bin目录下生成本个可执行文件，分别是redis-server、redis-cli、redis-benchmark、redis-check-aof 、redis-check-dump<br/>redis-server：Redis服务器的daemon启动程序<br/>redis-cli：Redis命令行操作工具。也可以用telnet根据其纯文本协议来操作<br/>redis-benchmark：Redis性能测试工具，测试Redis在当前系统下的读写性能<br/>redis-check-aof：数据修复<br/>redis-check-dump：检查导出工具<br/>修改系统配置文件，执行命令<br/>a) echo vm.overcommit_memory=1 &gt;&gt; /etc/sysctl.conf<br/>b) sysctl vm.overcommit_memory=1 或执行echo vm.overcommit_memory=1 &gt;&gt;/proc/sys/vm/overcommit_memory<br/>修改redis配置文件<br/>a) $ cd /etc<br/>b) vi redis.conf<br/>c) 修改daemonize yes---目的使进程在后台运行<br/>启动redis<br/>a) $ cd /usr/local/bin<br/>b) ./redis-server /etc/redis.conf<br/>/usr/local/bin/redis-server /etc/redis.conf<br/>/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf<br/>7． 检查是否启动成功<br/>a) $ ps -ef &#124; grep redis<br/><br/>果然是单进程且是epoll：<br/>[root@localhost bin]# ps -ef &#124; grep redis<br/>root&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 317&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;0 17:20 ?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;00:00:00 ./redis-server *:6379<br/>[root@localhost bin]# strace&nbsp;&nbsp;-f -p 317<br/>Process 317 attached with 3 threads - interrupt to quit<br/>[pid&nbsp;&nbsp; 325] futex(0x6e6c54, FUTEX_WAIT_PRIVATE, 1, NULL &lt;unfinished ...&gt;<br/>[pid&nbsp;&nbsp; 324] futex(0x6e6c24, FUTEX_WAIT_PRIVATE, 1, NULL &lt;unfinished ...&gt;<br/>[pid&nbsp;&nbsp; 317] epoll_wait(3, &#123;&#125;, 10128, 3) = 0<br/>[pid&nbsp;&nbsp; 317] open(&quot;/proc/317/stat&quot;, O_RDONLY) = 6<br/>[pid&nbsp;&nbsp; 317] read(6, &quot;317 (redis-server) R 1 317 317 0&quot;..., 4096) = 233<br/>[pid&nbsp;&nbsp; 317] close(6)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= 0<br/>[pid&nbsp;&nbsp; 317] epoll_wait(3, &#123;&#125;, 10128, 100) = 0<br/>[pid&nbsp;&nbsp; 317] open(&quot;/proc/317/stat&quot;, O_RDONLY) = 6<br/>[pid&nbsp;&nbsp; 317] read(6, &quot;317 (redis-server) R 1 317 317 0&quot;..., 4096) = 233<br/>[pid&nbsp;&nbsp; 317] close(6)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= 0<br/>[pid&nbsp;&nbsp; 317] epoll_wait(3, &#123;&#125;, 10128, 100) = 0<br/>[pid&nbsp;&nbsp; 317] open(&quot;/proc/317/stat&quot;, O_RDONLY) = 6<br/>[pid&nbsp;&nbsp; 317] read(6, &quot;317 (redis-server) R 1 317 317 0&quot;..., 4096) = 233<br/>[pid&nbsp;&nbsp; 317] close(6)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= 0<br/>[pid&nbsp;&nbsp; 317] epoll_wait(3,&nbsp;&nbsp;&lt;unfinished ...&gt;<br/>PHP是最好的语言，那安装个PHP扩展，选个自己的PHP版本的扩展：<br/>https://github.com/nicolasff/phpredis/downloads<br/>[root@localhost software]# php -v<br/>PHP 5.3.10 (cli) (built: Jun&nbsp;&nbsp;4 2013 11:51:25)<br/>Win:https://github.com/downloads/phpredis/phpredis/php_redis-5.3-vc9-ts-73d99c3e.zip<br/>*nix: https://github.com/phpredis/phpredis<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;https://github.com/phpredis/phpredis/releases<br/>Linux代码&nbsp;&nbsp;收藏代码<br/>$&nbsp;&nbsp;tar zxvf nicolasff-phpredis-2.2.2-48-g7dfac44.tar.gz&nbsp;&nbsp;<br/>$ cd&nbsp;&nbsp;nicolasff-phpredis-7dfac44/&nbsp;&nbsp;<br/>$ /usr/local/webserver/php/bin/phpize&nbsp;&nbsp;<br/>$ ./configure --with-php-config=/usr/local/webserver/php/bin/php-config&nbsp;&nbsp;<br/>$ make&nbsp;&nbsp; <br/>$ make install&nbsp;&nbsp;<br/> 3 修改php.ini<br/>&nbsp;&nbsp;&nbsp;&nbsp;查看/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613是否有redis.so<br/>[root@localhost phpredis-2.2.7]# make install<br/>Installing shared extensions:&nbsp;&nbsp;&nbsp;&nbsp; /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/<br/>在php.ini中 添加&nbsp;&nbsp;<br/>&nbsp;&nbsp;extension=redis.so<br/>/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/redis.so<br/>[root@localhost phpredis-2.2.7]# php -i&#124;grep php.ini<br/>Configuration File (php.ini) Path =&gt; /usr/local/php/etc<br/>Loaded Configuration File =&gt; /usr/local/php/etc/php.ini<br/>[root@localhost phpredis-2.2.7]# vi /usr/local/php/etc/php.ini<br/>4 重启php进程 <br/>&nbsp;&nbsp;$&nbsp;&nbsp;/usr/local/webserver/php/sbin/php-fpm restart<br/>5 查看phpinfo() 是否有redis扩展<br/><br/>6 用PHP文件测试<br/>Php代码<br/><textarea name="code" class="php" rows="15" cols="100">
&lt;?php&nbsp;&nbsp;&nbsp;&nbsp;
$redis = new Redis();&nbsp;&nbsp;&nbsp;&nbsp;
$redis-&gt;connect(&#039;192.168.109.7&#039;,6379);&nbsp;&nbsp;&nbsp;&nbsp;
$redis-&gt;set(&#039;long&#039;,&#039;Hello World&#039;);&nbsp;&nbsp;&nbsp;&nbsp;
echo $redis-&gt;get(&#039;long&#039;);&nbsp;&nbsp; 
</textarea><br/> 输出:Hello World<br/>成功！<br/>参考来自：http://alfred-long.iteye.com/blog/1685092<br/>redis server安装部分摘自并参考：http://www.cnblogs.com/zhuhongbao/archive/2013/06/04/3117997.html<br/><br/>开机启动,没试过，需要实践：<br/><textarea name="code" class="php" rows="15" cols="100">
#!/bin/sh&nbsp;&nbsp;
#chkconfig: 345 86 14&nbsp;&nbsp;
#description: Startup and shutdown script for Redis&nbsp;&nbsp;
PROGDIR=/usr/redis #安装路径&nbsp;&nbsp;
PROGNAME=redis-server&nbsp;&nbsp;
DAEMON=$PROGDIR/$PROGNAME&nbsp;&nbsp;
CONFIG=/usr/redis/redis.conf&nbsp;&nbsp;
PIDFILE=/var/run/redis.pid&nbsp;&nbsp;
DESC=&quot;redis daemon&quot;&nbsp;&nbsp;
SCRIPTNAME=/etc/rc.d/init.d/redis&nbsp;&nbsp;
start()&nbsp;&nbsp;
&#123;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if test -x $DAEMON&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; then&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo -e &quot;Starting $DESC: $PROGNAME&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if $DAEMON $CONFIG&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; then&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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&nbsp; fi&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo -e &quot;No Redis Server ($DAEMON) running&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fi&nbsp;&nbsp;
&#125;&nbsp;&nbsp;
restart()&nbsp;&nbsp;
&#123;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;echo -e &quot;Restarting $DESC: $PROGNAME&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;stop&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; start&nbsp;&nbsp;
&#125;&nbsp;&nbsp;
list()&nbsp;&nbsp;
&#123;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ps aux &#124; grep $PROGNAME&nbsp;&nbsp;
&#125;&nbsp;&nbsp;
case $1 in&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; start)&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; start&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stop)&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;stop&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; restart)&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;restart&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; list)&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;list&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *)&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Usage: $SCRIPTNAME &#123;start&#124;stop&#124;restart&#124;list&#125;&quot; &gt;&amp;2&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit 1&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;&nbsp;
esac&nbsp;&nbsp;
exit 0&nbsp;&nbsp;
##############################
</textarea><br/>把上述代码存为redis,放到/etc/init.d/下面<br/>[html] view plaincopy在CODE上查看代码片派生到我的代码片<br/>chmod +x /etc/init.d/redis&nbsp;&nbsp;<br/>设定开机启动服务<br/>sudo chkconfig redis on&nbsp;&nbsp;<br/>启动,停止redis<br/>service redis start&nbsp;&nbsp; #或者 /etc/init.d/redis start&nbsp;&nbsp;<br/>service redis stop&nbsp;&nbsp; #或者 /etc/init.d/redis stop&nbsp;&nbsp;<br/>测试redis<br/>redis-cli&nbsp;&nbsp; <br/>redis 127.0.0.1:6379&gt; set foo 123&nbsp;&nbsp;<br/>OK&nbsp;&nbsp;<br/>redis 127.0.0.1:6379&gt; get foo&nbsp;&nbsp;<br/>&quot;123&quot;&nbsp;&nbsp;<br/>redis 127.0.0.1:6379&gt; exit&nbsp;&nbsp;
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] [实践OK]Redis安装部署研究一下，开机启动...]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>