上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 25 下一页
摘要: 一准备: 在db01中操作: [root@db01 ~]# mkdir -p /opt/redis_cluster/redis_{6380,6381}/{conf,logs,pid} [root@db01 ~]# mkdir –p /data/redis_cluster/redis_{6380,63 阅读全文
posted @ 2021-04-12 18:26 linuxTang 阅读(95) 评论(0) 推荐(0)
摘要: 1主redis宕掉后,发现db02自动变为主库: [root@db01 ~]# pkill redis [root@db01 ~]# redis-cli -h db03 -p 6379 set k1 v1 (error) READONLY You can't write against a read 阅读全文
posted @ 2021-04-10 10:40 linuxTang 阅读(441) 评论(0) 推荐(0)
摘要: 1停掉所有主从redis,然后删除从里面免密钥登录文件 127.0.0.1:6379> shutdown not connected> [root@db03 ~]# cd /root/.ssh/ [root@db03 .ssh]# ls id_rsa.pub [root@db03 .ssh]# rm 阅读全文
posted @ 2021-04-10 09:24 linuxTang 阅读(1050) 评论(0) 推荐(0)
摘要: 一准备2台装有redis的机器(在所有节点都操作): 1#杀掉redis:pkill redis 2#清空数据:rm -rf /data/redis_cluster/redis_6379/* 3#编写配置文件 ### 以守护进程模式启动 daemonize yes ### 绑定的主机地址 bind 阅读全文
posted @ 2021-04-07 17:05 linuxTang 阅读(416) 评论(0) 推荐(0)
摘要: 一,给db01和db02两台机器建立互信: 1在db01机器中生成公匙并将公匙传送给db02: [root@db01 ~]# ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save t 阅读全文
posted @ 2021-04-07 15:31 linuxTang 阅读(105) 评论(0) 推荐(0)
摘要: 1配置文件中设置长期密码 [root@db01 ~]# vim /opt/redis_cluster/redis_6379/conf/redis_6379.conf ### 以守护进程模式启动 daemonize yes ### 绑定的主机地址 bind 10.0.0.201 127.0.0.1 # 阅读全文
posted @ 2021-04-06 13:57 linuxTang 阅读(114) 评论(0) 推荐(0)
摘要: 1编写配置文件(红字) [root@db01 ~]# vim /opt/redis_cluster/redis_6379/conf/redis_6379.conf ### 以守护进程模式启动 daemonize yes ### 绑定的主机地址 bind 10.0.0.201 127.0.0.1 ## 阅读全文
posted @ 2021-04-02 17:24 linuxTang 阅读(66) 评论(0) 推荐(0)
摘要: 1持久化只需要在配置文件中添加如下3行红字,只要满足一个条件,就可以保存数据 [root@db01 ~]# vim /opt/redis_cluster/redis_6379/conf/redis_6379.conf ### 以守护进程模式启动 daemonize yes ### 绑定的主机地址 b 阅读全文
posted @ 2021-04-02 17:16 linuxTang 阅读(62) 评论(0) 推荐(0)
摘要: 1redis可作为mysql的缓存使用,这个映射关系就可以用hash哈希值处理,例如mysql中select * from user where id=1000这个语句表示要查询id=1000的用户的所有信息,在redis中就可以用hgetall user:1000来表示: 127.0.0.1:63 阅读全文
posted @ 2021-04-01 16:56 linuxTang 阅读(134) 评论(0) 推荐(0)
摘要: 1差集: 127.0.0.1:6379> sadd set1 1 2 5 8 9 #添加第一个集合 (integer) 5 127.0.0.1:6379> smembers set1 #查看集合内容 1) "1" 2) "2" 3) "5" 4) "8" 5) "9" 127.0.0.1:6379> 阅读全文
posted @ 2021-04-01 16:55 linuxTang 阅读(47) 评论(0) 推荐(0)
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 25 下一页