Ubuntu 16.04
Redis 4.0.6
安装 redis:
1 | apt-get install redis-server |
安装成功后,默认端口为 6379
.
接下来完成一个端口为 6380
的服务端:
修改 redis 配置文件:
1 | cd /etc/redis |
作如下修改:
1 | port 6380 |
修改 redis 启动文件:
1 | cd /etc/init.d/ |
作如下修改:
1 | DAEMON_ARGS=/etc/redis/redis-6380.conf |
添加 service:
1 | cp /lib/systemd/system/redis-server.service /lib/systemd/system/redis-server-6380.service |
作如下修改:
1 | ExecStart=/usr/bin/redis-server /etc/redis/redis-6380.conf |
1 | cd /etc/systemd/system |
启动 redis-server-6380:
1 | service redis-server-6380 start |
1 | redis 5885 1 0 Jul20 ? 00:00:40 /usr/bin/redis-server 127.0.0.1:6379 |