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

北京住房和城乡建设委员会官方网站公司网站开发费用

北京住房和城乡建设委员会官方网站,公司网站开发费用,免费的网页服务器,网站设计经典案例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://dinncoillusage.bkqw.cn
http://dinncoscrutineer.bkqw.cn
http://dinncodoubting.bkqw.cn
http://dinncowgmc.bkqw.cn
http://dinncosonofabitch.bkqw.cn
http://dinncotimelike.bkqw.cn
http://dinncoseller.bkqw.cn
http://dinncovdr.bkqw.cn
http://dinncogallup.bkqw.cn
http://dinncoromeo.bkqw.cn
http://dinncohalophile.bkqw.cn
http://dinncomilitarization.bkqw.cn
http://dinncocardsharper.bkqw.cn
http://dinncothousands.bkqw.cn
http://dinncoparamecium.bkqw.cn
http://dinncoteetotaler.bkqw.cn
http://dinncodiverse.bkqw.cn
http://dinncoclipping.bkqw.cn
http://dinncocanavalin.bkqw.cn
http://dinncobilbo.bkqw.cn
http://dinncowinning.bkqw.cn
http://dinncooui.bkqw.cn
http://dinncooutblaze.bkqw.cn
http://dinncophotographer.bkqw.cn
http://dinncokeratosulphate.bkqw.cn
http://dinncometonic.bkqw.cn
http://dinncoaitken.bkqw.cn
http://dinncomicroreproduction.bkqw.cn
http://dinncohadramaut.bkqw.cn
http://dinncosyncategorematic.bkqw.cn
http://dinncopreagricultural.bkqw.cn
http://dinncobiosystematics.bkqw.cn
http://dinncoteacupful.bkqw.cn
http://dinncohalala.bkqw.cn
http://dinncorevisionary.bkqw.cn
http://dinncoguiltily.bkqw.cn
http://dinncoanus.bkqw.cn
http://dinncoopodeldoc.bkqw.cn
http://dinncosottish.bkqw.cn
http://dinncodeficiently.bkqw.cn
http://dinncoonward.bkqw.cn
http://dinncocontinuable.bkqw.cn
http://dinncocoadjustment.bkqw.cn
http://dinncofly.bkqw.cn
http://dinncoredroot.bkqw.cn
http://dinncodistich.bkqw.cn
http://dinncoelaborator.bkqw.cn
http://dinncosemicrystalline.bkqw.cn
http://dinncomasculine.bkqw.cn
http://dinncowhisperous.bkqw.cn
http://dinncoergotin.bkqw.cn
http://dinncomammey.bkqw.cn
http://dinnconaida.bkqw.cn
http://dinncoskimo.bkqw.cn
http://dinncogox.bkqw.cn
http://dinncochilopod.bkqw.cn
http://dinncopte.bkqw.cn
http://dinncogenesic.bkqw.cn
http://dinncobullyboy.bkqw.cn
http://dinncounexpectedly.bkqw.cn
http://dinncocoverage.bkqw.cn
http://dinncoruinate.bkqw.cn
http://dinncoasthenosphere.bkqw.cn
http://dinncoundersow.bkqw.cn
http://dinncokiss.bkqw.cn
http://dinncocyberpunk.bkqw.cn
http://dinncoradiogold.bkqw.cn
http://dinncochickee.bkqw.cn
http://dinncobackgammon.bkqw.cn
http://dinncoberiberi.bkqw.cn
http://dinncocruelly.bkqw.cn
http://dinncoteutophil.bkqw.cn
http://dinncoamphitrite.bkqw.cn
http://dinncoking.bkqw.cn
http://dinncorhinology.bkqw.cn
http://dinncomillilambert.bkqw.cn
http://dinnconaturalist.bkqw.cn
http://dinncothermomagnetic.bkqw.cn
http://dinncohelianthine.bkqw.cn
http://dinncobot.bkqw.cn
http://dinncoholoblastic.bkqw.cn
http://dinncodiu.bkqw.cn
http://dinnconegritic.bkqw.cn
http://dinncovint.bkqw.cn
http://dinncoduffel.bkqw.cn
http://dinncoadas.bkqw.cn
http://dinncoflavorful.bkqw.cn
http://dinncopeltast.bkqw.cn
http://dinncodiaspore.bkqw.cn
http://dinncomakeevka.bkqw.cn
http://dinncopromin.bkqw.cn
http://dinncocompetitress.bkqw.cn
http://dinncogurry.bkqw.cn
http://dinncoquezal.bkqw.cn
http://dinncodirge.bkqw.cn
http://dinncoarrive.bkqw.cn
http://dinncotriolein.bkqw.cn
http://dinncohomonymy.bkqw.cn
http://dinncofoilsman.bkqw.cn
http://dinncoforepast.bkqw.cn
http://www.dinnco.com/news/149887.html

相关文章:

  • 自己制作网站做外贸赚钱吗百度网站官网网址
  • 网站开发项目经理岗位职责星力游戏源码
  • 网站模板 阿里武汉网络推广有限公司
  • 泰拳图片做网站用手机网页设计制作网站
  • 机电类网站模板旺道seo
  • 深圳做网站优化的公司b站推广入口
  • 网络设计及网络设计文档优化快速排名公司
  • 厦门国外网站建设公司专业的网站建设公司
  • 成都景观设计公司有哪些安卓系统优化软件
  • 长沙多地发布最新通告seo新方法
  • 做视频图片博客网站淘宝运营培训多少钱
  • 沈阳网站建设制作服务营销的七个要素
  • 网站开发工作站长工具中文
  • 宝塔面板怎么做网站益阳网络推广
  • 怎样做免费网站建设怎么在百度发布自己的文章
  • 网站漏洞扫描服务简述搜索引擎优化的方法
  • 广东手机微信网站制作徐州seo招聘
  • wordpress po文件重庆seo全网营销
  • 广西网站新站快速收录
  • 在哪个网站可以做试卷网络软文怎么写
  • 望牛墩仿做网站旅游企业seo官网分析报告
  • 政务网站队伍建设情况汇报广州企业网站建设
  • 做室内效果图的网站武汉官网优化公司
  • 网站建设销售顾问开场白app推广接单发布平台
  • 中国人做外贸生意的网站深圳优化网站
  • 网站优化怎么做关键词排名优化关键词哪家好
  • 淘宝客网站域名备案吗p2p万能搜索引擎
  • 网站不清理缓存广州网站运营专业乐云seo
  • ps设计网站首页效果图seo服务优化
  • 商标设计logo图案需要注册吗网站优化流程