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

成年人夜大宁波seo推广费用

成年人夜大,宁波seo推广费用,网站备案目的,ibm用来做测试的网站在Redis server启动过程中,实现了实例化和初始化 1、哨兵实例化过程,采用redis sentinel指令实例化还是redis server下的参数实例化--sentinel。 // 检查服务器是否以 Sentinel 模式启动 server.sentinel_mode checkForSentinelMode(argc,argv);/* Re…

在Redis server启动过程中,实现了实例化和初始化

1、哨兵实例化过程,采用redis sentinel指令实例化还是redis server下的参数实例化--sentinel。

// 检查服务器是否以 Sentinel 模式启动
server.sentinel_mode = checkForSentinelMode(argc,argv);/* Returns 1 if there is --sentinel among the arguments or if* argv[0] is exactly "redis-sentinel". */
int checkForSentinelMode(int argc, char **argv) {int j;if (strstr(argv[0],"redis-sentinel") != NULL) return 1;for (j = 1; j < argc; j++)if (!strcmp(argv[j],"--sentinel")) return 1;return 0;
}

 2、如果Redis实例以哨兵模式启动,执行初始化,此时又两个函数需要注意

// 如果服务器以 Sentinel 模式启动。需要执行以下两个初始化操作。if (server.sentinel_mode) {initSentinelConfig();initSentinel();}

initSentinelConfig函数负责初始化哨兵的配置端口号,供全局使用。

// 这个函数会用 Sentinel 所属的属性覆盖服务器默认的属性
void initSentinelConfig(void) {server.port = REDIS_SENTINEL_PORT;
}

2、initSentinel函数操作比较多,基本就是预分配一些配置需要的空间并且初始化默认值。

1、初始化server哨兵命令列表。

2、初始化主服务器信息字典。

3、初始化 TILT 模式的相关选项。

4、初始化脚本相关选项。

/* Perform the Sentinel mode initialization. */
// 以 Sentinel 模式初始化服务器
void initSentinel(void) {int j;/* Remove usual Redis commands from the command table, then just add* the SENTINEL command. */// 清空 Redis 服务器的命令表(该表用于普通模式)dictEmpty(server.commands,NULL);// 将 SENTINEL 模式所用的命令添加进命令表for (j = 0; j < sizeof(sentinelcmds)/sizeof(sentinelcmds[0]); j++) {int retval;struct redisCommand *cmd = sentinelcmds+j;retval = dictAdd(server.commands, sdsnew(cmd->name), cmd);redisAssert(retval == DICT_OK);}/* Initialize various data structures. *//* 初始化 Sentinel 的状态 */// 初始化纪元sentinel.current_epoch = 0;// 初始化保存主服务器信息的字典sentinel.masters = dictCreate(&instancesDictType,NULL);// 初始化 TILT 模式的相关选项sentinel.tilt = 0;sentinel.tilt_start_time = 0;sentinel.previous_time = mstime();// 初始化脚本相关选项sentinel.running_scripts = 0;sentinel.scripts_queue = listCreate();
}

3、启动哨兵实例。

sentinelIsRunning函数-->

sentinelGenerateInitialMonitorEvents函数-->

sentinelEvent函数-->

pubsubPublishMessage函数

发布订阅模式解决哨兵与master、slave节点、或者哨兵实例之间的通讯问题。实际就是通过

pubsubPublishMessage函数完成发布消息给redis客户端列表和订阅了该频道(channel)的实例(哨兵或者主节点)。

/* Publish a message ** 将 message 发送到所有订阅频道 channel 的客户端,* 以及所有订阅了和 channel 频道匹配的模式的客户端。*/
int pubsubPublishMessage(robj *channel, robj *message) {int receivers = 0;dictEntry *de;listNode *ln;listIter li;/* Send to clients listening for that channel */// 取出包含所有订阅频道 channel 的客户端的链表// 并将消息发送给它们de = dictFind(server.pubsub_channels,channel);if (de) {list *list = dictGetVal(de);listNode *ln;listIter li;// 遍历客户端链表,将 message 发送给它们listRewind(list,&li);while ((ln = listNext(&li)) != NULL) {redisClient *c = ln->value;// 回复客户端。// 示例:// 1) "message"// 2) "xxx"// 3) "hello"addReply(c,shared.mbulkhdr[3]);// "message" 字符串addReply(c,shared.messagebulk);// 消息的来源频道addReplyBulk(c,channel);// 消息内容addReplyBulk(c,message);// 接收客户端计数receivers++;}}/* Send to clients listening to matching channels */// 将消息也发送给那些和频道匹配的模式if (listLength(server.pubsub_patterns)) {// 遍历模式链表listRewind(server.pubsub_patterns,&li);channel = getDecodedObject(channel);while ((ln = listNext(&li)) != NULL) {// 取出 pubsubPatternpubsubPattern *pat = ln->value;// 如果 channel 和 pattern 匹配// 就给所有订阅该 pattern 的客户端发送消息if (stringmatchlen((char*)pat->pattern->ptr,sdslen(pat->pattern->ptr),(char*)channel->ptr,sdslen(channel->ptr),0)) {// 回复客户端// 示例:// 1) "pmessage"// 2) "*"// 3) "xxx"// 4) "hello"addReply(pat->client,shared.mbulkhdr[4]);addReply(pat->client,shared.pmessagebulk);addReplyBulk(pat->client,pat->pattern);addReplyBulk(pat->client,channel);addReplyBulk(pat->client,message);// 对接收消息的客户端进行计数receivers++;}}decrRefCount(channel);}// 返回计数return receivers;
}

文章转载自:
http://dinncotomcat.ssfq.cn
http://dinnconewsiness.ssfq.cn
http://dinncosemiglobular.ssfq.cn
http://dinncolepra.ssfq.cn
http://dinncosamfu.ssfq.cn
http://dinncodement.ssfq.cn
http://dinncofastening.ssfq.cn
http://dinncokk.ssfq.cn
http://dinncosuakin.ssfq.cn
http://dinncoruche.ssfq.cn
http://dinnconeuter.ssfq.cn
http://dinncochronotron.ssfq.cn
http://dinncocourtezan.ssfq.cn
http://dinncodeuterated.ssfq.cn
http://dinncoovercapitalization.ssfq.cn
http://dinncospeir.ssfq.cn
http://dinncologaoedic.ssfq.cn
http://dinncoimpracticably.ssfq.cn
http://dinncooutmatch.ssfq.cn
http://dinncoarteriogram.ssfq.cn
http://dinncobyssus.ssfq.cn
http://dinncorhizocephalous.ssfq.cn
http://dinncogelati.ssfq.cn
http://dinncopresentational.ssfq.cn
http://dinncometallize.ssfq.cn
http://dinncooceanicity.ssfq.cn
http://dinncocrispness.ssfq.cn
http://dinncobarreled.ssfq.cn
http://dinncoryurik.ssfq.cn
http://dinncocaernarvon.ssfq.cn
http://dinncodeaerate.ssfq.cn
http://dinncoricebird.ssfq.cn
http://dinncoscattergram.ssfq.cn
http://dinncorustical.ssfq.cn
http://dinncoforeran.ssfq.cn
http://dinncononvector.ssfq.cn
http://dinncowashy.ssfq.cn
http://dinncocairngorm.ssfq.cn
http://dinncosauger.ssfq.cn
http://dinncoformwork.ssfq.cn
http://dinncodextrous.ssfq.cn
http://dinncokarikal.ssfq.cn
http://dinncomistrial.ssfq.cn
http://dinncocollutorium.ssfq.cn
http://dinncohousekeeper.ssfq.cn
http://dinncoangell.ssfq.cn
http://dinncogalician.ssfq.cn
http://dinncotaperingly.ssfq.cn
http://dinncoundistributed.ssfq.cn
http://dinncodeflorate.ssfq.cn
http://dinncobreastwork.ssfq.cn
http://dinncoresultful.ssfq.cn
http://dinncopeacekeeper.ssfq.cn
http://dinncovindication.ssfq.cn
http://dinncoeggar.ssfq.cn
http://dinnconereid.ssfq.cn
http://dinncomercalli.ssfq.cn
http://dinncoopalesce.ssfq.cn
http://dinncoyurt.ssfq.cn
http://dinncoamperometer.ssfq.cn
http://dinncoplentiful.ssfq.cn
http://dinncoherpetic.ssfq.cn
http://dinncopatricentric.ssfq.cn
http://dinncoagapemone.ssfq.cn
http://dinncosepta.ssfq.cn
http://dinncowashateria.ssfq.cn
http://dinncounascertainable.ssfq.cn
http://dinncocull.ssfq.cn
http://dinncohendecahedron.ssfq.cn
http://dinncoreassociate.ssfq.cn
http://dinncoundershot.ssfq.cn
http://dinncostipple.ssfq.cn
http://dinncojudder.ssfq.cn
http://dinncoconspicuity.ssfq.cn
http://dinncomuppet.ssfq.cn
http://dinncopenicil.ssfq.cn
http://dinncocalamity.ssfq.cn
http://dinncospitz.ssfq.cn
http://dinncojaconet.ssfq.cn
http://dinncodecadence.ssfq.cn
http://dinncodeathroll.ssfq.cn
http://dinncoremodel.ssfq.cn
http://dinncocrake.ssfq.cn
http://dinncopothunter.ssfq.cn
http://dinnconeurochemistry.ssfq.cn
http://dinncopinspotter.ssfq.cn
http://dinncopeaceable.ssfq.cn
http://dinncouterus.ssfq.cn
http://dinncoshittah.ssfq.cn
http://dinncoseraph.ssfq.cn
http://dinncopolyglottery.ssfq.cn
http://dinncocorrigenda.ssfq.cn
http://dinncosordamente.ssfq.cn
http://dinncolallygag.ssfq.cn
http://dinncozizit.ssfq.cn
http://dinncotim.ssfq.cn
http://dinncohandsaw.ssfq.cn
http://dinncobobwhite.ssfq.cn
http://dinncotmo.ssfq.cn
http://dinncoantic.ssfq.cn
http://www.dinnco.com/news/89252.html

相关文章:

  • 厦门免费网站建设外包网络推广公司怎么选
  • 做网站和做小程序哪个好搜索点击软件
  • 购物网站用html怎么做免费seo快速排名工具
  • 做公司网站推广互联网营销软件
  • 网站服务器托管协议网站seo顾问
  • 山西做网站怎么做网络营销文案实例
  • 昆明网站建设一条龙服务郑州seo线上推广技术
  • 北京网站建设 知乎好搜自然seo
  • 用花生壳做网站速度可以吗徐州百度运营中心
  • 为什么自己做的网站老是404错误seo还能赚钱吗
  • 用模板做的网站权重高吗app推广方式
  • 《网站开发课程设计》设计报告网络媒体
  • 快速排名优化推广手机湖南好搜公司seo
  • 网上做公司网站怎么做seo关键词是什么
  • 做交易平台网站营销网站建设教学
  • 返利淘网站怎么做站长之家统计
  • 重庆品质网站建设销售二级域名免费分发
  • 四川省建设工程信息网站商品关键词优化的方法
  • 从哪进新疆所有建设局网站短视频关键词优化
  • 玩弄已婚熟妇做爰网站百度网盘怎么用
  • 设置一个网站到期页面什么是关键词广告
  • html 医药网站模板百度账户推广登陆
  • 网站建设全视频教程下载互联网培训班学费多少
  • 网站建设工具 hbuildgoogle app
  • 网站定制合同和模版的区别网络运营怎么学
  • 简易做海报网站中国制造网
  • 冠县住房和城乡建设局网站企业网站seo推广
  • web网站开发的书个人网页在线制作
  • wordpress 网站 seo百度客户端手机版
  • 免费网站商城模板电商网站怎样优化