继上次费了九牛二虎之力安装了redis之后,今天接着折腾,主要是做了两个内容的设置:
1、开机启用redis服务
2、配置redis集群(主从和集群不能共存)
首先是开机自动启用redis服务
设置开机自动启用redis服务涉及到的配置文件有两个,一个是install_server.sh,位置是在redis解压包的utils目录下,一般都是xxx/xxx/xx/redis-x.x/utils/,当然可以把文件放置在你习惯的位置;另外一个是redis.conf,如果是按默认启动服务的话,只要知道redis.conf文件的位置即可,因为配置的时候需要确认。
[root@redis_cluster utils]# ./install_server.sh
Welcome to the redis service installer
This script will help you easily set up a running redis server
Please select the redis port for this instance: [6379] 6380 #默认端口直接回车或输入端口
Selecting default: 6380
Please select the redis config file name [/etc/redis/6379.conf]
#redis.conf文件的路径,不能输错,不然会配置失败,回车则默认是这个路径。
Selected default - /etc/redis/6379.conf
Please select the redis log file name [/var/log/redis_6379.log] #默认,直接回车
Selected default - /var/log/redis_6379.log
Please select the data directory for this instance [/var/lib/redis/6379] #默认,直接回车
Selected default - /var/lib/redis/6379
Please select the redis executable path [/usr/local/bin/