redis安装和主从配置
2017-09-18 20:39
423 查看
环境条件:
主:192.168.5.35
备:192.168.5.38
1、解压
tar -zxvf redis-2.3.9.tar.gz
2、编译安装
make
make test //检查一下 看有没有问题
make install
安装完之后,会在src目录下生成几个可执行文件,分别是mkreleasehdr.sh redis-benchmark redis-check-aof redis-check-dump redis-cli redis-sentinel redis-server。其中redis-server是启动Redis服务的,redis-cli是进入Redis客户端的。
3、初始化
# cd /usr/local/redis/utils/
[root@xt-redis-2 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]
Selecting default: 6379
Please select the redis config file name [/etc/redis/6379.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/redis-server]
Selected config:
Port : 6379
Config file : /etc/redis/6379.conf
Log file : /var/log/redis_6379.log
Data dir : /var/lib/redis/6379
Executable : /usr/local/bin/redis-server
Cli Executable : /usr/local/bin/redis-cli
Is this ok? Then press ENTER to go on or Ctrl-C to abort.
4、配置
vim /etc/redis/6379.conf
daemonize
yes
bind
0.0.0.0
5、启动
/usr/local/redis/src/redis-server /etc/redis/6379.conf
6、主从配置:
备redis配置:vim /etc/redis/6379.conf
slaveof
192.168.8.35 6379
重启redis生效
6、测试、查询
在master和slave分别执行info命令,查看结果如下:
[root@xt-redis-2 utils]# /usr/local/redis/src/redis-cli
127.0.0.1:6379> info
主上查询显示:
然后在master执行set age 18
在slave执行get age,看是否能得到18,如果能够得到值则说明配置成功
主:
从:
主:192.168.5.35
备:192.168.5.38
1、解压
tar -zxvf redis-2.3.9.tar.gz
2、编译安装
make
make test //检查一下 看有没有问题
make install
安装完之后,会在src目录下生成几个可执行文件,分别是mkreleasehdr.sh redis-benchmark redis-check-aof redis-check-dump redis-cli redis-sentinel redis-server。其中redis-server是启动Redis服务的,redis-cli是进入Redis客户端的。
3、初始化
# cd /usr/local/redis/utils/
[root@xt-redis-2 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]
Selecting default: 6379
Please select the redis config file name [/etc/redis/6379.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/redis-server]
Selected config:
Port : 6379
Config file : /etc/redis/6379.conf
Log file : /var/log/redis_6379.log
Data dir : /var/lib/redis/6379
Executable : /usr/local/bin/redis-server
Cli Executable : /usr/local/bin/redis-cli
Is this ok? Then press ENTER to go on or Ctrl-C to abort.
4、配置
vim /etc/redis/6379.conf
daemonize
yes
bind
0.0.0.0
5、启动
/usr/local/redis/src/redis-server /etc/redis/6379.conf
6、主从配置:
备redis配置:vim /etc/redis/6379.conf
slaveof
192.168.8.35 6379
重启redis生效
6、测试、查询
在master和slave分别执行info命令,查看结果如下:
[root@xt-redis-2 utils]# /usr/local/redis/src/redis-cli
127.0.0.1:6379> info
主上查询显示:
然后在master执行set age 18
在slave执行get age,看是否能得到18,如果能够得到值则说明配置成功
主:
从:
相关文章推荐
- linux下如何安装配置redis及主从配置
- Redis安装及主从配置(转)
- redis安装配置,数据类型测试,连接方式测试和主从配置测试。
- CentOS7下Yum安装Redis并配置主从
- CentOS Linux下 redis 下载、安装、配置、主从集群配置
- redis4.0.1(stable)安装和主从复制配置
- linux下如何安装配置redis及主从配置
- Redis主从及其PHP扩展安装配置
- linux下如何安装配置redis及主从配置
- Redis安装、配置、操作、持久化、主从、phpredis扩展安装使用详解之操作使用
- linux下如何安装配置redis及主从配置
- Centos6.5下Redis安装、主从配置、卸载教程
- Redis安装及主从配置
- Redis安装、配置、操作、持久化、主从、phpredis扩展安装使用详解之安装配置
- ###Redis 配置安装,主从配置安装
- Redis安装及主从配置
- redis安装以及主从的简单配置测试
- NoSQL -- redis 安装 主从 配置详解 常用命令
- redis 3.2.10 安装和主从配置
- redis 主从配置实例、配置文件说明、及备份方式,php redis 扩展安装