redis的配置

栏目: 数据库 · 发布时间: 6年前

内容简介:redis cluster配置与使用(5.0版本)集群需要至少3个主3个从,不然创建不了集群这里使用6台redis

redis cluster配置与使用(5.0版本)

集群需要至少3个主3个从,不然创建不了集群

这里使用6台redis

集群创建之前需要先启动 redis 服务器,使用redis.conf。

redis.conf的最少配置:

cluster-enabled yes
port 7000
appendonly yes

创建目录

mkdir cluster-test

cd cluster-test

mkdir 7000 7001 7002 7003 7004 7005

每个redis.conf不同就是port,这里根据目录名

把redis.conf分别拷贝到7000 ... 7005目录下

运行

把redis的可执行文件拷贝到cluster-test下,像这样分别进入7000 ... 7005目录

cd 7000

../redis-server ./redis.conf

6个redis启动后,创建集群(redis 5.0版本)

./redis-cli --cluster create 127.0.0.1:7000 127.0.0.1:7001 \

127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005 \

--cluster-replicas 1

出现缺人按钮,输入yes,你会看到这个消息,即成功创建

redis的配置

测试使用

redis的配置

在不同的redis上访问数据,如果数据不在,会提示重定向到哪里获取

redis的配置

此时创建成功


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Spring Into HTML and CSS

Spring Into HTML and CSS

Molly E. Holzschlag / Addison-Wesley Professional / 2005-5-2 / USD 34.99

The fastest route to true HTML/CSS mastery! Need to build a web site? Or update one? Or just create some effective new web content? Maybe you just need to update your skills, do the job better. Welco......一起来看看 《Spring Into HTML and CSS》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具