Prince Joal
Software Engineer
  • Name: Prince

  • Birthday: 28 February 1993

  • Job: Freelancer

  • Email: [email protected]

  • Skype: 1081a1d198d8081c

How to install multiple Redis on single server

Redis is an advanced key-value store that is open source. Because keys may contain strings, hashes, lists, sets, and sorted sets, it is sometimes referred to as a data structure server.This artical is about how to install multiple redis on a single server

Redis is a single-threaded event loop that is highly efficient. It’s really fast up to a point, but it can’t scale beyond two CPU cores (one for main requests, one for file compaction).It works pretty well and is quite simple to use if you need something light-weight with that profile. It also includes a lot of functionality, like as excellent circle distance searches, and you can develop Lua scripts that execute on Redis (in separate processes, communicating with the main request loop for data though).

Create the directory for the new instance

$ sudo install -o redis -g redis -d /var/lib/redis2

Create a new configuration file

$ sudo cp -p /etc/redis/redis.conf /etc/redis/redis2.conf

Edit the new configuration file

$ sudo nano /etc/redis/redis2.conf
pidfile /var/run/redis/redis-server2.pid
logfile /var/log/redis/redis-server2.log
dir /var/lib/redis2
port 6380

Create new service file

$ sudo cp /lib/systemd/system/redis-server.service /lib/systemd/system/redis-server2.service

Edit the new service file

$ sudo vim /lib/systemd/system/redis-server2.service
ExecStart=/usr/bin/redis-server /etc/redis/redis2.conf
PIDFile=/var/run/redis/redis-server2.pid
ReadWriteDirectories=-/var/lib/redis2
Alias=redis2.service

Enable and start the service

$ sudo systemctl enable redis-server2.service
$ sudo systemctl start redis-server2.service

Check status

$ ps aux |grep redis

0 0 votes
Article Rating
Subscribe
Notify of
guest

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Tarun

Very nice

1
0
Would love your thoughts, please comment.x
()
x