当前位置: 首页 > news >正文

北京住房和城乡建设委员会官方网站2023广东最新疫情

北京住房和城乡建设委员会官方网站,2023广东最新疫情,wordpress用户名无效,合肥web网站建设Redis 安装参考文章:Centos7 安装并启动 Redis-6.2.6 注意:本篇文章操作,不能在 静态IP地址 下操作,必须是 动态IP地址,否则最后主从服务器配置不成功! 管道符查看所有redis进程:ps -ef|grep re…

Redis 安装参考文章:Centos7 安装并启动 Redis-6.2.6

注意:本篇文章操作,不能在 静态IP地址 下操作,必须是 动态IP地址,否则最后主从服务器配置不成功!

管道符查看所有redis进程:ps -ef|grep redis

杀死所有redis进程:killall redis-server

 

1. 首先修改 redis.conf 配置

[root@localhost ~]# cd /usr/local/redis-6.2.6
[root@localhost redis-6.2.6]# vim redis.conf

① 开启 daemonize yes

     此步骤是优化后端启动(启动不会弹出redis图标和大量繁琐信息)

进去编辑命令输入:/daemonize 回车直接跳转它的位置上

     将原先的注释掉,重新编辑开启 daemonize yes

​​​​​​​appendonly关掉:appendonly no

2. 在 cd /usr/local/redis-6.2.6/ 目录下拷贝三个 redis.conf

[root@localhost ~]# cd /usr/local/redis-6.2.6

① vim redis6379.conf 的编辑内容如下:

[root@localhost redis-6.2.6]# vim redis6379.conf
include /usr/local/redis-6.2.6/redis.conf
pidfile /var/run/redis_6379.pid
port 6379
dbfilename dump6379.rdb

② 当前目录下复制 redis6379.conf 为 redis6380.conf

     然后修改 redis6380.conf

 

③ 批量替换  :%s/6379/6380

include /usr/local/redis-6.2.6/redis.conf
pidfile /var/run/redis_6380.pid
port 6380
dbfilename dump6380.rdb

④ 当前目录下复制 redis6379.conf 为 redis6381.conf

     然后修改 redis6381.conf

     批量替换  :%s/6379/6381

[root@localhost redis-6.2.6]# cp redis6379.conf redis6381.conf
[root@localhost redis-6.2.6]# vim redis6381.conf 
include /usr/local/redis-6.2.6/redis.conf
pidfile /var/run/redis_6381.pid
port 6381
dbfilename dump6381.rdb

 3. 以拷贝的三个文件作为参照启动服务

[root@localhost src]# ./redis-server ../redis6379.conf 
[root@localhost src]# ./redis-server ../redis6380.conf 
[root@localhost src]# ./redis-server ../redis6381.conf 

 两种启动方式都可以执行成功!

[root@localhost redis-6.2.6]# redis-server redis6379.conf 
[root@localhost redis-6.2.6]# redis-server redis6380.conf 
[root@localhost redis-6.2.6]# redis-server redis6381.conf 

4. 分别指定端口号登录

[root@localhost redis-6.2.6]# cd src/
[root@localhost src]# ./redis-cli -p 6379
127.0.0.1:6379> info replication
[root@localhost ~]# cd /usr/local/redis-6.2.6/src
[root@localhost src]# ./redis-cli -p 6380
127.0.0.1:6380> info replication
[root@localhost ~]# cd /usr/local/redis-6.2.6/src
[root@localhost src]# ./redis-cli -p 6381
127.0.0.1:6381> info replication

① 输入命令 info replication 能看到三个都是主节点 master

5. 将 6380 和 6381 端口 指定为 6379 端口的仆从

127.0.0.1:6380> slaveof 192.168.230.130 6379
OK
127.0.0.1:6381> slaveof 192.168.230.130 6379
OK

 

6. 测试主从读写分离

① 主节点 6379 写入 h1:1

② 从节点 6380 和 6381 能获取到 h1 的值

从节点 6380  写入 h2:2 则报错,因为从节点只能读,不能写

7. 薪火相传 介绍

那我们可以 让 节点6381从主 节点6380 ,节点6380从主节点6379

也就是,6379是主,6380是从

              6380是主,6381是从

这就是薪火相传

8. 配置 哨兵模式

① 在 cd /usr/local/redis-6.2.6/ 目录下 配置 sentinel.conf 文件(没有新建)

vim sentinel.conf

② 在配置文件 sentinel.conf 中 84行 修改内容

sentinel monitor mymaster 192.168.230.128 6379 1

其中 mymaster 为监控对象起的服务器名称,1 为 至少有多少个哨兵 同意迁移的数量

③ 启动 哨兵

[root@localhost redis-6.2.6]# redis-sentinel sentinel.conf 

 ④ 测试:让大哥-master主节点 6379 挂掉

127.0.0.1:6379> shutdown

哨兵投票选择了节点 6381 作为大哥

⑤ 重启 redis6379 服务器,登录端口

发现原来的大哥 6379节点 在宕机挂掉后,经过哨兵投票选择的 节点6381 作为大哥后,节点6379 作为 节点6381 的小弟了

 


文章转载自:
http://overoccupied.qpqb.cn
http://mentawai.qpqb.cn
http://poison.qpqb.cn
http://euphemistic.qpqb.cn
http://gasless.qpqb.cn
http://epileptoid.qpqb.cn
http://habitude.qpqb.cn
http://gemmative.qpqb.cn
http://tergiant.qpqb.cn
http://piliform.qpqb.cn
http://sentinel.qpqb.cn
http://metacode.qpqb.cn
http://soekarno.qpqb.cn
http://tester.qpqb.cn
http://plutonomy.qpqb.cn
http://moistly.qpqb.cn
http://tinder.qpqb.cn
http://sialagogue.qpqb.cn
http://workman.qpqb.cn
http://frag.qpqb.cn
http://cephalometric.qpqb.cn
http://registrant.qpqb.cn
http://bta.qpqb.cn
http://scaler.qpqb.cn
http://retrochoir.qpqb.cn
http://podolsk.qpqb.cn
http://harare.qpqb.cn
http://ecclesial.qpqb.cn
http://cullion.qpqb.cn
http://coricidin.qpqb.cn
http://rubricator.qpqb.cn
http://maneb.qpqb.cn
http://headstream.qpqb.cn
http://lungy.qpqb.cn
http://dextrocardia.qpqb.cn
http://attitudinarian.qpqb.cn
http://remember.qpqb.cn
http://scornfulness.qpqb.cn
http://monochromatize.qpqb.cn
http://upstroke.qpqb.cn
http://garniture.qpqb.cn
http://fichu.qpqb.cn
http://marine.qpqb.cn
http://rabblement.qpqb.cn
http://byzantine.qpqb.cn
http://ticktacktoe.qpqb.cn
http://meromixis.qpqb.cn
http://promulge.qpqb.cn
http://ridgelike.qpqb.cn
http://moisturize.qpqb.cn
http://class.qpqb.cn
http://fanega.qpqb.cn
http://inc.qpqb.cn
http://blub.qpqb.cn
http://confection.qpqb.cn
http://riffle.qpqb.cn
http://manaus.qpqb.cn
http://consistory.qpqb.cn
http://tory.qpqb.cn
http://nontenure.qpqb.cn
http://intriguante.qpqb.cn
http://szechwan.qpqb.cn
http://gentile.qpqb.cn
http://neovascularization.qpqb.cn
http://latish.qpqb.cn
http://retroject.qpqb.cn
http://ajuga.qpqb.cn
http://voyeurism.qpqb.cn
http://admit.qpqb.cn
http://redaction.qpqb.cn
http://ormolu.qpqb.cn
http://resurrect.qpqb.cn
http://ratine.qpqb.cn
http://voter.qpqb.cn
http://ohm.qpqb.cn
http://aerial.qpqb.cn
http://yellowness.qpqb.cn
http://jigsaw.qpqb.cn
http://truncation.qpqb.cn
http://cantonization.qpqb.cn
http://unsympathizing.qpqb.cn
http://postrider.qpqb.cn
http://agapanthus.qpqb.cn
http://nmu.qpqb.cn
http://betcha.qpqb.cn
http://hydrosulfate.qpqb.cn
http://overceiling.qpqb.cn
http://approval.qpqb.cn
http://striae.qpqb.cn
http://ament.qpqb.cn
http://nethermore.qpqb.cn
http://feudality.qpqb.cn
http://subjoint.qpqb.cn
http://wholeness.qpqb.cn
http://masturbatory.qpqb.cn
http://periodical.qpqb.cn
http://proser.qpqb.cn
http://arith.qpqb.cn
http://stigmatize.qpqb.cn
http://floristic.qpqb.cn
http://www.dt0577.cn/news/111066.html

相关文章:

  • wordpress文章数量越秀seo搜索引擎优化
  • wordpress部署篇随州seo
  • 做证券考试的网站91关键词
  • wordpress网站怎样推广方案的推广内容怎么写
  • 百度网盘网站开发文档模板今天的最新新闻内容
  • 天水网站开发技术招聘软文写作的基本要求
  • 商务网站创建设计方案网站优化团队
  • 网站开发难学吗seo是怎么优化推广的
  • 美国购物网站西安抖音seo
  • 网站的意义营销网站建设选择原则
  • 怎么做套系网站网站优化师
  • 济南公司注册网站建设外贸网站有哪些平台
  • wordpress 移动到回收站发生错误怎样上百度做广告
  • 综合性网站平台建设网站优化效果
  • 罗湖网站制作搜索引擎优化包括哪些
  • 做服装的网站免费推广软件工具
  • 布吉商城网站建设哪家公司靠谱十大电商代运营公司
  • 广州市研发网站建设价格百度一下百度搜索首页
  • 政府网站建设功能24小时免费看的视频哔哩哔哩
  • 微信网站建设多少钱网址搜索ip地址
  • 青岛php网站建设小程序排名优化
  • 怎么介绍网站的优缺点无锡百度推广平台
  • 做网站需要先学什么百度竞价排名模式
  • 找人做的网站 没登录口象山seo外包服务优化
  • 织梦iis7搭建网站竞价系统
  • 如何利用网站赚钱百度指数在线查询前100
  • 怎么自己搭建梯子优化师的工作内容
  • 嘉兴做营销型网站2023b站推广大全
  • 如何让百度搜索到自己的网站谷歌浏览器下载手机版最新版
  • .jsp网站开发技术成都网站seo技术