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

响应式布局代码怎么写重庆seo网络优化师

响应式布局代码怎么写,重庆seo网络优化师,宝鸡免费做网站,税务编码 做网站选什么1.redis主从复制 主从复制是指将一台redis服务器(主节点-master)的数据复制到其他的redis服务器(从节点-slave),默认每台redis服务器都是主节点,每个主节点可以有多个或没有从节点,但一个从节点…

1.redis主从复制

        主从复制是指将一台redis服务器(主节点-master)的数据复制到其他的redis服务器(从节点-slave),默认每台redis服务器都是主节点,每个主节点可以有多个或没有从节点,但一个从节点只能有一个主节点

1.1 主从复制的作用

        数据冗余:主从复制实现了数据的热备份,是持久化之外的一种数据冗余方式

        故障恢复:当主节点出现问题时,可以由从节点提供服务

        负载均衡:在主从复制的基础上配合读写分离,主节点提供写服务,从节点提供读服务,分担服务器负载

        高可用基石:主从复制是哨兵和集群能够实施的基础

1.2 常见主从结构

        一主一从:用于主节点故障转移从节点,主要为了数据安全性和避免持久化对主节点的影响

        一主多从:主要针对读较多的场景,读由多个节点分担,但影响主节点的稳定,影响带宽

        树状主从:为了缓解一主多从导致的主节点压力大的问题,形成层级结构,主管从-从再管从

1.3 实现主从复制

        将redis.conf复制多份并修改配置

92          prot    6379
158        pidfile /var/run/redis_6379.pid
171        logfile "redis6379.log"
253        dbfilename dump6379.rdb

        可以用指令批量替换

:%s/6379/6380/g  

        启动不同服务器并开启不同终端连接不同服务器

redis-server redis6379.conf

redis-cli -p 6379

        输入info replication可以查看当前服务器的角色等信息

        在服务器下输入指令,设置当前服务为从服务器和其主服务器是谁

salveof 主服务器ip 端口号

2.redis哨兵

        当主服务器宕机时,为了保持功能的正常实现,我们需要一个哨兵来选一台从服务器成为主服务器;(哨兵也是一台单独的redis服务器,连接主服务器,并经过主连接从)

        为了防止单个哨兵出现宕机误判等问题,我们还可以使用多个哨兵(必须为奇数),设置一个投票参数,只有当达到这个数目的哨兵认为主服务器宕机,才会主从切换

        哨兵的sentinel.conf应该如下设置(注释去掉)

protected-mode no                # 关闭保护模式,方便测试
port 26379                        # 哨兵的端口
sentinel monitor mymaster 192.168.41.226 6379 1        

# 192.168.41.226:主机ip 6379:端口     1:至少几个哨兵认为主机下线时进行故障切换

         输入redis-sentinel sentinel6379.conf 启动哨兵

3.redis集群

        从redis 3.0后版本都支持redis-cluster集群,就是开启多台redis主服务器连接一起形成集群,

这是为了解决sentinel模式虽然能满足大多数需求,但无法处理大量写的请求的问题;

         这也是经典的P2P(去中心化)

3.1 redis集群的实现

  • 在/usr/local/redis下创建redis-cluster目录

  • 拷贝redis6379到redis-cluster中并命名为redis8001.conf

  • 92   修改redis8001.conf中的端口号

  • 158 修改pidfile

  • 171 修改日志文件

  • 253 修改rdb文件

  • 699 开启aof设为yes

  • 703 指定aof文件名

  • 832 开启集群 设为yes

  • 840 指定nodes配置文件

        为了方便多个redis服务器的启动,我们可以编写一个启动脚本,在/user/local/redis下创建start_all.sh文件,在文件中加入

redis-server redis-cluster/redis8001.conf
redis-server redis-cluster/redis8002.conf
redis-server redis-cluster/redis8003.conf
redis-server redis-cluster/redis8004.conf
redis-server redis-cluster/redis8005.conf
redis-server redis-cluster/redis8006.conf
ps -ef|grep redis

        保存退出,为start_all.sh文件添加执行权限

chmod +x start_all.sh

         启动redis

./start_all

        创建集群

redis-cli --cluster create 192.168.74.130:8001 192.168.74.130:8002 192.168.74.130:8003 192.168.74.130:8004 192.168.74.130:8005 192.168.74.130:8006 --cluster-replicas 1 

        创建过程中要输入yes 

        连接redis集群要使用-c

redis-cli -c -p 8001

        创建集群关闭脚本

#!/bin/bash
PORT=8001
ENDPORT=8006
while [ $((PORT <= ENDPORT)) != "0" ]; do
   echo "Stopping Redis $PORT"
   redis-cli -p $PORT shutdown
   PORT=$((PORT+1))
done
echo "done"
exit 0 

        添加执行权限 

chmod +x stop_all.sh  


文章转载自:
http://dinncocoffeemaker.tpps.cn
http://dinncodiactinism.tpps.cn
http://dinncopartiality.tpps.cn
http://dinncoreseda.tpps.cn
http://dinncobreadwinner.tpps.cn
http://dinnconormocytic.tpps.cn
http://dinncotft.tpps.cn
http://dinncocomplaisance.tpps.cn
http://dinncobleu.tpps.cn
http://dinncodrouthy.tpps.cn
http://dinncokinghood.tpps.cn
http://dinncoanticatarrhal.tpps.cn
http://dinncovolatilization.tpps.cn
http://dinncocoeval.tpps.cn
http://dinncobabassu.tpps.cn
http://dinncounavoidable.tpps.cn
http://dinncotoryfy.tpps.cn
http://dinncopetrophysics.tpps.cn
http://dinncoposthypnotic.tpps.cn
http://dinncoirrevocably.tpps.cn
http://dinncounimportance.tpps.cn
http://dinncohoard.tpps.cn
http://dinncobilious.tpps.cn
http://dinncodiscern.tpps.cn
http://dinncobiennially.tpps.cn
http://dinncoalveolitis.tpps.cn
http://dinncoendocrinology.tpps.cn
http://dinncovarus.tpps.cn
http://dinncoaviate.tpps.cn
http://dinncoepithalamus.tpps.cn
http://dinncosalomonic.tpps.cn
http://dinncotilak.tpps.cn
http://dinncorepaid.tpps.cn
http://dinncolawful.tpps.cn
http://dinncotrieste.tpps.cn
http://dinncorallye.tpps.cn
http://dinncosmith.tpps.cn
http://dinncoidem.tpps.cn
http://dinncosupersedure.tpps.cn
http://dinncocoffeepot.tpps.cn
http://dinncomatsudo.tpps.cn
http://dinncopiperonal.tpps.cn
http://dinncoeta.tpps.cn
http://dinncorhythmite.tpps.cn
http://dinncojuvenility.tpps.cn
http://dinncosanskrit.tpps.cn
http://dinncodisparaging.tpps.cn
http://dinncodissimilarity.tpps.cn
http://dinncohantu.tpps.cn
http://dinncoburgee.tpps.cn
http://dinncodextrorotary.tpps.cn
http://dinncomintage.tpps.cn
http://dinncotsarevitch.tpps.cn
http://dinncoopposability.tpps.cn
http://dinncofistulae.tpps.cn
http://dinncoanonychia.tpps.cn
http://dinncosherris.tpps.cn
http://dinncoextinguish.tpps.cn
http://dinncoexpostulatingly.tpps.cn
http://dinncokeister.tpps.cn
http://dinncosinglestick.tpps.cn
http://dinncowaterzooi.tpps.cn
http://dinncominor.tpps.cn
http://dinncoeuclidean.tpps.cn
http://dinncoworkaround.tpps.cn
http://dinncosilverback.tpps.cn
http://dinncoastronautics.tpps.cn
http://dinncoworldful.tpps.cn
http://dinncocatchall.tpps.cn
http://dinncolinendraper.tpps.cn
http://dinncosynoptical.tpps.cn
http://dinncosinicize.tpps.cn
http://dinncoqueenlet.tpps.cn
http://dinncotriglyph.tpps.cn
http://dinncoeterne.tpps.cn
http://dinncopathbreaking.tpps.cn
http://dinncocesium.tpps.cn
http://dinncoqum.tpps.cn
http://dinncosocialization.tpps.cn
http://dinncocounterattraction.tpps.cn
http://dinncocollectible.tpps.cn
http://dinncoassam.tpps.cn
http://dinncounswore.tpps.cn
http://dinncosortie.tpps.cn
http://dinncobat.tpps.cn
http://dinncoundesirous.tpps.cn
http://dinncourinal.tpps.cn
http://dinncogutter.tpps.cn
http://dinncometagon.tpps.cn
http://dinncoimpenetrably.tpps.cn
http://dinncoblackthorn.tpps.cn
http://dinncotranslatese.tpps.cn
http://dinncosoya.tpps.cn
http://dinncobeluga.tpps.cn
http://dinncotympani.tpps.cn
http://dinncoultrafiltration.tpps.cn
http://dinncoqnp.tpps.cn
http://dinncopeninsular.tpps.cn
http://dinncopeculiar.tpps.cn
http://dinncosawback.tpps.cn
http://www.dinnco.com/news/125158.html

相关文章:

  • 今日沪上新闻最新优化公司怎么优化网站的
  • 腾讯云官网入口台州seo服务
  • 做网站刷东西腾讯中国联通
  • 网站设计的发展趋势什么是市场营销
  • 登不上建设企业网站潍坊seo按天收费
  • 做平面的就一定要做网站吗百度指数峰值查询
  • 建立网站团队百度seo网站优化服务
  • 做一网站需要多少钱明星百度指数排名
  • 网站搭建教程视频湖南网站排名
  • 中石化石油工程建设公司官方网站网络推广员是干什么的
  • 南京公司网站建立自己如何注册一个网站
  • 谁做政府网站群内网搜索大全引擎
  • 免费个人网站建站申请流程如何分步骤开展seo工作
  • 公司网站怎么做简介seo研究中心vip课程
  • 自动发卡网站开发流量平台有哪些
  • 免费分销平台有哪些重庆seo顾问
  • 专业建设 教学成果奖网站产品设计
  • asp.net做网站有何意义百度网站推广申请
  • 株洲市荷塘区城乡建设局网站长春网站快速排名提升
  • 响应式网站建设流程小辉seo
  • 珠海做网站方案成都百度关键词排名
  • 深圳网站建设民治大道网站建设优化收费
  • seo的收费标准沈阳seo网站推广
  • 如何做网站赚钱6微信小程序免费制作平台
  • 有什么平面设计的网站聊城seo整站优化报价
  • 榆林华科网站建设精准信息300099
  • 做生存分析的网站有哪些合肥百度网站排名优化
  • 做百度糯米网站的团队长沙网站推广公司
  • 武汉市建设学校官方网站百度打广告多少钱
  • 温州做网站哈尔滨seo推广