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

网站 公众号信息化建设工作seo快速建站

网站 公众号信息化建设工作,seo快速建站,国外财经网站是怎么做的,destoon 网站搬家做一个伪集群 配置文件: daemonize yes port 7777 logfile .redis-7777.log dir ./ bind 0.0.0.0启动6666 and 7777 现在设置主从表 但是有个问题我把服务器停掉 关系就会解除 还可以手动解除 slaveof no one 命令 配置Sentinel(哨兵&#…

 

 

 

做一个伪集群

 配置文件:

daemonize yes
port 7777
logfile .redis-7777.log
dir ./
bind 0.0.0.0

启动6666    and    7777

 

 

 现在设置主从表

 

 

 

 但是有个问题我把服务器停掉  关系就会解除

还可以手动解除    

slaveof no one 命令

 配置Sentinel(哨兵)

 

 

 

 

 

 故障转移

配置文件搞进来:

 

 

 当7000停掉后:: ./src/redis-cli -p 7000 shutdown

7001  或者  7002会有一个为主机

故障转移测试

IDEA操作:

<dependencies><dependency><groupId>com.yugabyte</groupId><artifactId>jedis</artifactId><version>2.9.0-yb-11</version></dependency><dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>4.12</version></dependency></dependencies>

测试:

package com.ff.test;import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisSentinelPool;import java.util.HashSet;
import java.util.Random;
import java.util.Set;public class RedisTest2 {public static void main(String[] args) {/*Set<String> set = new HashSet<String>();set.add("192.168.200.166:26379");set.add("192.168.200.166:26380");set.add("192.168.200.166:26381");JedisSentinelPool pool = new JedisSentinelPool("mymaster",set);Jedis jedis = pool.getResource();jedis.set("hello", "java");String hello = jedis.get("hello");System.out.println(hello);jedis.close();*/String nodeName = "mymaster";Set<String> set = new HashSet<String>();set.add("192.168.200.166:26379");set.add("192.168.200.166:26380");set.add("192.168.200.166:26381");@SuppressWarnings("resource")JedisSentinelPool sentinelPool = new JedisSentinelPool(nodeName, set);int count = 0;   //计数器while(true) {Jedis jedis = null;try {jedis = sentinelPool.getResource();jedis.select(1);int idx = new Random().nextInt(100000);jedis.set("k-" + idx, "v-" +idx);if(count % 100 == 0) {System.out.println("k-" +idx);}count++;} catch (Exception e) {e.printStackTrace();} finally {if(jedis != null) {jedis.close();}}try {Thread.sleep(10);} catch (InterruptedException e) {e.printStackTrace();} finally {}}}
}

 一直运行 我们在将主表停掉,然后等一会就会发现转移了

 故障转移的时候不可以操作Redis  -----会出现脑裂    (出现两个表   网络震荡  解决不了)

在Spring下操作:

 SpringBoot访问Sentinel

 Redis开发规范

 

 

 

 Redis内存管理

 

 

 

http://www.hkea.cn/news/328259/

相关文章:

  • 平度市建设局网站济宁百度推广价格
  • 茶类网站建设方案西安网站seo排名优化
  • 南和县住房和建设局网站石家庄整站优化技术
  • 做教育网站销售的好吗成都百度网站排名优化
  • 展览展会网页模板下载河南网站优化排名
  • 自己做网站上传视频疫情二十条优化措施
  • 网站排名上升 优帮云网络销售培训学校
  • 对于政务网站建设的建议网站收录优化
  • 网站策划与建设阶段的推广方法网络软文怎么写
  • 漳州公司做网站重庆网站建设
  • 十大网络平台有哪些网站关键词排名seo
  • 建b2c网站google官方下载安装
  • 广州b2b网站建设公司推广网站
  • 新乡市封丘县建设局网站百度教育官网登录入口
  • 网站开发项目点击器
  • 建公司网站需要多少钱推广普通话手抄报内容资料
  • 东莞市建设监督网站首页app宣传推广方案
  • 网站设计基本功能域名免费注册0元注册
  • 徐州网站建设的特点营销咨询公司
  • 网站建设问题表在seo优化中
  • 网站建设公司 倒闭店铺推广方法
  • 网站搭建素材短视频培训
  • amazon虚拟机免费做网站百度信息流怎么收费
  • 深圳做网站推广公司聊城seo整站优化报价
  • 深圳专业app网站开发企业网站建设原则是
  • 网站开发师职责柳州网站建设哪里有
  • 自己做的网站怎么改电话网络推广代运营公司
  • 做水果的网站有哪些google高级搜索
  • 怎么用网站做文案百度推广可以自己开户吗
  • 做的好的新闻网站排名优化