Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. #### Create the directory for the new instance
  2. ````
  3. $ sudo install -o redis -g redis -d /var/lib/redis2
  4. ````
  5.  
  6. #### Create a new configuration file
  7. ````
  8. $ sudo cp -p /etc/redis/redis.conf /etc/redis/redis2.conf
  9. ````
  10.  
  11. #### Edit the new configuration file
  12. ````
  13. $ sudo nano /etc/redis/redis2.conf
  14. ````
  15. ````
  16. pidfile /var/run/redis2/redis-server2.pid
  17. logfile /var/log/redis/redis-server2.log
  18. dir /var/lib/redis2
  19. port 6380
  20. ````
  21.  
  22. #### Create new service file
  23. ````
  24. $ sudo cp /lib/systemd/system/redis-server.service /lib/systemd/system/redis-server2.service
  25. ````
  26.  
  27. #### Edit the new service file
  28. ````
  29. $ sudo nano /lib/systemd/system/redis-server2.service
  30. ````
  31. ````
  32. ExecStart=/usr/bin/redis-server /etc/redis/redis2.conf
  33. PIDFile=/var/run/redis/redis-server2.pid
  34. RuntimeDirectory=redis2
  35. ReadWriteDireRuntimeDirectory=redis2
  36. ReadWriteDirectories=-/var/run/redis2
  37. Alias=redis2.service
  38. ````
  39.  
  40. #### Enable and start the service
  41. ````
  42. $ sudo systemctl enable redis-server2.service
  43. $ sudo systemctl start redis-server2.service
  44. ````
  45.  
  46. #### Check status
  47. ````
  48. $ ps aux |grep redis
  49. ````
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement