Advertisement
Justman10000

Manage Redis

Feb 24th, 2023 (edited)
952
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.08 KB | None | 0 0
  1. // To install
  2. mkdir /usr/local/redis
  3. cd /usr/local/redis
  4. git init
  5. git pull https://github.com/redis/redis.git
  6. rm -r .* *.md 00-RELEASENOTES BUGS COPYING INSTALL MANIFESTO
  7. make install
  8.  
  9. # Optional
  10. ## If you want/need to secure your Redis instance with a password, do the following:
  11. ### Go with your SFTP Client to /usr/local/redis and download the redis.conf
  12. ### Go to the line 1045 an uncommit
  13. ### Replace "foobared" with your password
  14.  
  15. # Now we setup a service for redis
  16. cat << EOF > /etc/systemd/system/redis.service
  17. [Unit]
  18. Description=Redis
  19. After=network.target
  20. Wants=network-online.target
  21.  
  22. [Service]
  23. Restart=always
  24. Type=simple
  25. ExecStart=redis-server
  26. Environment=
  27.  
  28. [Install]
  29. WantedBy=multi-user.target
  30. EOF
  31.  
  32. # Enable
  33. systemctl enable redis
  34. # And start Redis with
  35. systemctl start redis
  36.  
  37. # To check, if Redis really running
  38. systemctl status redis
  39.  
  40. // To uninstall
  41. rm -r /usr/local/redis
  42. rm -r /usr/bin/redis-benchmark
  43. rm -r /usr/bin/redis-check-aof
  44. rm -r /usr/bin/redis-check-rdb
  45. rm -r /usr/bin/redis-cli
  46. rm -r /usr/bin/redis-sentinel
  47. rm -r /usr/bin/redis-server
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement