[Redis] Add 1 more port for Redis

  • Create a new redis .conf file
cp /etc/redis.conf /etc/redis_6479.conf
  • Edit /etc/redis_6479.conf
#modify pidfile
#pidfile /var/run/redis/redis.pid
pidfile /var/run/redis/redis_6479.pid

...
#modify port
#port 6379
port 6479

...
#modify logfile
#logfile /var/log/redis/redis.log
logfile /var/log/redis/redis_6479.log
  • Copy init script
cp /etc/init.d/redis /etc/init.d/redis_6479
  • and edit init script
...
pidfile="/var/run/redis/redis_6479.pid"
REDIS_CONFIG="/etc/redis_6479.conf"
  • Start 1 more redis with port 6479
sudo /etc/init.d/redis_6479 start

# or check status, restart
sudo /etc/init.d/redis_6479 status
sudo /etc/init.d/redis_6479 restart
  • Check port is running of redis:
ps aux |grep redis

grep-redis-port