Nodejs Leverage Redis PubSub For File Download — Part 1
Redis Server Setup
For this project, a dedicated server is set for the mongoDB and Redis which running on virtual machine to avoid any incident occurred on the development VM.
To install a Redis server on ubuntu, I have follow the steps on this article “How To Install and Secure Redis on Ubuntu 18.04”
As mention above, the redis server should bind with public network interface. and this configuration will introduce a series of changes on the development and related configuration.
Set the redis bind with public IP loop.
>sudo nano /etc/redis/redis.conf
following screen would be shown as below. Just comment out the default setting to #bind 127.0.0.1::1 and add one more line as
bind 0.0.0.0
After you save the configuration file, it would required to restart the service and check the running status.
>sudo systemctl restart redis.service
> sudo systemctl status redis
On the redis server, test the service by running
> redis-cli ping
PONG
On the development server, test the service by running comment with the HOST information
> redis-cli -h 192.168.100.151
Once you got feedback “PONG”, the redis server setup is completed.