赞
踩
yum install gcc
gcc --version
cd /opt && tar -zxvf redis-6.2.6.tar.gz
cd redis-6.2.6
make && make install
cd /usr/local/bin && ll
cd /opt/redis-6.2.6/
cp redis.conf /etc/redis.conf
vim /etc/redis.conf
/usr/local/bin/redis-server /etc/redis.conf
ps -aux | grep redis
/usr/local/bin/redis-cli
/usr/local/bin/redis-server /etc/redis.conf && ps -aux | grep redis
systemctl start firewalld && firewall-cmd --permanent --add-port=7489/tcp && firewall-cmd --reload && firewall-cmd --query-port=7489/tcp
vim /etc/redis.conf
/usr/local/bin/redis-cli -p 7489
/usr/local/bin/redis-server /etc/redis.conf && ps -aux | grep redis
public static void main(String[] args) {
// 连接服务器的redis命令行
Jedis jedis = new Jedis("xxx", xx);
// 如果redis设置了密码要先进行验证
jedis.auth("******");
String ping = jedis.ping();
System.out.println(ping);
}
slaveof xxxx xxx
slaveof 。。。。。。
info replication
touch /etc/sentinel.conf
vim /etc/sentinel.conf
sentinel monitor redis_master ........
/usr/local/bin/redis-sentinel /etc/sentinel.conf
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。