While I talked about redis-stat, I told it is not a management tool (for now). Now, I want to talk about a management tool like OpServer, but more Redis specific one. As you know, OpServer has not a direct configuration management panel for Redis (for now) (btw you can change master slave configs in it). Here with Redis Commander, you have not much visual demonstration but you can instantly send commands to each redis servers. So if we say redis-stat is your eyes, then Redis Commander is most likely your willpower.
Redis Commander is written in nodejs. Because of this I prefer to install it to a Linux machine. Even though you can install it to Windows but I don’t think it is a good habitat for a nodejs application. And also, I have a Linux machine already, that means I can use it for this purpose. Choice is up to you of course.
OK, lets start to install our Redis Commander tool to our Linux Debian machine. In previous article I wrote for redis-stat, I used Vagrant and a Debian VM together. I will go on the same way in this article also. You can read there how did I installed Debian VM on Vagrant.
We can simply skip some steps and get into installation step right now. I am assuming that you installed nodejs and npm to your machine like in this documentation.
For installation don’t forget to switch user to root with sudo. Otherwise you may download packages to user specific folders.
npm install -g redis-commander
Installation is that simple.
For installing it as a service, luckily we have a written service script, which you can find it here. And it is explained step by step, pretty nice.
You can simply follow these steps:
#We take service script to local
curl -G https://raw.githubusercontent.com/joeferner/redis-commander/02d4c48809a0670ebd19ebda65c9dd125d562523/dist/debian/init.d/redis-commander -o redis-commander-service
cp redis-commander-service /etc/init.d/redis-commander
#and we apply steps that written in github commit:
useradd --system -m -s /bin/false nodejs
useradd --system -d /home/nodejs -G nodejs -s /bin/false redis-commander
chmod g+w /home/nodejs/
cp dist/debian/init.d/redis-commander /etc/init.d/
chmod +x /etc/init.d/redis-commander
update-rc.d redis-commander defaults
Now, before we start our redis-commander service, we need to check if we configured it right. Just for being make sure, type
to find installed file path of our redis commander. Then we can take that file path and modify our service script:
DAEMON="/usr/bin/redis-commander" #installed path of redis-commander given by which command
DAEMONOPTS="--port 6500 --http-u RedisUser --http-p passwordhere"
Now, we are good to go, just start the service and relax. First sceen you will see, there is no redis instance bound. Simply, click to more and Add Server to add your redis instances. After you did it, you need to restart service.