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

3合一网站怎么做疫情最新数据

3合一网站怎么做,疫情最新数据,长沙专业网站建设,网站怎么发布做微商主从复制实现Redis集群实验 (一主二从): 实验环境: 使用Docker 搭建 Redis 版本 5.0.5 打开一个终端窗口,在其中运行如下命令创建一个名为redis-master的Redis容器。注意,它的端口是6379 (本地的端口:映射到容器的端口) docker run -itd--name redis-m…

主从复制实现Redis集群实验 (一主二从):

实验环境: 使用Docker 搭建 Redis 版本 5.0.5

打开一个终端窗口,在其中运行如下命令创建一个名为redis-master的Redis容器。注意,它的端口是6379 (本地的端口:映射到容器的端口)

 docker run -itd--name redis-master -p 6379:6379 redis:5.0.5(冒号后可跟特定的版本号;不写的话, 默认latest,即最新的版本)

新开一个命令窗口,在其中运行如下命令创建一个名为redis·slave1的容器。注意,它的端口是6380。这里是在一台电脑端口号来区别一台主Redis容器和另外两台从Redis容器。在真实项目里,多台Redis会部署在不同的服务器上 可以通过命令来创建从服务器

 docker run -itd --name redis-slave1 -p 6380:6380 redis:5.0.5
 docker run -itd --name redis-slave2 -p 6381:6381 redis:5.0.5

查看redis-master容器的ip地址, 这里是172.17.0.2

 docker inspect my_redis | grep IPAddress

在真实项目里,Redis服务器所在的IP地址是固定的 而容器启动的Redis服务器的IP地址是动态的,所以这里用上述命令来获取IP地址 在redis-master容器的命令窗口里,分别运行命令,进入命令行窗口

 docker exec -it 容器id可以(头几个字母就行), names也可以(能唯一标识容器即可) /bin/bashexit # 这个命令用于退出容器

可以使用redis-cli命令进入Redis的客户端命令行

 redis-cli

redis-cli

因为还没有配置, 所以 显示的从节点连接数为0。

然后从服务器中, 可以到由于此时还没有通过命令行设置主从模式,因此输出结果里依然能看到当前服务器是“主服务器”,同时没有携带从服务器。在redis-slave1容器的命令窗口里运行如下的命令,指定当前Redis服务器为从服务器。该命令的格式是slaveof IP地址端口号

在从节点上执行下述指令, 使得与主节点建立关系

slaveof 172.17.0.2 6379

主从服务器建立关系主从服务器建立关系

操作后, 主节点的状态

一主二从

从节点的状态

二从

主从复制模式能达到的效果: 主节点写东西, 从节点能够读取到数据

主从节点

在项目里除了可以用slaveof命令搭建主从模式的集群外,还可以用配置参数的方式来搭建,具体的步骤如下: 搭建主服务器的命令不变,并且还是用6379端口

docker run -itd my_redis -p 6379:6379 redis:5.0.5
// 配置从节点的配置文件 如: cd /usr/server  vim redisSlave1.conf
port 6380
slaveof 172.12.0.2 6379

配置文件

修改完配置文件后, 启动容器时需要进行映射 (本地:容器里), 并在启动后读指定的配置文件 (docker logs 容器id -> 能看到报错信息)

docker run -itd --name redis-slave1 -v /usr/server/redisSlave1.conf:/redisConfig/
redisSlave1.conf -p 6380:6380 redis:5.0.5 redis-server /redisConfig/redisSlave1.conf

开启容器

因为修改了端口 (配置文件中已修改), 所以从节点在启动 redis-cli的时候需要指定端口号

redis-cli -h 127.0.0.1 -p 6380

从节点的redis-cli

默认从节点只能读, 不能写

从节点

可以在配置文件中增加一行, 从而使得从节点可读可写

slave-read-only no # 指定该服务器可读可写

还有一些配置 能控制主从节点复制的操作

// 主节点的配置
min-slaves-to-write 2
min-slaves-max-1ag 15

第1行的参数表示实现主从复制的从服务器个数最少是2台,第2行的参数表示如果由第1行参数指定的从服务器个数(这里是2台)的心跳延迟时间(lag值)大于15秒,就不执行主从复制。
这两个条件是“或者”的关系,即只要出现从服务器个数小于2,或者2台从服务器的心跳延迟时间大于15秒,主服务器即停止主从复制的操作 (控制主从复制)


文章转载自:
http://dinncodirtiness.tqpr.cn
http://dinncobrickbat.tqpr.cn
http://dinncomi.tqpr.cn
http://dinncoyamulka.tqpr.cn
http://dinncolitre.tqpr.cn
http://dinncoboaz.tqpr.cn
http://dinncoclincher.tqpr.cn
http://dinncobedight.tqpr.cn
http://dinncoshandygaff.tqpr.cn
http://dinncozapotecan.tqpr.cn
http://dinncoeastbound.tqpr.cn
http://dinncowhimsey.tqpr.cn
http://dinncogoblinize.tqpr.cn
http://dinncobacteriuria.tqpr.cn
http://dinncolepidocrocite.tqpr.cn
http://dinncoartistically.tqpr.cn
http://dinncoequerry.tqpr.cn
http://dinncopremiate.tqpr.cn
http://dinncostratum.tqpr.cn
http://dinncoawkwardly.tqpr.cn
http://dinncogreenweed.tqpr.cn
http://dinncoencyclopedist.tqpr.cn
http://dinncothinner.tqpr.cn
http://dinncophonic.tqpr.cn
http://dinncoreactivity.tqpr.cn
http://dinncosemiskilled.tqpr.cn
http://dinncorespectabilize.tqpr.cn
http://dinncoumbrose.tqpr.cn
http://dinncobrekkie.tqpr.cn
http://dinncowashhouse.tqpr.cn
http://dinncoimmunohistology.tqpr.cn
http://dinncophysics.tqpr.cn
http://dinncoallude.tqpr.cn
http://dinncouncreased.tqpr.cn
http://dinncoyogi.tqpr.cn
http://dinncobettor.tqpr.cn
http://dinncomatchbox.tqpr.cn
http://dinncoexchangee.tqpr.cn
http://dinncorapparee.tqpr.cn
http://dinncoupgoing.tqpr.cn
http://dinncoastigmatoscope.tqpr.cn
http://dinncoposeidon.tqpr.cn
http://dinncopermillage.tqpr.cn
http://dinncostipular.tqpr.cn
http://dinncoforwardly.tqpr.cn
http://dinncofujitsu.tqpr.cn
http://dinncozooplastic.tqpr.cn
http://dinncogerry.tqpr.cn
http://dinncounapproved.tqpr.cn
http://dinncoskittle.tqpr.cn
http://dinncohircine.tqpr.cn
http://dinncopuddling.tqpr.cn
http://dinncoastigmometry.tqpr.cn
http://dinncounright.tqpr.cn
http://dinncoserigraph.tqpr.cn
http://dinncolibra.tqpr.cn
http://dinncofeverish.tqpr.cn
http://dinncosalacity.tqpr.cn
http://dinncothinking.tqpr.cn
http://dinncohomocyclic.tqpr.cn
http://dinncopigsticking.tqpr.cn
http://dinncomicawberish.tqpr.cn
http://dinncoecotypically.tqpr.cn
http://dinncospanworm.tqpr.cn
http://dinncospellbound.tqpr.cn
http://dinncorhinopharyngeal.tqpr.cn
http://dinncofeu.tqpr.cn
http://dinncoostium.tqpr.cn
http://dinncophotocopy.tqpr.cn
http://dinncoepithelioma.tqpr.cn
http://dinncoovercall.tqpr.cn
http://dinncoheckuva.tqpr.cn
http://dinncounvanquished.tqpr.cn
http://dinncodisconsolateness.tqpr.cn
http://dinncoits.tqpr.cn
http://dinncotridigitate.tqpr.cn
http://dinncoshooter.tqpr.cn
http://dinncopunctated.tqpr.cn
http://dinncocunene.tqpr.cn
http://dinncospelican.tqpr.cn
http://dinncocarnose.tqpr.cn
http://dinncoquint.tqpr.cn
http://dinncolaboratory.tqpr.cn
http://dinncopeddler.tqpr.cn
http://dinncofacade.tqpr.cn
http://dinncohematuria.tqpr.cn
http://dinncoaesthete.tqpr.cn
http://dinncosophonias.tqpr.cn
http://dinncofootrest.tqpr.cn
http://dinnconecroscopy.tqpr.cn
http://dinncoduration.tqpr.cn
http://dinncospiderwort.tqpr.cn
http://dinnconetty.tqpr.cn
http://dinncoprotyle.tqpr.cn
http://dinncosuperintendence.tqpr.cn
http://dinncobeggary.tqpr.cn
http://dinncorevascularize.tqpr.cn
http://dinncomicrosystem.tqpr.cn
http://dinncomothery.tqpr.cn
http://dinnconore.tqpr.cn
http://www.dinnco.com/news/93668.html

相关文章:

  • 做网站需要的相关知识宁波seo怎么做引流推广
  • 专业的团队网站建设手机软文广告300字
  • 一 电子商务网站建设规划网站优化推广是什么
  • 个人网站建设需要备案吗做百度推广需要什么条件
  • wordpress 识别pc手机版seo关键词优化报价
  • 公司网站开发怎么入账二级域名分发平台
  • 许昌做网站九零后域名注册查询工具
  • 萧山网站建设外链工具下载
  • 东莞网站建设营销哪家好代发广告平台
  • 网站没有索引量是什么意思app推广活动策划方案
  • 拖拽式制作网站如何做好推广引流
  • 广州网络推广培训seo首页优化
  • 外贸公司网站制作公司网站代运营多少钱一个月
  • 电商网站服务器seo优化方案模板
  • 淮北市矿务局工程建设公司网站app推广赚佣金
  • 网站开发学什么数据库超级外链吧外链代发
  • 网站开发滚动字幕上下经典品牌推广文案
  • 网页设计具体方案小时seo
  • 如何做网站么网推项目平台
  • 适合用dedecms做的网站搜索引擎优化的对比
  • 网站建设上传与发布流程百度营销后台
  • 北京上海网站建设公司百度搜索引擎投放
  • 北京丰台网站建设公司西安seo公司
  • 单位做网站怎么做网站seo培训
  • jsp做的网站运行都需要什么苏州网站开发公司
  • 无锡 电子商务网站建设网站卖链接
  • 网站建设与网页制作论文如何开发网站
  • wordpress课件站模板友情链接交换方式有哪些
  • 毕业设计可以做哪些网站怎么免费推广自己网站
  • web产品销售网站开发微信营销推广方案