惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
V
Visual Studio Blog
P
Privacy International News Feed
月光博客
月光博客
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
Lohrmann on Cybersecurity
N
News and Events Feed by Topic
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Apple Machine Learning Research
Apple Machine Learning Research
阮一峰的网络日志
阮一峰的网络日志
Webroot Blog
Webroot Blog
T
Threatpost
宝玉的分享
宝玉的分享
The Last Watchdog
The Last Watchdog
小众软件
小众软件
L
LINUX DO - 最新话题
C
Cisco Blogs
T
Troy Hunt's Blog
Schneier on Security
Schneier on Security
酷 壳 – CoolShell
酷 壳 – CoolShell
www.infosecurity-magazine.com
www.infosecurity-magazine.com
雷峰网
雷峰网
G
GRAHAM CLULEY
有赞技术团队
有赞技术团队
Know Your Adversary
Know Your Adversary
博客园 - 叶小钗
罗磊的独立博客
V
V2EX
博客园 - Franky
P
Proofpoint News Feed
SecWiki News
SecWiki News
腾讯CDC
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Jina AI
Jina AI
博客园 - 三生石上(FineUI控件)
S
Secure Thoughts
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Google DeepMind News
Google DeepMind News
Attack and Defense Labs
Attack and Defense Labs
人人都是产品经理
人人都是产品经理
The Cloudflare Blog
PCI Perspectives
PCI Perspectives
V2EX - 技术
V2EX - 技术
Google DeepMind News
Google DeepMind News
Last Week in AI
Last Week in AI
aimingoo的专栏
aimingoo的专栏
Cisco Talos Blog
Cisco Talos Blog
N
News and Events Feed by Topic
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
S
SegmentFault 最新的问题

博客园 - ZY.Zhou

windows10下docker启动失败原因定位 electron工程目录结构 MAC精简动画效果 Big Sur dmg镜像制作macos安装盘 WINDOWS下编译BOOST_PYTHON MYSQL单服务器迁移数据到集群 Centos7 解决gcc 4.85版本,升级更改版本gcc ubuntu下载安装文件和依赖包 fortify的linux环境使用步骤 linux top命令VIRT,RES,SHR,DATA的含义 docker导出镜像并压缩 main.c ubuntu 20开启rc.local LINUX间SSH免密登录 ubuntu 20.10上使用KVM安装K8S QEMU KVM宿主机与客户机间共享目录 Ubuntu20.10减肥 ubuntu的kennel命令行在哪个文件?虚拟机没有开SSH和TELNET,怎么连? 车辆功能部分缩写
centos7下安装redis集群
ZY.Zhou · 2021-11-30 · via 博客园 - ZY.Zhou

【可选】sudo yum install lrzsz            #使用sz rz进行文件上传或下载

从源代码编译redis

centos7下gcc是4.8.5的,无法编译redis-6.0.6.tar.gz,必须升级gcc
sudo yum install centos-release-scl -y
sudo yum install devtoolset-7-gcc* -y
scl enable devtoolset-7 bash

tar xvf redis-6.0.6.tar.gz
make clean && make -j4 && sudo make install

创建必要的文件夹
sudo mkdir -p /etc/redis
sudo mkdir -p /var/redis/7001
sudo mkdir -p /var/redis/7002
sudo mkdir -p /etc/redis-cluster
sudo mkdir -p /var/log/redis

生成配置文件7001.conf和7002.conf

cat > /etc/redis/7001.conf << EOF
port 7001
cluster-enabled yes
cluster-config-file /etc/redis-cluster/node-7001.conf
cluster-node-timeout 15000
daemonize yes
pidfile /var/run/redis_7001.pid
dir /var/redis/7001
logfile /var/log/redis/7001.log
bind 10.132.12.11 # you should change the ip
appendonly yes
requirepass admin123
masterauth admin123

EOF

复制文件到对应的文件夹
复制redis_7001、redis_7002到/etc/init.d/下,chmod +x redis_700*
复制7001.conf、7002.conf到/etc/redis下
启动
sudo /etc/init.d/redis_7001 start
sudo /etc/init.d/redis_7002 start

ps -ef | grep redis


开机自启动
sudo chkconfig redis_7001 on
sudo chkconfig redis_7002 on


创建集群
随便登录一台服务器
/usr/local/bin/redis-cli -a admin123 --cluster create 10.132.12.5:7001 10.132.12.5:7002 10.132.12.6:7001 10.132.12.6:7002 10.132.12.11:7001 10.132.12.11:7002 --cluster-replicas 1