Linux redis集群搭建

本文详细介绍了如何在Linux环境下搭建Redis 5.0集群,包括使用redis-cli创建集群、配置redis.conf文件,以及注意事项,如设置密码、分配槽位等。
摘要由CSDN通过智能技术生成

目录

前言

对前言1、2举例说明

一、redis搭建及redis.conf配置

二、搭建集群



前言

        1. 先确定redis版本,5.0版本以前,Linux需要安装ruby命令,

                通过运行redis-trib.rb搭建集群;

        2. 5.0版本以后,redis可以通过运行redis-cli,搭建集群;

        3.通过redis-trib.rb搭建集群需要6个节点;

        4.通过redis-cli搭建集群最少3个(没验证),本文也是6个节点;

本文redis版本为:redis-5.0.12.tar.gz提取码pqd1

对前言1、2举例说明:登录linux服务器

[redis@redis src]$ ./redis-trib.rb create --replicas 1 10.36.0.50:6379 10.36.0.50:6380 10.36.0.50:6381 10.36.0.50:6382 10.36.0.50:6383 10.36.0.50:6384
WARNING: redis-trib.rb is not longer available!
You should use redis-cli instead.

All commands and features belonging to redis-trib.rb have been moved
to redis-cli.
In order to use them you should call redis-cli with the --cluster
option followed by the subcommand name, arguments and options.

Use the following syntax:
redis-cli --cluster SUBCOMMAND [ARGUMENTS] [OPTIONS]

Example:
redis-cli --cluster create 10.36.0.50:6379 10.36.0.50:6380 10.36.0.50:6381 10.36.0.50:6382 10.36.0.50:6383 10.36.0.50:6384 --cluster-replicas 1

To get help about all subcommands, type:
redis-cli --cluster help

系统会提示你应该用redis-cli

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值