会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
雪域蓝心
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
···
11
下一页
2020年12月1日
redis sentinel 集群
摘要: 参照课程:https://www.bilibili.com/video/BV1VJ411B7Kr?p=4 redis sentinel 集群【哨兵 主从复制集群】 * 哨兵要做的事情: . 将宕机的master下线 . 找slave作为master . 通知所有的slave来连接新的master .
阅读全文
posted @ 2020-12-01 14:57 雪域蓝心
阅读(142)
评论(0)
推荐(0)
2020年11月30日
redis cluster 集群
摘要: cluster 集群【高可用集群,分区、扩容集群】不需要ruby,需要使用5.0以上版本 C/C++连接时,需要使用 使用了crc16.c文件中的uint16_t crc16(const char *buf, int len)函数。 https://blog.csdn.net/sxy_qjj/art
阅读全文
posted @ 2020-11-30 16:59 雪域蓝心
阅读(110)
评论(0)
推荐(0)
linux sed 命令
摘要: 修改redis配置文件: sed -i 's/7000/70001/g' redis7000/redis.conf > redis7001/redis.conf
阅读全文
posted @ 2020-11-30 12:53 雪域蓝心
阅读(58)
评论(0)
推荐(0)
redis 作为缓存 问题
摘要: https://www.bilibili.com/video/BV1xf4y1278g?p=1https://blog.csdn.net/qq_36324113/article/details/90727355 *缓存雪崩:【原因】1. 热点数据有时效性,设定有效期,redis自动清空,假如热点tt
阅读全文
posted @ 2020-11-30 11:18 雪域蓝心
阅读(101)
评论(0)
推荐(0)
2020年11月27日
平滑的加权轮询算法
摘要: 代码: #include <cstdio>int main(){ // 初始权重 int a_ini[3] = {4, 2, 1}; int a[3] = {4,2,1}; // 动态变化权重 int a1[3] = {1,1,1}; // 总权重 int nAllWeight = a[1] + a
阅读全文
posted @ 2020-11-27 17:54 雪域蓝心
阅读(190)
评论(0)
推荐(0)
小顶堆排序
摘要: /* 建堆的时间复杂度 STL中的优先队列下标为i的节点的父节点的下标为 (i-1)/2下标为j的节点的左子节点的下标为 j*2 + 1下标为j的节点的右子节点的下标为 j*2 + 2 大顶堆:arr[i] >= arr[2i+1] && arr[i] >= arr[2i+2]小顶堆:arr[i]
阅读全文
posted @ 2020-11-27 16:39 雪域蓝心
阅读(153)
评论(0)
推荐(0)
2020年11月26日
一致性哈希算法
摘要: 代码如下: #include <ctime>#include <string>#include <map>#include <random>#include <iostream>#include <cmath>using namespace std; // 机器ipconst vector<stri
阅读全文
posted @ 2020-11-26 11:58 雪域蓝心
阅读(122)
评论(0)
推荐(0)
2020年11月25日
互斥锁 条件变量 信号量 读写锁 自旋锁
摘要: 互斥锁: 资源只能一个线程用 // 初始化一个互斥锁。 int pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr); // 对互斥锁上锁,若互斥锁已经上锁,则调用者一直阻塞,直到互斥锁解锁后再上锁。
阅读全文
posted @ 2020-11-25 12:11 雪域蓝心
阅读(278)
评论(0)
推荐(0)
随机数生成器
摘要: int _tmain(int /*argc*/, _TCHAR* /*argv[]*/) { struct __timeb64 ftime_timeb; _ftime64_s(&(ftime_timeb)); //time_t time_tmp = ftime_timeb.time; int i_t
阅读全文
posted @ 2020-11-25 11:27 雪域蓝心
阅读(81)
评论(0)
推荐(0)
2020年11月17日
epoll 原理
摘要: epoll_wait的工作流程:转:https://blog.csdn.net/eyucham/article/details/86502117 epoll_wait调用ep_poll,当rdlist为空(无就绪fd)时挂起当前进程,直到rdlist不空时进程才被唤醒。 文件fd状态改变(buffe
阅读全文
posted @ 2020-11-17 15:29 雪域蓝心
阅读(354)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
···
11
下一页
公告