Redis哨兵集群搭建
一、安装Redis
1.安装依赖
yum install -y gcc tcl
2.将Redis压缩包解压到对应的目录
tar -zxvf redis-2.8.0.tar.gz
mv redis-2.8.0 /usr/local
3.编译
cd /usr/local/redis-2.8.0
make && make install
4.配置redis.conf
# 任意ip都可以访问
bind 0.0.0.0
# 关闭保护模式
# protected-mode no
# 让 Redis 服务器以守护进程的方式在后台持续运行
daemonize yes
# 日志文件(要手动创建这个文件)
logfile /usr/local/redis-2.8.0/log/redis.log
save 900 1
save 300 10
save 60 1000
# 启用 Redis 在执行 RDB 持久化操作时对生成的 RDB 文件进行压缩,以节省磁盘空间
rdbcompression yes
关闭防火墙:systemctl disable firewalld.service
5.启动
[root@localhost local]# cd redis-2.8.0/src
[root@localhost src]# ./redis-server ../redis.conf
[root@localhost src]# ps aux | grep redis
root 10190 0.0 0.3 140912 7384 ? Ssl 13:38 0:00 ./redis-server 0.0.0.0:6379
root 10194 0.0 0.0 112812 972 pts/0 S+ 13:38 0:00 grep --color=auto redis
这里我的redis版本很低,因为项目太老了,支持不了高版本
二、配置
准备6台机器,都安装上Redis,一台作为主节点,两台作为从节点,三台作为哨兵节点。
ip信息:
- 主节点ip:192.168.108.100
- 从节点1:192.168.108.101
- 从节点2:192.168.108.102
- 哨兵节点1:192.168.108.131
- 哨兵节点2:192.168.108.132
- 哨兵节点3:192.168.108.133
1.主从配置
只需要在从节点配置上slaveof <masterip> <masterport>
主节点redis.conf:
daemonize yes
logfile /usr/local/redis-2.8.0/log/redis.log
save 900 1
save 300 10
save 60 1000
rdbcompression yes
bind 0.0.0.0
#protected-mode no
注意:日志文件要创建好
两个从节点redis.conf:
daemonize yes
logfile "/usr/local/redis-2.8.0/log/redis.log"
save 900 1
save 300 10
save 60 1000
rdbcompression yes
bind 0.0.0.0
#protected-mode no
slaveof 192.168.108.100 6379
# Generated by CONFIG REWRITE
dir "/usr/local/redis-2.8.0/src"
启动:进入src目录执行:./redis-server ../redis.conf
测试:主节点中设置的值,可以在两个从节点中get到
只有master节点上可以执行写操作,两个slave节点只能执行读操作。
2.哨兵配置
3个哨兵节点的配置文件:
# sentinel实例的端口
port 26379
# 指定监控的主节点信息 2:选举master时的quorum值
sentinel monitor mymaster 192.168.108.102 6379 2
sentinel down-after-milliseconds mymaster 5000
sentinel failover-timeout mymaster 60000
# Generated by CONFIG REWRITE
dir "/usr/local/redis-2.8.0/src"
启动哨兵:进入src目录执行:./redis-sentinel ../sentinel.conf
3.测试
把主节点192.168.108.100宕机,查看sentinel日志:
[root@localhost src]# ./redis-sentinel ../sentinel.conf
[1601] 24 Jun 21:02:07.829 * Max number of open files set to 10032_._ _.-``__ ''-._ _.-`` `. `_. ''-._ Redis 2.8.0 (00000000/0) 64 bit.-`` .-```. ```\/ _.,_ ''-._ ( ' , .-` | `, ) Running in sentinel mode|`-._`-...-` __...-.``-._|'` _.-'| Port: 26379| `-._ `._ / _.-' | PID: 1601`-._ `-._ `-./ _.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | http://redis.io `-._ `-._`-.__.-'_.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | `-._ `-._`-.__.-'_.-' _.-' `-._ `-.__.-' _.-' `-._ _.-' `-.__.-' [1601] 24 Jun 21:02:07.831 # Sentinel runid is c0d04f13c185a97c901f368348afe3f14d810885
[1601] 24 Jun 21:02:07.832 * +slave slave 192.168.108.101:6379 192.168.108.101 6379 @ mymaster 192.168.108.100 6379
[1601] 24 Jun 21:02:07.832 * +slave slave 192.168.108.102:6379 192.168.108.102 6379 @ mymaster 192.168.108.100 6379
[1601] 24 Jun 21:02:27.681 * +sentinel sentinel 192.168.108.132:26379 192.168.108.132 26379 @ mymaster 192.168.108.100 6379
[1601] 24 Jun 21:02:34.217 * +sentinel sentinel 192.168.108.133:26379 192.168.108.133 26379 @ mymaster 192.168.108.100 6379
[1601] 24 Jun 21:02:39.258 # +sdown sentinel 192.168.108.133:26379 192.168.108.133 26379 @ mymaster 192.168.108.100 6379
[1601] 24 Jun 21:05:49.959 # +sdown master mymaster 192.168.108.100 6379 // 主观认为100下线
[1601] 24 Jun 21:05:50.059 # +odown master mymaster 192.168.108.100 6379 #quorum 2/2 //quorum达标,客观认为100下线。
[1601] 24 Jun 21:05:50.059 # +new-epoch 1
[1601] 24 Jun 21:05:50.059 # +try-failover master mymaster 192.168.108.100 6379 //尝试等待100
[1601] 24 Jun 21:05:50.059 # +vote-for-leader c0d04f13c185a97c901f368348afe3f14d810885 1 //sentinel内部选举一个Leader,选中的sentinel实例去执行故障转移
[1601] 24 Jun 21:05:50.160 # +elected-leader master mymaster 192.168.108.100 6379
[1601] 24 Jun 21:05:50.160 # +failover-state-select-slave master mymaster 192.168.108.100 6379 //准备选举一个slave作为新的leader
[1601] 24 Jun 21:05:50.260 # +selected-slave slave 192.168.108.102:6379 192.168.108.102 6379 @ mymaster 192.168.108.100 6379 //选中了102这个实例
[1601] 24 Jun 21:05:50.260 * +failover-state-send-slaveof-noone slave 192.168.108.102:6379 192.168.108.102 6379 @ mymaster 192.168.108.100 6379 //让102执行slaveof noone,成为新的master
[1601] 24 Jun 21:05:50.361 * +failover-state-wait-promotion slave 192.168.108.102:6379 192.168.108.102 6379 @ mymaster 192.168.108.100 6379 //102等待提升(让其他slave执行 slaveof 192.168.108.102 6379)
[1601] 24 Jun 21:05:51.067 # +promoted-slave slave 192.168.108.102:6379 192.168.108.102 6379 @ mymaster 192.168.108.100 6379 //102正式成为master
[1601] 24 Jun 21:05:51.067 # +failover-state-reconf-slaves master mymaster 192.168.108.100 6379 //修改下线的100实例配置,让他标记为102的slave
[1601] 24 Jun 21:05:51.166 * +slave-reconf-sent slave 192.168.108.101:6379 192.168.108.101 6379 @ mymaster 192.168.108.100 6379 //修改101实例的配置,标记他为102的slave
[1601] 24 Jun 21:05:52.075 * +slave-reconf-inprog slave 192.168.108.101:6379 192.168.108.101 6379 @ mymaster 192.168.108.100 6379 //修改101实例的配置,标记他为102的slave
[1601] 24 Jun 21:05:52.075 * +slave-reconf-done slave 192.168.108.101:6379 192.168.108.101 6379 @ mymaster 192.168.108.100 6379
[1601] 24 Jun 21:05:52.175 # +failover-end master mymaster 192.168.108.100 6379
[1601] 24 Jun 21:05:52.175 # +switch-master mymaster 192.168.108.100 6379 192.168.108.102 6379 //主从切换完成
[1601] 24 Jun 21:05:52.176 * +slave slave 192.168.108.101:6379 192.168.108.101 6379 @ mymaster 192.168.108.102 6379
[1601] 24 Jun 21:05:52.177 * +slave slave 192.168.108.100:6379 192.168.108.100 6379 @ mymaster 192.168.108.102 6379
[1601] 24 Jun 21:05:57.217 # +sdown slave 192.168.108.100:6379 192.168.108.100 6379 @ mymaster 192.168.108.102 6379
[1601] 24 Jun 21:07:50.268 # +new-epoch 2
[1601] 24 Jun 21:07:52.489 # +switch-master mymaster 192.168.108.102 6379 192.168.108.102 6379
[1601] 24 Jun 21:07:52.489 * +slave slave 192.168.108.100:6379 192.168.108.100 6379 @ mymaster 192.168.108.102 6379
[1601] 24 Jun 21:07:52.494 * +slave slave 192.168.108.101:6379 192.168.108.101 6379 @ mymaster 192.168.108.102 6379
[1601] 24 Jun 21:07:57.501 # +sdown slave 192.168.108.100:6379 192.168.108.100 6379 @ mymaster 192.168.108.102 6379
节点192.168.108.101日志:
[16135] 24 Jun 20:58:52.603 * Max number of open files set to 10032_._ _.-``__ ''-._ _.-`` `. `_. ''-._ Redis 2.8.0 (00000000/0) 64 bit.-`` .-```. ```\/ _.,_ ''-._ ( ' , .-` | `, ) Running in stand alone mode|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379| `-._ `._ / _.-' | PID: 16135`-._ `-._ `-./ _.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | http://redis.io `-._ `-._`-.__.-'_.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | `-._ `-._`-.__.-'_.-' _.-' `-._ `-.__.-' _.-' `-._ _.-' `-.__.-' [16135] 24 Jun 20:58:52.604 # Server started, Redis version 2.8.0
[16135] 24 Jun 20:58:52.604 * The server is now ready to accept connections on port 6379
[16135] 24 Jun 20:58:52.604 * Connecting to MASTER 192.168.108.100:6379
[16135] 24 Jun 20:58:52.604 * MASTER <-> SLAVE sync started
[16135] 24 Jun 20:58:52.604 * Non blocking connect for SYNC fired the event.
[16135] 24 Jun 20:58:52.605 * Master replied to PING, replication can continue...
[16135] 24 Jun 20:58:52.605 * Partial resynchronization not possible (no cached master)
[16135] 24 Jun 20:58:52.605 * Full resync from master: 853ec52724c940634dc70d96225ac014be295683:15
[16135] 24 Jun 20:58:52.667 * MASTER <-> SLAVE sync: receiving 25 bytes from master
[16135] 24 Jun 20:58:52.668 * MASTER <-> SLAVE sync: Loading DB in memory
[16135] 24 Jun 20:58:52.668 * MASTER <-> SLAVE sync: Finished with success
[16135] 24 Jun 21:05:44.922 * Caching the disconnected master state.
[16135] 24 Jun 21:05:45.327 * Connecting to MASTER 192.168.108.100:6379
[16135] 24 Jun 21:05:45.327 * MASTER <-> SLAVE sync started
[16135] 24 Jun 21:05:45.328 # Error condition on socket for SYNC: Connection refused
[16135] 24 Jun 21:05:46.331 * Connecting to MASTER 192.168.108.100:6379
[16135] 24 Jun 21:05:46.331 * MASTER <-> SLAVE sync started
[16135] 24 Jun 21:05:46.331 # Error condition on socket for SYNC: Connection refused
[16135] 24 Jun 21:05:47.336 * Connecting to MASTER 192.168.108.100:6379
[16135] 24 Jun 21:05:47.336 * MASTER <-> SLAVE sync started
[16135] 24 Jun 21:05:47.336 # Error condition on socket for SYNC: Connection refused
[16135] 24 Jun 21:05:48.340 * Connecting to MASTER 192.168.108.100:6379
[16135] 24 Jun 21:05:48.340 * MASTER <-> SLAVE sync started
[16135] 24 Jun 21:05:48.340 # Error condition on socket for SYNC: Connection refused
[16135] 24 Jun 21:05:49.344 * Connecting to MASTER 192.168.108.100:6379
[16135] 24 Jun 21:05:49.344 * MASTER <-> SLAVE sync started
[16135] 24 Jun 21:05:49.344 # Error condition on socket for SYNC: Connection refused
[16135] 24 Jun 21:05:49.940 * Discarding previously cached master state.
[16135] 24 Jun 21:05:49.940 * MASTER MODE enabled (user request) //升级为主节点
[16135] 24 Jun 21:05:50.807 * Slave asks for synchronization
[16135] 24 Jun 21:05:50.807 * Full resync requested by slave.
[16135] 24 Jun 21:05:50.807 * Starting BGSAVE for SYNC
[16135] 24 Jun 21:05:50.807 * Background saving started by pid 18604
[18604] 24 Jun 21:05:50.813 * DB saved on disk
[18604] 24 Jun 21:05:50.814 * RDB: 4 MB of memory used by copy-on-write
[16135] 24 Jun 21:05:50.845 * Background saving terminated with success
[16135] 24 Jun 21:05:50.845 * Synchronization with slave succeeded
节点192.168.108.102日志:
[59973] 20 Jun 23:14:33.857 * MASTER <-> SLAVE sync started
...skipping...( ' , .-` | `, ) Running in stand alone mode|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379| `-._ `._ / _.-' | PID: 14218`-._ `-._ `-./ _.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | http://redis.io `-._ `-._`-.__.-'_.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | `-._ `-._`-.__.-'_.-' _.-' `-._ `-.__.-' _.-' `-._ _.-' `-.__.-' [14218] 24 Jun 20:58:45.993 # Server started, Redis version 2.8.0
[14218] 24 Jun 20:58:45.993 * DB loaded from disk: 0.000 seconds
[14218] 24 Jun 20:58:45.993 * The server is now ready to accept connections on port 6379
[14218] 24 Jun 20:58:45.993 * Connecting to MASTER 192.168.108.100:6379
[14218] 24 Jun 20:58:45.993 * MASTER <-> SLAVE sync started
[14218] 24 Jun 20:58:45.994 * Non blocking connect for SYNC fired the event.
[14218] 24 Jun 20:58:45.994 * Master replied to PING, replication can continue...
[14218] 24 Jun 20:58:45.995 * Partial resynchronization not possible (no cached master)
[14218] 24 Jun 20:58:45.995 * Full resync from master: 853ec52724c940634dc70d96225ac014be295683:1
[14218] 24 Jun 20:58:46.035 * MASTER <-> SLAVE sync: receiving 25 bytes from master
[14218] 24 Jun 20:58:46.035 * MASTER <-> SLAVE sync: Loading DB in memory
[14218] 24 Jun 20:58:46.035 * MASTER <-> SLAVE sync: Finished with success
[14218] 24 Jun 21:05:44.917 * Caching the disconnected master state.
[14218] 24 Jun 21:05:45.778 * Connecting to MASTER 192.168.108.100:6379 // 100是主
[14218] 24 Jun 21:05:45.778 * MASTER <-> SLAVE sync started
[14218] 24 Jun 21:05:45.778 # Error condition on socket for SYNC: Connection refused
[14218] 24 Jun 21:05:46.784 * Connecting to MASTER 192.168.108.100:6379
[14218] 24 Jun 21:05:46.784 * MASTER <-> SLAVE sync started
[14218] 24 Jun 21:05:46.784 # Error condition on socket for SYNC: Connection refused
[14218] 24 Jun 21:05:47.790 * Connecting to MASTER 192.168.108.100:6379
[14218] 24 Jun 21:05:47.790 * MASTER <-> SLAVE sync started
[14218] 24 Jun 21:05:47.790 # Error condition on socket for SYNC: Connection refused
[14218] 24 Jun 21:05:48.794 * Connecting to MASTER 192.168.108.100:6379
[14218] 24 Jun 21:05:48.794 * MASTER <-> SLAVE sync started
[14218] 24 Jun 21:05:48.795 # Error condition on socket for SYNC: Connection refused
[14218] 24 Jun 21:05:49.796 * Connecting to MASTER 192.168.108.100:6379
[14218] 24 Jun 21:05:49.796 * MASTER <-> SLAVE sync started
[14218] 24 Jun 21:05:49.797 # Error condition on socket for SYNC: Connection refused
[14218] 24 Jun 21:05:50.740 * Discarding previously cached master state.
[14218] 24 Jun 21:05:50.740 * SLAVE OF 192.168.108.102:6379 enabled (user request) //变为102的从
[14218] 24 Jun 21:05:50.800 * Connecting to MASTER 192.168.108.102:6379
[14218] 24 Jun 21:05:50.800 * MASTER <-> SLAVE sync started
[14218] 24 Jun 21:05:50.801 * Non blocking connect for SYNC fired the event.
[14218] 24 Jun 21:05:50.801 * Master replied to PING, replication can continue...
[14218] 24 Jun 21:05:50.802 * Partial resynchronization not possible (no cached master) // 重新执行psync
[14218] 24 Jun 21:05:50.802 * Full resync from master: a3c6cdb64c33f99b657037cc024f212e517bc316:1
[14218] 24 Jun 21:05:50.841 * MASTER <-> SLAVE sync: receiving 30 bytes from master
[14218] 24 Jun 21:05:50.841 * MASTER <-> SLAVE sync: Loading DB in memory
[14218] 24 Jun 21:05:50.841 * MASTER <-> SLAVE sync: Finished with success
[14218] 24 Jun 21:07:50.848 * SLAVE OF would result into synchronization with the master we are already connected with. No operation performed.
[14218] 24 Jun 21:13:46.056 * 1 changes in 900 seconds. Saving...
[14218] 24 Jun 21:13:46.056 * Background saving started by pid 19554
[19554] 24 Jun 21:13:46.061 * DB saved on disk
[19554] 24 Jun 21:13:46.062 * RDB: 6 MB of memory used by copy-on-write
[14218] 24 Jun 21:13:46.157 * Background saving terminated with success
相关文章:
Redis哨兵集群搭建
一、安装Redis 1.安装依赖 yum install -y gcc tcl2.将Redis压缩包解压到对应的目录 tar -zxvf redis-2.8.0.tar.gz mv redis-2.8.0 /usr/local3.编译 cd /usr/local/redis-2.8.0 make && make install4.配置redis.conf # 任意ip都可以访问 bind 0.0.0.0 # 关闭保…...
网络爬虫requests库使用指南
目录 引言 安装requests库 基本用法 发送GET请求 发送POST请求 处理请求头和Cookies 设置请求头 使用Cookies 会话管理 异常处理 流式上传和下载 结语 引言 在Python中进行HTTP请求时,requests库是一个强大且易于使用的第三方库。它允许你发送各种HTTP请…...
VSCODE 配置C++ 与OPENCV
主要是两个json设置 c_cpp_properties.json {"configurations": [{"name": "Win32","includePath": ["${workspaceFolder}/**"],"defines": ["_DEBUG","UNICODE","_UNICODE"],&qu…...
C语言小例程28/100
题目:利用递归方法求5!。 程序分析:递归公式:fnfn_1*4! #include <stdio.h>int main() {int i;int fact(int);for(i0;i<6;i){printf("%d!%d\n",i,fact(i));} } int fact(int j) {int sum;if(j0){sum1;} else {sumj*fac…...
WPF文本绑定显示格式StringFormat设置-特殊格式时间日期和多数据绑定
WPF文本绑定显示格式StringFormat设置 特殊格式设置日期/时间使用系统默认样式自定义格式: 绑定多个属性(多重绑定)多重绑定中的特殊字符示例: 特殊格式设置 在Textblock等文本控件中,我们经常要显示一些日期和时间&a…...
Java包介绍
今天看jdk文档,顺便写一下java几个包的作用。 java.applet 主要用于创建java applet小应用程序,可以嵌入到网页中能够呈现出特殊的效果,现在基本已经被废弃,很少使用。 java.awt AWT 是Abstract Window ToolKit (抽象窗口工具包…...
【2024.6.21】今日科技时事:科技前沿大事件
人不走空 🌈个人主页:人不走空 💖系列专栏:算法专题 ⏰诗词歌赋:斯是陋室,惟吾德馨 目录 🌈个人主页:人不走空 💖系列专栏:算法专题 ⏰诗词歌…...
LeetCode:经典题之1491、896 题解与延伸
系列目录 88.合并两个有序数组 52.螺旋数组 567.字符串的排列 643.子数组最大平均数 150.逆波兰表达式 61.旋转链表 160.相交链表 83.删除排序链表中的重复元素 389.找不同 1491.去掉最低工资和最高工资后的工资平均值 896.单调序列 206.反转链表 92.反转链表II 141.环形链表 …...
2024三掌柜赠书活动第二十五期:Rust 游戏开发实战
目录 目录 前言 Rust语言概念 关于《Rust 游戏开发实战》 Rust系统编程的核心点 Rust开发的关键技术和工具 内容简介 作者简介 书中前言/序言 内容介绍 《Rust 游戏开发实战》全书速览 图书目录 结束语 前言 技术圈最近的编程语言新秀当属Rust莫属,Rus…...
基于Java蛋糕甜品商城系统设计和实现(源码+LW+调试文档+讲解等)
💗博主介绍:✌全网粉丝10W,CSDN作者、博客专家、全栈领域优质创作者,博客之星、平台优质作者、专注于Java、小程序技术领域和毕业项目实战✌💗 🌟文末获取源码数据库🌟感兴趣的可以先收藏起来,还…...
Tomcat get请求传数组集合参数
前言 最近做项目,需要通过GET传参,来实现查询的能力,本来是RPC调用,直接参数序列化即可。但是服务最近修改为HTTP,本来Spring Cloud的feign也可以直接传参数,但是当使用Nginx访问时参数到底传啥呢…...
信息学奥赛初赛天天练-34-CSP-J2021完善程序-按位异或、模拟算法、数组模拟环、约瑟夫问题应用
PDF文档公众号回复关键字:20240624 2021 CSP-J 完善程序3 1 完善程序 (单选题 ,每小题3分,共30分) (Josephus问题)有n个人围成一个圈,依次标号0至n-1。从0号开始,依次 0,1,0&#…...
【计算机视觉】人脸算法之图像处理基础知识(六)
图像直方图 图像直方图是描述图像中像素强度分布的一种统计图表,它是图像处理和计算机视觉领域中一个非常基础且重要的概念。图像直方图通常用于分析图像的亮度、对比度特性,以及在图像增强、阈值分割、特征提取等多种图像处理任务。 import cv2 impor…...
仓颉编程语言入门
华为在 2024 年 6 月 21 日的华为开发者大会上,华为终端 BG 软件部总裁龚体正式官宣了华为自研仓颉编程语言,并发布了 HarmonyOS NEXT 仓颉语言开发者预览版。 仓颉编程语言文件后缀名为 .cj, 以下是第一个入门代码输出:你好,仓颉…...
在前端项目中,如何处理错误和异常?
在前端项目中,如何处理错误和异常? 在前端项目中,处理错误和异常是至关重要的,它能确保应用程序的稳定性和用户体验。以下是一些常见的方法: try-catch-finally结构:使用JavaScript的try/catch块来捕获并…...
Ubuntu系统下修改网卡IP地址
Ubuntu系统下修改网卡IP地址 一、Ubuntu系统介绍1.1 Ubuntu简介1.2 Ubuntu网络配置方式 二、本地环境介绍2.1 本地环境规划2.2 本次实践介绍 三、检查本地环境3.1 检查本地操作系统版本3.2 检查系统内核版本 四、配置网卡IP地址4.1 备份网卡配置文件4.2 查看当前IP地址4.3 修改…...
Scrapy如何对爬虫数据进行清洗和处理?
爬虫数据处理是数据采集应用中至关重要的一步。scrapy是一种流行的python爬虫框架,可以帮助我们快速高效地从网页中提取所需信息。但是,我们经常面临的一个问题是数据的质量低劣,存在各种噪声和错误,这使得它们难以用于后续分析和…...
Linux:基础IO(三.软硬链接、动态库和静态库、动精态库的制作和加载)
上次介绍了基础IO(二):Linux:基础IO(二.缓冲区、模拟一下缓冲区、详细讲解文件系统) 文章目录 1.软硬链接1.1硬链接1.2软链接使用场景 2.动态库和静态库1.1回顾1.2静态库的制作和使用为什么要有库制作者角度…...
低价可转债崩盘,发生了什么?
下跌不在于“出库”,甚至不在于“风险”。问题更多在于交易层面,何时能积聚更多的左侧资金并成功过渡至右侧。 低价券怎么了? 如果说6月初主要是小微盘品种的退市风险,后来是一些评级下调的品种,到本周,已…...
【面试题】马上金九银十了,简历该准备起来了,面试题你准备好了吗 ?浅谈 JS 浅拷贝和深拷贝
代码展示 let obj_old {name: Tom,age: 15,favorite: {food: bread,drink: milk} } let obj_new {...obj_old} console.log(obj_old obj_new) // false console.log(obj_old.name obj_new.name) // true console.log(obj_old.favorite obj_new.favorite) // true3. Ar…...
设计模式和设计原则回顾
设计模式和设计原则回顾 23种设计模式是设计原则的完美体现,设计原则设计原则是设计模式的理论基石, 设计模式 在经典的设计模式分类中(如《设计模式:可复用面向对象软件的基础》一书中),总共有23种设计模式,分为三大类: 一、创建型模式(5种) 1. 单例模式(Sing…...
云计算——弹性云计算器(ECS)
弹性云服务器:ECS 概述 云计算重构了ICT系统,云计算平台厂商推出使得厂家能够主要关注应用管理而非平台管理的云平台,包含如下主要概念。 ECS(Elastic Cloud Server):即弹性云服务器,是云计算…...
Java 语言特性(面试系列1)
一、面向对象编程 1. 封装(Encapsulation) 定义:将数据(属性)和操作数据的方法绑定在一起,通过访问控制符(private、protected、public)隐藏内部实现细节。示例: public …...
VB.net复制Ntag213卡写入UID
本示例使用的发卡器:https://item.taobao.com/item.htm?ftt&id615391857885 一、读取旧Ntag卡的UID和数据 Private Sub Button15_Click(sender As Object, e As EventArgs) Handles Button15.Click轻松读卡技术支持:网站:Dim i, j As IntegerDim cardidhex, …...
从零实现富文本编辑器#5-编辑器选区模型的状态结构表达
先前我们总结了浏览器选区模型的交互策略,并且实现了基本的选区操作,还调研了自绘选区的实现。那么相对的,我们还需要设计编辑器的选区表达,也可以称为模型选区。编辑器中应用变更时的操作范围,就是以模型选区为基准来…...
vscode(仍待补充)
写于2025 6.9 主包将加入vscode这个更权威的圈子 vscode的基本使用 侧边栏 vscode还能连接ssh? debug时使用的launch文件 1.task.json {"tasks": [{"type": "cppbuild","label": "C/C: gcc.exe 生成活动文件"…...
《用户共鸣指数(E)驱动品牌大模型种草:如何抢占大模型搜索结果情感高地》
在注意力分散、内容高度同质化的时代,情感连接已成为品牌破圈的关键通道。我们在服务大量品牌客户的过程中发现,消费者对内容的“有感”程度,正日益成为影响品牌传播效率与转化率的核心变量。在生成式AI驱动的内容生成与推荐环境中࿰…...
五年级数学知识边界总结思考-下册
目录 一、背景二、过程1.观察物体小学五年级下册“观察物体”知识点详解:由来、作用与意义**一、知识点核心内容****二、知识点的由来:从生活实践到数学抽象****三、知识的作用:解决实际问题的工具****四、学习的意义:培养核心素养…...
Mac软件卸载指南,简单易懂!
刚和Adobe分手,它却总在Library里给你写"回忆录"?卸载的Final Cut Pro像电子幽灵般阴魂不散?总是会有残留文件,别慌!这份Mac软件卸载指南,将用最硬核的方式教你"数字分手术"࿰…...
Caliper 配置文件解析:config.yaml
Caliper 是一个区块链性能基准测试工具,用于评估不同区块链平台的性能。下面我将详细解释你提供的 fisco-bcos.json 文件结构,并说明它与 config.yaml 文件的关系。 fisco-bcos.json 文件解析 这个文件是针对 FISCO-BCOS 区块链网络的 Caliper 配置文件,主要包含以下几个部…...
