Advertisement
Guest User

Untitled

a guest
Apr 18th, 2015
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. * create a new redis .conf file
  2.  
  3. ```Bash
  4. $ cp /etc/redis.conf /etc/redis-xxx.conf
  5. ```
  6.  
  7. * edit /etc/redis-xxx.conf, illustrated as below
  8.  
  9. ```Bash
  10. ...
  11. #modify pidfile
  12. #pidfile /var/run/redis/redis.pid
  13. pidfile /var/run/redis/redis-xxx.pid
  14.  
  15. ...
  16. #dir /var/lib/redis/
  17. dir /var/lib/redis-xxx/
  18.  
  19. ...
  20. #modify port
  21. #port 6379
  22. port 6380
  23.  
  24. ...
  25. #modify logfile
  26. #logfile /var/log/redis/redis.log
  27. logfile /var/log/redis/redis-xxx.log
  28.  
  29. ...
  30. #modify vm-swap-file
  31. #vm-swap-file /tmp/redis.swap
  32. vm-swap-file /tmp/redis-xxx.swap
  33. ...
  34. ```
  35. * make dir /var/lib/redis-xxx
  36.  
  37. ```Bash
  38. $ mkdir -p /var/lib/redis-xxx
  39. ```
  40.  
  41. * copy init script
  42.  
  43. ```Bash
  44. $ cp /etc/init.d/redis /etc/init.d/redis-xxx
  45. ```
  46.  
  47. * edit the new init script
  48.  
  49. ```Bash
  50. ...
  51.  
  52. #pidfile="/var/run/redis/redis.pid"
  53. pidfile="/var/run/redis/redis-xxx.pid"
  54.  
  55. ...
  56.  
  57. #REDIS_CONFIG="/etc/redis.conf"
  58. REDIS_CONFIG="/etc/redis-xxx.conf"
  59.  
  60. ...
  61. ```
  62.  
  63. * query the status of this redis in
  64.  
  65. ```Bash
  66. $ sudo service redis-xxx status
  67. # server is stopped
  68.  
  69. # start service
  70. $ sudo service redis-xxx start
  71. ```
  72.  
  73. * make redis-xxx service auto start
  74.  
  75. ```Bash
  76. $ sudo chkconfig --level 3 redis-xxx on
  77. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement