1. linux环境下redis集群的搭建全过程:
  2.  
  3. 使用mount命令将光盘挂载到/mnt/cdrom目录下:
  4. [root@hadoop03 ~]# mount -t iso9660 -o ro /dev/cdrom /mnt/cdrom
  5.  
  6. 使用yum安装redis的编译环境gcc-c++:
  7. [root@hadoop03 ~]# yum install gcc-c++
  8. Loaded plugins: fastestmirror, refresh-packagekit, security
  9. Setting up Install Process
  10. Loading mirror speeds from cached hostfile
  11. Resolving Dependencies
  12. --> Running transaction check
  13. ---> Package gcc-c++.x86_64 0:4.4.7-16.el6 will be installed
  14. --> Processing Dependency: libstdc++-devel = 4.4.7-16.el6 for package: gcc-c++-4.4.7-16.el6.x86_64
  15. --> Running transaction check
  16. ---> Package libstdc++-devel.x86_64 0:4.4.7-16.el6 will be installed
  17. --> Finished Dependency Resolution
  18.  
  19. Dependencies Resolved
  20.  
  21. =======================================================================================================================================================================
  22. Package Arch Version Repository Size
  23. =======================================================================================================================================================================
  24. Installing:
  25. gcc-c++ x86_64 4.4.7-16.el6 c6-media 4.7 M
  26. Installing for dependencies:
  27. libstdc++-devel x86_64 4.4.7-16.el6 c6-media 1.6 M
  28.  
  29. Transaction Summary
  30. =======================================================================================================================================================================
  31. Install 2 Package(s)
  32.  
  33. Total download size: 6.3 M
  34. Installed size: 20 M
  35. Is this ok [y/N]: y
  36. Downloading Packages:
  37. -----------------------------------------------------------------------------------------------------------------------------------------------------------------------
  38. Total 25 MB/s | 6.3 MB 00:00
  39. Running rpm_check_debug
  40. Running Transaction Test
  41. Transaction Test Succeeded
  42. Running Transaction
  43. Installing : libstdc++-devel-4.4.7-16.el6.x86_64 1/2
  44. Installing : gcc-c++-4.4.7-16.el6.x86_64 2/2
  45. Verifying : libstdc++-devel-4.4.7-16.el6.x86_64 1/2
  46. Verifying : gcc-c++-4.4.7-16.el6.x86_64 2/2
  47.  
  48. Installed:
  49. gcc-c++.x86_64 0:4.4.7-16.el6
  50.  
  51. Dependency Installed:
  52. libstdc++-devel.x86_64 0:4.4.7-16.el6
  53.  
  54. Complete!
  55.  
  56. [root@hadoop03 ~]# yum list |grep ruby
  57. graphviz-ruby.x86_64 2.26.0-10.el6 c6-media
  58. libselinux-ruby.x86_64 2.0.94-5.8.el6 c6-media
  59. openwsman-ruby.x86_64 2.2.3-8.el6 c6-media
  60. rrdtool-ruby.x86_64 1.3.8-7.el6 c6-media
  61. ruby.x86_64 1.8.7.374-4.el6_6 c6-media
  62. ruby-devel.i686 1.8.7.374-4.el6_6 c6-media
  63. ruby-devel.x86_64 1.8.7.374-4.el6_6 c6-media
  64. ruby-docs.x86_64 1.8.7.374-4.el6_6 c6-media
  65. ruby-flexmock.noarch 0.8.6-1.1.el6 c6-media
  66. ruby-irb.x86_64 1.8.7.374-4.el6_6 c6-media
  67. ruby-libguestfs.x86_64 1:1.20.11-14.el6 c6-media
  68. ruby-libs.i686 1.8.7.374-4.el6_6 c6-media
  69. ruby-libs.x86_64 1.8.7.374-4.el6_6 c6-media
  70. ruby-qpid.x86_64 0.7.946106-2.el6 c6-media
  71. ruby-qpid-qmf.x86_64 0.14-14.el6_3 c6-media
  72. ruby-rdoc.x86_64 1.8.7.374-4.el6_6 c6-media
  73. ruby-ri.x86_64 1.8.7.374-4.el6_6 c6-media
  74. ruby-saslwrapper.x86_64 0.14-1.el6 c6-media
  75. ruby-static.x86_64 1.8.7.374-4.el6_6 c6-media
  76. ruby-tcltk.x86_64 1.8.7.374-4.el6_6 c6-media
  77. rubygem-flexmock.noarch 0.8.6-1.1.el6 c6-media
  78. rubygem-flexmock-doc.noarch 0.8.6-1.1.el6 c6-media
  79. rubygem-rake.noarch 0.8.7-2.1.el6 c6-media
  80. rubygems.noarch 1.3.7-5.el6 c6-media
  81. rubygems-devel.noarch 1.3.7-5.el6 c6-media
  82. subversion-ruby.i686 1.6.11-14.el6 c6-media
  83. subversion-ruby.x86_64 1.6.11-14.el6 c6-media
  84.  
  85. 使用yum安装ruby
  86. [root@hadoop03 ~]# yum install ruby -y
  87. Loaded plugins: fastestmirror, refresh-packagekit, security
  88. Setting up Install Process
  89. Loading mirror speeds from cached hostfile
  90. Resolving Dependencies
  91. --> Running transaction check
  92. ---> Package ruby.x86_64 0:1.8.7.374-4.el6_6 will be installed
  93. --> Processing Dependency: ruby-libs = 1.8.7.374-4.el6_6 for package: ruby-1.8.7.374-4.el6_6.x86_64
  94. --> Processing Dependency: libruby.so.1.8()(64bit) for package: ruby-1.8.7.374-4.el6_6.x86_64
  95. --> Running transaction check
  96. ---> Package ruby-libs.x86_64 0:1.8.7.374-4.el6_6 will be installed
  97. --> Processing Dependency: libreadline.so.5()(64bit) for package: ruby-libs-1.8.7.374-4.el6_6.x86_64
  98. --> Running transaction check
  99. ---> Package compat-readline5.x86_64 0:5.2-17.1.el6 will be installed
  100. --> Finished Dependency Resolution
  101.  
  102. Dependencies Resolved
  103.  
  104. =======================================================================================================================================================================
  105. Package Arch Version Repository Size
  106. =======================================================================================================================================================================
  107. Installing:
  108. ruby x86_64 1.8.7.374-4.el6_6 c6-media 538 k
  109. Installing for dependencies:
  110. compat-readline5 x86_64 5.2-17.1.el6 c6-media 130 k
  111. ruby-libs x86_64 1.8.7.374-4.el6_6 c6-media 1.7 M
  112.  
  113. Transaction Summary
  114. =======================================================================================================================================================================
  115. Install 3 Package(s)
  116.  
  117. Total download size: 2.3 M
  118. Installed size: 7.8 M
  119. Downloading Packages:
  120. -----------------------------------------------------------------------------------------------------------------------------------------------------------------------
  121. Total 6.3 MB/s | 2.3 MB 00:00
  122. Running rpm_check_debug
  123. Running Transaction Test
  124. Transaction Test Succeeded
  125. Running Transaction
  126. Installing : compat-readline5-5.2-17.1.el6.x86_64 1/3
  127. Installing : ruby-libs-1.8.7.374-4.el6_6.x86_64 2/3
  128. Installing : ruby-1.8.7.374-4.el6_6.x86_64 3/3
  129. Verifying : compat-readline5-5.2-17.1.el6.x86_64 1/3
  130. Verifying : ruby-libs-1.8.7.374-4.el6_6.x86_64 2/3
  131. Verifying : ruby-1.8.7.374-4.el6_6.x86_64 3/3
  132.  
  133. Installed:
  134. ruby.x86_64 0:1.8.7.374-4.el6_6
  135.  
  136. Dependency Installed:
  137. compat-readline5.x86_64 0:5.2-17.1.el6 ruby-libs.x86_64 0:1.8.7.374-4.el6_6
  138.  
  139. Complete!
  140.  
  141. 使用yum安装rubygems
  142. [root@hadoop03 ~]# yum install rubygems -y
  143. Loaded plugins: fastestmirror, refresh-packagekit, security
  144. Setting up Install Process
  145. Loading mirror speeds from cached hostfile
  146. Resolving Dependencies
  147. --> Running transaction check
  148. ---> Package rubygems.noarch 0:1.3.7-5.el6 will be installed
  149. --> Processing Dependency: ruby-rdoc for package: rubygems-1.3.7-5.el6.noarch
  150. --> Running transaction check
  151. ---> Package ruby-rdoc.x86_64 0:1.8.7.374-4.el6_6 will be installed
  152. --> Processing Dependency: ruby-irb = 1.8.7.374-4.el6_6 for package: ruby-rdoc-1.8.7.374-4.el6_6.x86_64
  153. --> Running transaction check
  154. ---> Package ruby-irb.x86_64 0:1.8.7.374-4.el6_6 will be installed
  155. --> Finished Dependency Resolution
  156.  
  157. Dependencies Resolved
  158.  
  159. =======================================================================================================================================================================
  160. Package Arch Version Repository Size
  161. =======================================================================================================================================================================
  162. Installing:
  163. rubygems noarch 1.3.7-5.el6 c6-media 207 k
  164. Installing for dependencies:
  165. ruby-irb x86_64 1.8.7.374-4.el6_6 c6-media 317 k
  166. ruby-rdoc x86_64 1.8.7.374-4.el6_6 c6-media 381 k
  167.  
  168. Transaction Summary
  169. =======================================================================================================================================================================
  170. Install 3 Package(s)
  171.  
  172. Total download size: 905 k
  173. Installed size: 3.0 M
  174. Downloading Packages:
  175. -----------------------------------------------------------------------------------------------------------------------------------------------------------------------
  176. Total 11 MB/s | 905 kB 00:00
  177. Running rpm_check_debug
  178. Running Transaction Test
  179. Transaction Test Succeeded
  180. Running Transaction
  181. Installing : ruby-irb-1.8.7.374-4.el6_6.x86_64 1/3
  182. Installing : ruby-rdoc-1.8.7.374-4.el6_6.x86_64 2/3
  183. Installing : rubygems-1.3.7-5.el6.noarch 3/3
  184. Verifying : ruby-rdoc-1.8.7.374-4.el6_6.x86_64 1/3
  185. Verifying : ruby-irb-1.8.7.374-4.el6_6.x86_64 2/3
  186. Verifying : rubygems-1.3.7-5.el6.noarch 3/3
  187.  
  188. Installed:
  189. rubygems.noarch 0:1.3.7-5.el6
  190.  
  191. Dependency Installed:
  192. ruby-irb.x86_64 0:1.8.7.374-4.el6_6 ruby-rdoc.x86_64 0:1.8.7.374-4.el6_6
  193.  
  194. Complete!
  195.  
  196. [root@hadoop03 ~]# cd /root/apps/taotao/
  197. [root@hadoop03 taotao]# ll
  198. total 1392
  199. -rw-r--r--. 1 root root 57856 Dec 29 05:14 redis-3.0.0.gem
  200. -rw-r--r--. 1 root root 1358081 Dec 29 05:14 redis-3.0.0.tar.gz
  201. drwxr-xr-x. 9 root root 4096 Dec 27 17:51 tomcat-manager-8080
  202.  
  203. 使用gem install命令安装redis-3.0.0.gem
  204. [root@hadoop03 taotao]# gem install redis-3.0.0.gem
  205. Successfully installed redis-3.0.0
  206. 1 gem installed
  207. Installing ri documentation for redis-3.0.0...
  208. Installing RDoc documentation for redis-3.0.0...
  209.  
  210. 使用tar -zxvf命令来解压redis-3.0.0.tar.gz这个源码包:
  211. [root@hadoop03 taotao]# tar -zxvf redis-3.0.0.tar.gz
  212. .............
  213. .............
  214. .............
  215. [root@hadoop03 taotao]# ll
  216. total 1396
  217. drwxrwxr-x. 6 root root 4096 Apr 1 2015 redis-3.0.0
  218. -rw-r--r--. 1 root root 57856 Dec 29 05:14 redis-3.0.0.gem
  219. -rw-r--r--. 1 root root 1358081 Dec 29 05:14 redis-3.0.0.tar.gz
  220. drwxr-xr-x. 9 root root 4096 Dec 27 17:51 tomcat-manager-8080
  221.  
  222. 进入到redis-3.0.0目录下面,使用make命令编译redis源码:
  223. [root@hadoop03 taotao]# cd redis-3.0.0
  224. [root@hadoop03 redis-3.0.0]# make
  225. .............
  226. .............
  227. .............
  228. LINK redis-server
  229. INSTALL redis-sentinel
  230. CC redis-cli.o
  231. LINK redis-cli
  232. CC redis-benchmark.o
  233. LINK redis-benchmark
  234. CC redis-check-dump.o
  235. LINK redis-check-dump
  236. CC redis-check-aof.o
  237. LINK redis-check-aof
  238.  
  239. 使用make install命令安装redis,并使用PREFIX指定要把redis安装到/root/apps/taotao/redis-taotao目录下:
  240. [root@hadoop03 redis-3.0.0]# make install PREFIX=/root/apps/taotao/redis-taotao
  241. cd src && make install
  242. make[1]: Entering directory `/root/apps/taotao/redis-3.0.0/src'
  243.  
  244. Hint: It's a good idea to run 'make test' ;)
  245.  
  246. INSTALL install
  247. INSTALL install
  248. INSTALL install
  249. INSTALL install
  250. INSTALL install
  251. make[1]: Leaving directory `/root/apps/taotao/redis-3.0.0/src'
  252. [root@hadoop03 redis-3.0.0]# cd /root/apps/taotao/
  253. [root@hadoop03 taotao]# ll
  254. total 1400
  255. drwxrwxr-x. 6 root root 4096 Apr 1 2015 redis-3.0.0
  256. -rw-r--r--. 1 root root 57856 Dec 29 05:14 redis-3.0.0.gem
  257. -rw-r--r--. 1 root root 1358081 Dec 29 05:14 redis-3.0.0.tar.gz
  258. drwxr-xr-x. 3 root root 4096 Dec 29 06:11 redis-taotao
  259. drwxr-xr-x. 9 root root 4096 Dec 27 17:51 tomcat-manager-8080
  260. [root@hadoop03 taotao]# cd redis-taotao/
  261. [root@hadoop03 redis-taotao]# ll
  262. total 4
  263. drwxr-xr-x. 2 root root 4096 Dec 29 06:11 bin
  264. [root@hadoop03 redis-taotao]# cd bin/
  265. [root@hadoop03 bin]# ll
  266. total 15440
  267. -rwxr-xr-x. 1 root root 4588878 Dec 29 06:11 redis-benchmark
  268. -rwxr-xr-x. 1 root root 22185 Dec 29 06:11 redis-check-aof
  269. -rwxr-xr-x. 1 root root 45403 Dec 29 06:11 redis-check-dump
  270. -rwxr-xr-x. 1 root root 4691785 Dec 29 06:11 redis-cli
  271. lrwxrwxrwx. 1 root root 12 Dec 29 06:11 redis-sentinel -> redis-server
  272. -rwxr-xr-x. 1 root root 6450305 Dec 29 06:11 redis-server
  273.  
  274. 把redis-3.0.0源码目录下面的redis.conf文件拷贝到/root/apps/taotao/redis-taotao/bin目录下:
  275. [root@hadoop03 bin]# cp /root/apps/taotao/redis-3.0.0/redis.conf .
  276. [root@hadoop03 bin]# ll
  277. total 15484
  278. -rwxr-xr-x. 1 root root 4588878 Dec 29 06:11 redis-benchmark
  279. -rwxr-xr-x. 1 root root 22185 Dec 29 06:11 redis-check-aof
  280. -rwxr-xr-x. 1 root root 45403 Dec 29 06:11 redis-check-dump
  281. -rwxr-xr-x. 1 root root 4691785 Dec 29 06:11 redis-cli
  282. -rw-r--r--. 1 root root 41403 Dec 29 06:15 redis.conf
  283. lrwxrwxrwx. 1 root root 12 Dec 29 06:11 redis-sentinel -> redis-server
  284. -rwxr-xr-x. 1 root root 6450305 Dec 29 06:11 redis-server
  285. [root@hadoop03 bin]#
  286.  
  287. 使用vi命令编辑redis.conf文件,将其中的配置参数"daemonize no"修改成"daemonize yes",表示开启redis服务器的后台启动模式:
  288. [root@hadoop03 bin]# vi redis.conf
  289. # Redis configuration file example
  290.  
  291. # Note on units: when memory size is needed, it is possible to specify
  292. # it in the usual form of 1k 5GB 4M and so forth:
  293. #
  294. # 1k => 1000 bytes
  295. # 1kb => 1024 bytes
  296. # 1m => 1000000 bytes
  297. # 1mb => 1024*1024 bytes
  298. # 1g => 1000000000 bytes
  299. # 1gb => 1024*1024*1024 bytes
  300. #
  301. # units are case insensitive so 1GB 1Gb 1gB are all the same.
  302.  
  303. ################################## INCLUDES ###################################
  304.  
  305. # Include one or more other config files here. This is useful if you
  306. # have a standard template that goes to all Redis servers but also need
  307. # to customize a few per-server settings. Include files can include
  308. # other files, so use this wisely.
  309. #
  310. # Notice option "include" won't be rewritten by command "CONFIG REWRITE"
  311. # from admin or Redis Sentinel. Since Redis always uses the last processed
  312. # line as value of a configuration directive, you'd better put includes
  313. # at the beginning of this file to avoid overwriting config change at runtime.
  314. #
  315. # If instead you are interested in using includes to override configuration
  316. # options, it is better to use include as the last line.
  317. #
  318. # include /path/to/local.conf
  319. # include /path/to/other.conf
  320.  
  321. ################################ GENERAL #####################################
  322.  
  323. # By default Redis does not run as a daemon. Use 'yes' if you need it.
  324. # Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
  325. daemonize yes
  326.  
  327. ...............
  328. ...............
  329. ...............
  330. ...............
  331. [root@hadoop03 bin]#
  332.  
  333. 使用redis-server命令后面跟上redis.conf配置文件,就可以以后台模式启动redis服务器:
  334. [root@hadoop03 bin]# ./redis-server redis.conf
  335.  
  336. 查看redis的进程,说明redis服务器已经成功启动,其默认的端口号为6379
  337. [root@hadoop03 bin]# ps aux|grep redis
  338. root 4251 0.1 0.3 137448 7544 ? Ssl 04:58 0:09 bin/redis-server *:6379
  339. root 7275 0.0 0.0 103308 852 pts/1 S+ 06:27 0:00 grep redis
  340. [root@hadoop03 bin]#
  341.  
  342. 启动redis的客户端:
  343. [root@hadoop03 bin]# ./redis-cli
  344.  
  345. 下面是redis的一些常用命令:
  346. 127.0.0.1:6379> ping
  347. PONG
  348. 127.0.0.1:6379> set a 10
  349. OK
  350. 127.0.0.1:6379> get a
  351. ""
  352. 127.0.0.1:6379> keys *
  353. 1) "a"
  354.  
  355. a1的命令是incr
  356. 127.0.0.1:6379> incr a
  357. (integer) 11
  358.  
  359. a1的命令是decr
  360. 127.0.0.1:6379> decr a
  361. (integer) 10
  362. 127.0.0.1:6379> del a
  363. (integer) 1
  364. 127.0.0.1:6379> keys *
  365. (empty list or set)
  366. 127.0.0.1:6379>
  367. [root@hadoop03 bin]#
  368.  
  369. 然后是redis的常用数据类型是String,Hash,List,Set,SortedSet(其中的ListSortedSet比较耗费性能,因为它们要排序,
  370. 我们比较常用的数据类型是StringHash,因为它们都是key-value类型的)。
  371.  
  372. [root@hadoop03 bin]# ll
  373. total 15484
  374. -rwxr-xr-x. 1 root root 4588878 Dec 29 06:11 redis-benchmark
  375. -rwxr-xr-x. 1 root root 22185 Dec 29 06:11 redis-check-aof
  376. -rwxr-xr-x. 1 root root 45403 Dec 29 06:11 redis-check-dump
  377. -rwxr-xr-x. 1 root root 4691785 Dec 29 06:11 redis-cli
  378. -rw-r--r--. 1 root root 41404 Dec 29 06:23 redis.conf
  379. lrwxrwxrwx. 1 root root 12 Dec 29 06:11 redis-sentinel -> redis-server
  380. -rwxr-xr-x. 1 root root 6450305 Dec 29 06:11 redis-server
  381. [root@hadoop03 bin]# cd ..
  382. [root@hadoop03 redis-taotao]# ll
  383. total 4
  384. drwxr-xr-x. 2 root root 4096 Dec 29 06:23 bin
  385. [root@hadoop03 redis-taotao]# cd ..
  386. [root@hadoop03 taotao]# ll
  387. total 1400
  388. drwxrwxr-x. 6 root root 4096 Apr 1 2015 redis-3.0.0
  389. -rw-r--r--. 1 root root 57856 Dec 29 05:14 redis-3.0.0.gem
  390. -rw-r--r--. 1 root root 1358081 Dec 29 05:14 redis-3.0.0.tar.gz
  391. drwxr-xr-x. 3 root root 4096 Dec 29 06:11 redis-taotao
  392. drwxr-xr-x. 9 root root 4096 Dec 27 17:51 tomcat-manager-8080
  393. [root@hadoop03 taotao]# mkdir redis-cluster
  394. [root@hadoop03 taotao]# ll
  395. total 1404
  396. drwxrwxr-x. 6 root root 4096 Apr 1 2015 redis-3.0.0
  397. -rw-r--r--. 1 root root 57856 Dec 29 05:14 redis-3.0.0.gem
  398. -rw-r--r--. 1 root root 1358081 Dec 29 05:14 redis-3.0.0.tar.gz
  399. drwxr-xr-x. 2 root root 4096 Dec 29 06:39 redis-cluster
  400. drwxr-xr-x. 3 root root 4096 Dec 29 06:11 redis-taotao
  401. drwxr-xr-x. 9 root root 4096 Dec 27 17:51 tomcat-manager-8080
  402. [root@hadoop03 taotao]# cp -r redis-taotao/bin/ redis-cluster/redis01
  403. [root@hadoop03 taotao]# cd redis-cluster/
  404. [root@hadoop03 redis-cluster]# ll
  405. total 4
  406. drwxr-xr-x. 2 root root 4096 Dec 29 06:43 redis01
  407. [root@hadoop03 redis-cluster]# cd redis01/
  408. [root@hadoop03 redis01]# ll
  409. total 15484
  410. -rwxr-xr-x. 1 root root 4588878 Dec 29 06:43 redis-benchmark
  411. -rwxr-xr-x. 1 root root 22185 Dec 29 06:43 redis-check-aof
  412. -rwxr-xr-x. 1 root root 45403 Dec 29 06:43 redis-check-dump
  413. -rwxr-xr-x. 1 root root 4691785 Dec 29 06:43 redis-cli
  414. -rw-r--r--. 1 root root 41404 Dec 29 06:43 redis.conf
  415. lrwxrwxrwx. 1 root root 12 Dec 29 06:43 redis-sentinel -> redis-server
  416. -rwxr-xr-x. 1 root root 6450305 Dec 29 06:43 redis-server
  417. [root@hadoop03 redis01]# vi redis.conf
  418. ..................
  419. ..................
  420. ..................
  421. ..................
  422. 修改两个地方,一个把端口号"port 6379"改为"port 7001"(为了搭建redis集群,
  423. 我们需要创建6redis实例,这6redis实例的端口分别为7001~7006);
  424. 还要修改一个地方,把配置文件中"# cluster-enabled yes"的注释打开,也就是把前面的"#"去掉,表示开启redis的集群模式:(由于这个redis.conf配置文件的内容非常多,在修改某项配置的时候,如果你不熟悉vi的常用命令,就会很麻烦。这里说一下如何在vi命令下查找指定的配置项,首先使用"vi redis.conf"命令进入配置文件内部,此时先不要进入编辑模式,我们以修改"# cluster-enabled yes"为例来进行说明,首先按"/"键可以进入查找模式,输入"cluster"关键字,然后按回车或者按小写的"n"键,可以向下查找该关键字,按大写的"N"键可以向上查找,等找到之后,按键盘左上角的"ESC"键可以退出查找模式,然后再按"i"键进入到文本编辑模式,这样就可以修改文件内容了。修改完,再按"ESC"键退出编辑模式,最后输入":wq"保存退出即可)
  425.  
  426. [root@hadoop03 redis01]# pwd
  427. /root/apps/taotao/redis-cluster/redis01
  428. [root@hadoop03 redis01]# ll
  429. total 15484
  430. -rwxr-xr-x. 1 root root 4588878 Dec 29 06:43 redis-benchmark
  431. -rwxr-xr-x. 1 root root 22185 Dec 29 06:43 redis-check-aof
  432. -rwxr-xr-x. 1 root root 45403 Dec 29 06:43 redis-check-dump
  433. -rwxr-xr-x. 1 root root 4691785 Dec 29 06:43 redis-cli
  434. -rw-r--r--. 1 root root 41402 Dec 29 06:57 redis.conf
  435. lrwxrwxrwx. 1 root root 12 Dec 29 06:43 redis-sentinel -> redis-server
  436. -rwxr-xr-x. 1 root root 6450305 Dec 29 06:43 redis-server
  437. [root@hadoop03 redis01]# cd ..
  438. [root@hadoop03 redis-cluster]# ll
  439. total 4
  440. drwxr-xr-x. 2 root root 4096 Dec 29 07:06 redis01
  441.  
  442. redis01这个实例拷贝5份,这样就有了6redis实例了:
  443. [root@hadoop03 redis-cluster]# cp -r redis01/ redis02
  444. [root@hadoop03 redis-cluster]# cp -r redis01/ redis03
  445. [root@hadoop03 redis-cluster]# cp -r redis01/ redis04
  446. [root@hadoop03 redis-cluster]# cp -r redis01/ redis05
  447. [root@hadoop03 redis-cluster]# cp -r redis01/ redis06
  448. [root@hadoop03 redis-cluster]# ll
  449. total 24
  450. drwxr-xr-x. 2 root root 4096 Dec 29 07:06 redis01
  451. drwxr-xr-x. 2 root root 4096 Dec 29 07:07 redis02
  452. drwxr-xr-x. 2 root root 4096 Dec 29 07:07 redis03
  453. drwxr-xr-x. 2 root root 4096 Dec 29 07:07 redis04
  454. drwxr-xr-x. 2 root root 4096 Dec 29 07:07 redis05
  455. drwxr-xr-x. 2 root root 4096 Dec 29 07:07 redis06
  456. [root@hadoop03 redis-cluster]#
  457.  
  458. 下面使用vi命令将redis02/reids.conf文件的端口号为7002,将redis03/reids.conf文件的端口号为7003,将redis04/reids.conf文件的端口号为7004,将redis05/reids.conf文件的端口号为7005,将redis06/reids.conf文件的端口号为7006
  459.  
  460. [root@hadoop03 redis-cluster]# cp /root/apps/taotao/redis-3.0.0/src/redis-trib.rb .
  461. [root@hadoop03 redis-cluster]# ll
  462. total 72
  463. drwxr-xr-x. 2 root root 4096 Dec 29 07:06 redis01
  464. drwxr-xr-x. 2 root root 4096 Dec 29 07:10 redis02
  465. drwxr-xr-x. 2 root root 4096 Dec 29 07:11 redis03
  466. drwxr-xr-x. 2 root root 4096 Dec 29 07:11 redis04
  467. drwxr-xr-x. 2 root root 4096 Dec 29 07:11 redis05
  468. drwxr-xr-x. 2 root root 4096 Dec 29 07:12 redis06
  469. -rwxr-xr-x. 1 root root 48141 Dec 29 07:17 redis-trib.rb
  470. [root@hadoop03 redis-cluster]# vim start-all.sh
  471. cd redis01
  472. ./redis-server redis.conf
  473. cd ../redis02
  474. ./redis-server redis.conf
  475. cd ../redis03
  476. ./redis-server redis.conf
  477. cd ../redis04
  478. ./redis-server redis.conf
  479. cd ../redis05
  480. ./redis-server redis.conf
  481. cd ../redis06
  482. ./redis-server redis.conf
  483.  
  484. ~
  485. ~
  486. ~
  487. "start-all.sh" [New] 13L, 223C written
  488. [root@hadoop03 redis-cluster]# ll
  489. total 76
  490. drwxr-xr-x. 2 root root 4096 Dec 29 07:06 redis01
  491. drwxr-xr-x. 2 root root 4096 Dec 29 07:10 redis02
  492. drwxr-xr-x. 2 root root 4096 Dec 29 07:11 redis03
  493. drwxr-xr-x. 2 root root 4096 Dec 29 07:11 redis04
  494. drwxr-xr-x. 2 root root 4096 Dec 29 07:11 redis05
  495. drwxr-xr-x. 2 root root 4096 Dec 29 07:12 redis06
  496. -rwxr-xr-x. 1 root root 48141 Dec 29 07:17 redis-trib.rb
  497. -rw-r--r--. 1 root root 223 Dec 29 07:22 start-all.sh
  498. [root@hadoop03 redis-cluster]# chmod +x start-all.sh
  499. [root@hadoop03 redis-cluster]# ll
  500. total 76
  501. drwxr-xr-x. 2 root root 4096 Dec 29 07:06 redis01
  502. drwxr-xr-x. 2 root root 4096 Dec 29 07:10 redis02
  503. drwxr-xr-x. 2 root root 4096 Dec 29 07:11 redis03
  504. drwxr-xr-x. 2 root root 4096 Dec 29 07:11 redis04
  505. drwxr-xr-x. 2 root root 4096 Dec 29 07:11 redis05
  506. drwxr-xr-x. 2 root root 4096 Dec 29 07:12 redis06
  507. -rwxr-xr-x. 1 root root 48141 Dec 29 07:17 redis-trib.rb
  508. -rwxr-xr-x. 1 root root 223 Dec 29 07:22 start-all.sh
  509. [root@hadoop03 redis-cluster]# ./start-all.sh
  510. [root@hadoop03 redis-cluster]# ps aux|grep redis
  511. root 7425 0.0 0.3 137440 7192 ? Ssl 07:30 0:00 ./redis-server *:7001 [cluster]
  512. root 7429 0.0 0.3 137440 7192 ? Ssl 07:30 0:00 ./redis-server *:7002 [cluster]
  513. root 7433 0.0 0.3 137440 7192 ? Ssl 07:30 0:00 ./redis-server *:7003 [cluster]
  514. root 7437 0.0 0.3 137440 7192 ? Ssl 07:30 0:00 ./redis-server *:7004 [cluster]
  515. root 7441 0.0 0.3 137440 7192 ? Ssl 07:30 0:00 ./redis-server *:7005 [cluster]
  516. root 7445 0.0 0.3 137440 7192 ? Ssl 07:30 0:00 ./redis-server *:7006 [cluster]
  517. root 7449 0.0 0.0 103308 852 pts/1 S+ 07:30 0:00 grep redis
  518. [root@hadoop03 redis-cluster]# ll
  519. total 76
  520. drwxr-xr-x. 2 root root 4096 Dec 29 07:23 redis01
  521. drwxr-xr-x. 2 root root 4096 Dec 29 07:28 redis02
  522. drwxr-xr-x. 2 root root 4096 Dec 29 07:28 redis03
  523. drwxr-xr-x. 2 root root 4096 Dec 29 07:28 redis04
  524. drwxr-xr-x. 2 root root 4096 Dec 29 07:27 redis05
  525. drwxr-xr-x. 2 root root 4096 Dec 29 07:27 redis06
  526. -rwxr-xr-x. 1 root root 48141 Dec 29 07:17 redis-trib.rb
  527. -rwxr-xr-x. 1 root root 238 Dec 29 07:29 start-all.sh
  528. [root@hadoop03 redis-cluster]# ./redis-trib.rb create --replicas 1 hadoop03:7001 hadoop03:7002 hadoop03:7003 hadoop03:7004 hadoop03:7005 hadoop03:7006
  529. >>> Creating cluster
  530. Connecting to node hadoop03:7001: OK
  531. Connecting to node hadoop03:7002: OK
  532. Connecting to node hadoop03:7003: OK
  533. Connecting to node hadoop03:7004: OK
  534. Connecting to node hadoop03:7005: OK
  535. Connecting to node hadoop03:7006: OK
  536. >>> Performing hash slots allocation on 6 nodes...
  537. Using 3 masters:
  538. hadoop03:7001
  539. hadoop03:7002
  540. hadoop03:7003
  541. Adding replica hadoop03:7004 to hadoop03:7001
  542. Adding replica hadoop03:7005 to hadoop03:7002
  543. Adding replica hadoop03:7006 to hadoop03:7003
  544. M: 0fd6c1222175177b52ce67faae99667d7be2105b hadoop03:7001
  545. slots:0-5460 (5461 slots) master
  546. M: 4cc89e4d921d0e6fc3860b2dbf718faa22b6b647 hadoop03:7002
  547. slots:5461-10922 (5462 slots) master
  548. M: 868309d4d7277f125cc351aa13e95dd94838d77b hadoop03:7003
  549. slots:10923-16383 (5461 slots) master
  550. S: c2c00c4198be8113d2d6a5b43d240114224afedb hadoop03:7004
  551. replicates 0fd6c1222175177b52ce67faae99667d7be2105b
  552. S: 51fcf8b26a49dbeaf0cf1e784d38ca4b62112dce hadoop03:7005
  553. replicates 4cc89e4d921d0e6fc3860b2dbf718faa22b6b647
  554. S: f65c49c522f236e31cd672f5d6f65aa3de38bcd9 hadoop03:7006
  555. replicates 868309d4d7277f125cc351aa13e95dd94838d77b
  556. Can I set the above configuration? (type 'yes' to accept): yes
  557. >>> Nodes configuration updated
  558. >>> Assign a different config epoch to each node
  559. >>> Sending CLUSTER MEET messages to join the cluster
  560. /usr/lib/ruby/gems/1.8/gems/redis-3.0.0/lib/redis/client.rb:79:in `call': ERR Invalid node address specified: hadoop03:7001 (Redis::CommandError)
  561. from /usr/lib/ruby/gems/1.8/gems/redis-3.0.0/lib/redis.rb:2190:in `method_missing'
  562. from /usr/lib/ruby/gems/1.8/gems/redis-3.0.0/lib/redis.rb:36:in `synchronize'
  563. from /usr/lib/ruby/1.8/monitor.rb:242:in `mon_synchronize'
  564. from /usr/lib/ruby/gems/1.8/gems/redis-3.0.0/lib/redis.rb:36:in `synchronize'
  565. from /usr/lib/ruby/gems/1.8/gems/redis-3.0.0/lib/redis.rb:2189:in `method_missing'
  566. from ./redis-trib.rb:692:in `join_cluster'
  567. from ./redis-trib.rb:690:in `each'
  568. from ./redis-trib.rb:690:in `join_cluster'
  569. from ./redis-trib.rb:1002:in `create_cluster_cmd'
  570. from ./redis-trib.rb:1373:in `send'
  571. from ./redis-trib.rb:1373
  572. [root@hadoop03 redis-cluster]# vim start-all.sh
  573. cd redis01
  574. ./redis-server redis.conf
  575. cd ../
  576. cd redis02
  577. ./redis-server redis.conf
  578. cd ../
  579. cd redis03
  580. ./redis-server redis.conf
  581. cd ../
  582. cd redis04
  583. ./redis-server redis.conf
  584. cd ../
  585. cd redis05
  586. ./redis-server redis.conf
  587. cd ../
  588. cd redis06
  589. ./redis-server redis.conf
  590.  
  591. ~
  592. ~
  593. ~
  594. "start-all.sh" 18L, 258C written
  595. [root@hadoop03 redis-cluster]# vim shutdown-all.sh
  596. redis01/redis-cli -p 7001 shutdown
  597. redis01/redis-cli -p 7002 shutdown
  598. redis01/redis-cli -p 7003 shutdown
  599. redis01/redis-cli -p 7004 shutdown
  600. redis01/redis-cli -p 7005 shutdown
  601. redis01/redis-cli -p 7006 shutdown
  602. ~
  603. ~
  604. ~
  605. ~
  606. "shutdown-all.sh" 6L, 210C written
  607. [root@hadoop03 redis-cluster]# ll
  608. total 80
  609. drwxr-xr-x. 2 root root 4096 Dec 29 08:40 redis01
  610. drwxr-xr-x. 2 root root 4096 Dec 29 08:40 redis02
  611. drwxr-xr-x. 2 root root 4096 Dec 29 08:40 redis03
  612. drwxr-xr-x. 2 root root 4096 Dec 29 08:40 redis04
  613. drwxr-xr-x. 2 root root 4096 Dec 29 08:40 redis05
  614. drwxr-xr-x. 2 root root 4096 Dec 29 08:40 redis06
  615. -rwxr-xr-x. 1 root root 48141 Dec 29 07:17 redis-trib.rb
  616. -rwxr-xr-x. 1 root root 210 Dec 29 09:01 shutdown-all.sh
  617. -rwxr-xr-x. 1 root root 258 Dec 29 09:00 start-all.sh
  618. [root@hadoop03 redis-cluster]# ./start-all.sh
  619. [root@hadoop03 redis-cluster]# ps aux|grep redis
  620. root 7717 0.1 0.3 137440 7204 ? Ssl 09:01 0:00 ./redis-server *:7001 [cluster]
  621. root 7721 0.0 0.3 137440 7204 ? Ssl 09:01 0:00 ./redis-server *:7002 [cluster]
  622. root 7725 0.1 0.3 137440 7204 ? Ssl 09:01 0:00 ./redis-server *:7003 [cluster]
  623. root 7729 0.1 0.3 137440 7204 ? Ssl 09:01 0:00 ./redis-server *:7004 [cluster]
  624. root 7733 1.0 0.3 137440 7204 ? Ssl 09:01 0:00 ./redis-server *:7005 [cluster]
  625. root 7737 1.1 0.3 137440 7204 ? Ssl 09:01 0:00 ./redis-server *:7006 [cluster]
  626. root 7741 0.0 0.0 103308 852 pts/1 S+ 09:02 0:00 grep redis
  627. [root@hadoop03 redis-cluster]# redis01/redis-cli -h hadoop03 -p 7001
  628. hadoop03:7001> keys *
  629. (empty list or set)
  630. hadoop03:7001> set a "hello"
  631. (error) CLUSTERDOWN The cluster is down
  632. hadoop03:7001>
  633.  
  634. 这里在使用set命令的时候,发现报了一个错误,说集群宕机了。
  635. 但是有人说在使用"./redis-trib.rb"脚本创建集群的时候不能使用hostname,只能使用ip地址。
  636. 而我们上面再创建redis集群的时候使用了hostname,并且还报了如下错误(一开始没仔细看,意味redis集群创建成功了,晕死!):
  637. "ERR Invalid node address specified: hadoop03:7001"
  638. 所以这里只能把6个redis实例都删除,重新创建。
  639. 然后在使用"./redis-trib.rb"脚本创建redis集群的时候,使用ip地址,而不再使用hostname了。
  640. ===================================================================================
  641.  
  642. [root@hadoop03 redis-cluster]# rm -rf redis0*
  643. [root@hadoop03 redis-cluster]# ll
  644. total 56
  645. -rwxr-xr-x. 1 root root 48141 Dec 29 07:17 redis-trib.rb
  646. -rwxr-xr-x. 1 root root 210 Dec 29 09:01 shutdown-all.sh
  647. -rwxr-xr-x. 1 root root 258 Dec 29 09:20 start-all.sh
  648.  
  649. 然后重新创建6个redis实例,并记得修改各自的redis.conf配置文件,创建的过程这里就不赘述了。
  650. 创建好6个redis实例之后,启动6个redis服务器。然后使用如下命令创建redis机器:
  651.  
  652. 注意,在创建redis集群的时候,一定要先将6个redis实例都启动起来,否则会报如下错误:
  653. "[ERR] Sorry, can't connect to node localhost:7001"
  654. 所以我们先使用自己编写的一个批量启动6个redis实例的脚本"start-all.sh"来启动:
  655. [root@hadoop03 redis-cluster]# ./start-all.sh
  656.  
  657. 下面开始使用redis-trib.rb脚本来创建redis集群,注意这里我们不要使用hostname,而要使用ip地址,否则创建不成功:
  658. [root@hadoop03 redis-cluster]# ./redis-trib.rb create --replicas 1 192.168.71.13:7001 192.168.71.13:7002 192.168.71.13:7003 192.168.71.13:7004 192.168.71.13:7005 192.168.71.13:7006
  659. >>> Creating cluster
  660. Connecting to node 192.168.71.13:7001: OK
  661. Connecting to node 192.168.71.13:7002: OK
  662. Connecting to node 192.168.71.13:7003: OK
  663. Connecting to node 192.168.71.13:7004: OK
  664. Connecting to node 192.168.71.13:7005: OK
  665. Connecting to node 192.168.71.13:7006: OK
  666. >>> Performing hash slots allocation on 6 nodes...
  667. Using 3 masters:
  668. 192.168.71.13:7001
  669. 192.168.71.13:7002
  670. 192.168.71.13:7003
  671. Adding replica 192.168.71.13:7004 to 192.168.71.13:7001
  672. Adding replica 192.168.71.13:7005 to 192.168.71.13:7002
  673. Adding replica 192.168.71.13:7006 to 192.168.71.13:7003
  674. M: da485e47257b52eb457272bbab16795c1bdcbc3d 192.168.71.13:7001
  675. slots:0-5460 (5461 slots) master
  676. M: 33ae8f68dcf84547f8476a18b043b3e84f6a0321 192.168.71.13:7002
  677. slots:5461-10922 (5462 slots) master
  678. M: 6ee499d8a897c632d006acc39d54e6ed6f48835b 192.168.71.13:7003
  679. slots:10923-16383 (5461 slots) master
  680. S: 671ffee6f16eec82a1dfa1dc0a5b54cc559ed55b 192.168.71.13:7004
  681. replicates da485e47257b52eb457272bbab16795c1bdcbc3d
  682. S: 399ee55a7a1feaa9d5b1219eac61800a4fbc4870 192.168.71.13:7005
  683. replicates 33ae8f68dcf84547f8476a18b043b3e84f6a0321
  684. S: ca70f5e727e90bd9cf248d6eef3aabfcaf255bab 192.168.71.13:7006
  685. replicates 6ee499d8a897c632d006acc39d54e6ed6f48835b
  686. Can I set the above configuration? (type 'yes' to accept): yes
  687. >>> Nodes configuration updated
  688. >>> Assign a different config epoch to each node
  689. >>> Sending CLUSTER MEET messages to join the cluster
  690. Waiting for the cluster to join....
  691. >>> Performing Cluster Check (using node 192.168.71.13:7001)
  692. M: da485e47257b52eb457272bbab16795c1bdcbc3d 192.168.71.13:7001
  693. slots:0-5460 (5461 slots) master
  694. M: 33ae8f68dcf84547f8476a18b043b3e84f6a0321 192.168.71.13:7002
  695. slots:5461-10922 (5462 slots) master
  696. M: 6ee499d8a897c632d006acc39d54e6ed6f48835b 192.168.71.13:7003
  697. slots:10923-16383 (5461 slots) master
  698. M: 671ffee6f16eec82a1dfa1dc0a5b54cc559ed55b 192.168.71.13:7004
  699. slots: (0 slots) master
  700. replicates da485e47257b52eb457272bbab16795c1bdcbc3d
  701. M: 399ee55a7a1feaa9d5b1219eac61800a4fbc4870 192.168.71.13:7005
  702. slots: (0 slots) master
  703. replicates 33ae8f68dcf84547f8476a18b043b3e84f6a0321
  704. M: ca70f5e727e90bd9cf248d6eef3aabfcaf255bab 192.168.71.13:7006
  705. slots: (0 slots) master
  706. replicates 6ee499d8a897c632d006acc39d54e6ed6f48835b
  707. [OK] All nodes agree about slots configuration.
  708. >>> Check for open slots...
  709. >>> Check slots coverage...
  710. [OK] All 16384 slots covered.
  711. [root@hadoop03 redis-cluster]#
  712.  
  713. 到这里,看到"[OK] All 16384 slots covered."的日志,说明我们的redis集群终于创建成功了。
  714. 下面我们开始连接redis集群,这里只要使用任意一个redis客户端连接到redis集群中的任意一个redis节点都可以。
  715. 注意这里连接的时候一定要指定"-c"这个参数,它表示集群。
  716. 我们这里就使用redis01下面的redis-cli通过连接7002端口的redis节点进入redis集群:
  717. [root@hadoop03 redis-cluster]# redis01/redis-cli -h 192.168.71.13 -p 7002
  718. 192.168.71.13:7002> keys *
  719. (empty list or set)
  720. 192.168.71.13:7002> set a 10
  721. (error) MOVED 15495 192.168.71.13:7003
  722. 192.168.71.13:7002>
  723. [root@hadoop03 redis-cluster]# redis01/redis-cli -h 192.168.71.13 -p 7002 -c
  724. 192.168.71.13:7002> keys *
  725. (empty list or set)
  726. 192.168.71.13:7002> set a 10
  727. -> Redirected to slot [15495] located at 192.168.71.13:7003
  728. OK
  729. 192.168.71.13:7003> get a
  730. ""
  731. 192.168.71.13:7003>

linux环境(CentOS-6.7)下redis集群的搭建全过程的更多相关文章

  1. Centos下Redis集群的搭建实现读写分离

    Centos下Redis一主多从架构搭建 搭建目标:因为自己笔记本电脑配置较低的原因,模拟两台机器之间搭建一主一从的架构,主节点Redis主要用来写数据,数据写入到主节点的Redis,然后从节点就可以 ...

  2. Linux下Redis集群环境的搭建

    一.安装redis(使用redis3.0版本) 1.需要gcc环境,如果没有执行命令安装gcc yum install gcc-c++ 2.下载redis3.0的源码包并上传至服务器 3.解压源码包 ...

  3. 【redis】 linux 下redis 集群环境搭建

    Redis集群 (要让集群正常工作至少需要3个主节点,在这里我们要创建6个redis节点,其中三个为主节点,三个为从节点,对应的redis节点的ip和端口对应关系如下) 127.0.0.1:63791 ...

  4. CentOS下redis集群安装

    环境: 一台CentOS虚拟机上部署六个节点,创建3个master,3个slave节点 1.下载并解压 cd /root wget http://download.redis.io/releases/ ...

  5. 最新Windows下Redis集群

    实现简单的Windows下Redis集群配置,以下是配置过程中出现的几个问题: [1]逐个启动7001 7002 7003 7004 7005 7006节点时,出现createing server T ...

  6. Centos7环境下etcd集群的搭建

    Centos7环境下etcd集群的搭建 一.简介 "A highly-available key value store for shared configuration and servi ...

  7. redis集群的搭建详细教程

    1 Redis-cluster架构图             redis-cluster投票:容错  (至少要三个才可以,才能超过半数) 架构细节: (1)所有的redis节点彼此互联(PING-PO ...

  8. <正则吃饺子> :关于redis集群的搭建、集群测试、搭建中遇到的问题总结

    项目中使用了redis ,对于其基本的使用,相对简单些,根据项目中已经提供的工具就可以实现基本的功能,但是只是这样的话,对于redis还是太肤浅,甚至刚开始时候,集群.多节点.主从是什么,他们之间是什 ...

  9. redis集群redis-cluster搭建

    redis集群搭建--参考微信公众号(诗情画意程序员):https://mp.weixin.qq.com/s/s5eJE801TInHgb8bzCapJQ 这是来自redis官网的一段介绍,大概意思就 ...

随机推荐

  1. 周赛-kiki's game 分类: 比赛 2015-08-02 09:24 7人阅读 评论(0) 收藏

    kiki's game Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 40000/10000 K (Java/Others) Total S ...

  2. setprecision(int n)等格式函数用法 分类: POJ 2015-06-11 10:56 17人阅读 评论(0) 收藏

    **这些用法前最好用 #include <iostream>    //不要用iostream.h ,会出现好多问题 #include <iomanip> // io 流控制头 ...

  3. 验证码识别--type2

    验证码识别--type2 终于来到了彩色图像,一定有一些特点 这里的干扰项是色彩不是很鲜艳的.灰色的线条,还有单独的干扰点,根据这些特性进行去除 直接ostu的话,有的效果好,有的效果不好   本来是 ...

  4. DP游戏开发随记9-日常,推箱子

    模型只有一个推的动作文件 日常,更新了一下推箱子的测试用例 4个dummy点,点乘判断是在那个面,然后射线检测墙壁.

  5. vsftp 用无法登陆的用户名登陆(也叫虚拟用户)并进入到自己的文件夹test

    1.不需要使用到PAM认证也可以,useradd redhat; usermod -s /sbin/nologin redhat; passwd redhat. 2.userlist_deny=NO; ...

  6. 用C#钩子写一个改键外挂

    我的微信群——软件开发测试工程师交流群,欢迎扫码: 改键是一种习惯,比如在玩儿lol或者dota的时候.理论上玩儿什么游戏都可以改键. 做一个窗体(点击Install——应用改键,点击Uninstal ...

  7. Struts2的标签库(二)——OGNL表达式

    Struts2的标签库(二) --OGNL表达式 1.Struts2中的OGNL表达式增加了ValueStack的支持. 注:ValueStack--实际上是一个容器对象,该对象在启动Struts2框 ...

  8. 【leetcode❤python】 290. Word Pattern

    #-*- coding: UTF-8 -*-class Solution(object):    def wordPattern(self, pattern, str):        "& ...

  9. BZOJ 1513 [POI2006]Tet-Tetris 3D

    题目链接:http://www.lydsy.com:808/JudgeOnline/problem.php?id=1513 题意:三维空间,有一些立方体在垂直下落.立方体的左下角坐标(x,y)以及长宽 ...

  10. Cheatsheet: 2013 10.24 ~ 10.31

    Web Performance Comparison Between Node.js and Java EE Other Hidden Productivity Secrets With Alfred ...