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

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请求时&#xff0c;requests库是一个强大且易于使用的第三方库。它允许你发送各种HTTP请…...

VSCODE 配置C++ 与OPENCV

主要是两个json设置 c_cpp_properties.json {"configurations": [{"name": "Win32","includePath": ["${workspaceFolder}/**"],"defines": ["_DEBUG","UNICODE","_UNICODE"],&qu…...

C语言小例程28/100

题目&#xff1a;利用递归方法求5!。 程序分析&#xff1a;递归公式&#xff1a;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设置 特殊格式设置日期/时间使用系统默认样式自定义格式&#xff1a; 绑定多个属性&#xff08;多重绑定&#xff09;多重绑定中的特殊字符示例&#xff1a; 特殊格式设置 在Textblock等文本控件中&#xff0c;我们经常要显示一些日期和时间&a…...

Java包介绍

今天看jdk文档&#xff0c;顺便写一下java几个包的作用。 java.applet 主要用于创建java applet小应用程序&#xff0c;可以嵌入到网页中能够呈现出特殊的效果&#xff0c;现在基本已经被废弃&#xff0c;很少使用。 java.awt AWT 是Abstract Window ToolKit (抽象窗口工具包…...

【2024.6.21】今日科技时事:科技前沿大事件

人不走空 &#x1f308;个人主页&#xff1a;人不走空 &#x1f496;系列专栏&#xff1a;算法专题 ⏰诗词歌赋&#xff1a;斯是陋室&#xff0c;惟吾德馨 目录 &#x1f308;个人主页&#xff1a;人不走空 &#x1f496;系列专栏&#xff1a;算法专题 ⏰诗词歌…...

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莫属&#xff0c;Rus…...

基于Java蛋糕甜品商城系统设计和实现(源码+LW+调试文档+讲解等)

&#x1f497;博主介绍&#xff1a;✌全网粉丝10W,CSDN作者、博客专家、全栈领域优质创作者&#xff0c;博客之星、平台优质作者、专注于Java、小程序技术领域和毕业项目实战✌&#x1f497; &#x1f31f;文末获取源码数据库&#x1f31f;感兴趣的可以先收藏起来&#xff0c;还…...

Tomcat get请求传数组集合参数

前言 最近做项目&#xff0c;需要通过GET传参&#xff0c;来实现查询的能力&#xff0c;本来是RPC调用&#xff0c;直接参数序列化即可。但是服务最近修改为HTTP&#xff0c;本来Spring Cloud的feign也可以直接传参数&#xff0c;但是当使用Nginx访问时参数到底传啥呢&#xf…...

信息学奥赛初赛天天练-34-CSP-J2021完善程序-按位异或、模拟算法、数组模拟环、约瑟夫问题应用

PDF文档公众号回复关键字:20240624 2021 CSP-J 完善程序3 1 完善程序 (单选题 &#xff0c;每小题3分&#xff0c;共30分) &#xff08;Josephus问题&#xff09;有n个人围成一个圈&#xff0c;依次标号0至n-1。从0号开始&#xff0c;依次 0&#xff0c;1&#xff0c;0&#…...

【计算机视觉】人脸算法之图像处理基础知识(六)

图像直方图 图像直方图是描述图像中像素强度分布的一种统计图表&#xff0c;它是图像处理和计算机视觉领域中一个非常基础且重要的概念。图像直方图通常用于分析图像的亮度、对比度特性&#xff0c;以及在图像增强、阈值分割、特征提取等多种图像处理任务。 import cv2 impor…...

仓颉编程语言入门

华为在 2024 年 6 月 21 日的华为开发者大会上&#xff0c;华为终端 BG 软件部总裁龚体正式官宣了华为自研仓颉编程语言&#xff0c;并发布了 HarmonyOS NEXT 仓颉语言开发者预览版。 仓颉编程语言文件后缀名为 .cj, 以下是第一个入门代码输出&#xff1a;你好&#xff0c;仓颉…...

在前端项目中,如何处理错误和异常?

在前端项目中&#xff0c;如何处理错误和异常&#xff1f; 在前端项目中&#xff0c;处理错误和异常是至关重要的&#xff0c;它能确保应用程序的稳定性和用户体验。以下是一些常见的方法&#xff1a; try-catch-finally结构&#xff1a;使用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爬虫框架&#xff0c;可以帮助我们快速高效地从网页中提取所需信息。但是&#xff0c;我们经常面临的一个问题是数据的质量低劣&#xff0c;存在各种噪声和错误&#xff0c;这使得它们难以用于后续分析和…...

Linux:基础IO(三.软硬链接、动态库和静态库、动精态库的制作和加载)

上次介绍了基础IO&#xff08;二&#xff09;&#xff1a;Linux&#xff1a;基础IO&#xff08;二.缓冲区、模拟一下缓冲区、详细讲解文件系统&#xff09; 文章目录 1.软硬链接1.1硬链接1.2软链接使用场景 2.动态库和静态库1.1回顾1.2静态库的制作和使用为什么要有库制作者角度…...

低价可转债崩盘,发生了什么?

下跌不在于“出库”&#xff0c;甚至不在于“风险”。问题更多在于交易层面&#xff0c;何时能积聚更多的左侧资金并成功过渡至右侧。 低价券怎么了&#xff1f; 如果说6月初主要是小微盘品种的退市风险&#xff0c;后来是一些评级下调的品种&#xff0c;到本周&#xff0c;已…...

【面试题】马上金九银十了,简历该准备起来了,面试题你准备好了吗 ?浅谈 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…...

最新OPPO 真我手机 一加手机 使用adb命令永久关闭系统更新教程

使用adb命令永久关闭系统更新 一、先了解手机系统二、Android 11 以下使用adb 命令永久关闭系统更新1、adb 官方下载2、小白开启 USB 调试模式教程&#xff08;熟手跳过&#xff09;三、Android 12 以上使用adb 命令永久关闭系统更新什么您还是不会弄&#xff01;赞赏我&#x…...

OnlyOffice:现代办公的最佳选择

目录 安装 使用 评价 对比&#xff08;与WPS&#xff09; 总结 在当今的数字化办公时代&#xff0c;选择一款功能全面且易于使用的办公软件至关重要。OnlyOffice作为一款现代化的办公软件&#xff0c;凭借其强大的功能和友好的用户体验&#xff0c;逐渐成为了众多企业和个…...

【收藏】2024年必备相图数据库资源集锦!

在材料化工领域&#xff0c;相图不仅仅是一个简单的图表&#xff0c;它是一个强大的工具&#xff0c;为材料科学家和工程师提供了深入理解材料行为的窗口。从选择合金元素及其比例的初步阶段&#xff0c;到后续的加工方法选择和热处理工艺的确定&#xff0c;相图都扮演着至关重…...

Zookeeper 二、Zookeeper环境搭建

Zookeeper安装方式有三种&#xff0c;单机模式和集群模式以及伪集群模式 单机模式&#xff1a;Zookeeper只运行在一台服务器上&#xff0c;适合测试环境集群模式&#xff1a;Zookeeper运行于一个集群上&#xff0c;适合生产环境&#xff0c;这个计算机集群被称为一个“集合体”…...

Web3 学习

之前学习 web3&#xff0c;走了不少弯路&#xff0c;最近看到了 hackquest&#xff0c;重新刷了一遍以太坊基础&#xff0c;感觉非常nice&#xff0c;而且完全免费&#xff0c;有需要的可以试试&#xff0c;链接hackquest.io。...

Grafana+Prometheus(InfluxDB)+Jmeter使用Nginx代理搭建可视化性能测试监控平台

前言 在这篇博客文章中&#xff0c;将分享JMeter > Prometheus(InfluxDB) > Grafana的集成&#xff0c;以及Nginx端口反向代理各服务的端口。 背景 在JMeter插件库中&#xff0c;有一些后端监听器可供Kafka、ElasticSearch和Azure使用。默认情况下&#xff0c;JMeter支…...

web学习笔记(六十六)项目总结

目录 1. Suspense标签 2.发布订阅者模式 3.pinia的使用 4.在请求过来的数据添数据 5.设置token和取token 6. 实现触底加载 7.导航守卫判断登录状态。 1. Suspense标签 Suspense主要用于用于处理异步组件加载和数据获取。&#xff0c;使用这个标签可以允许你在组件等待数…...

红队内网攻防渗透:内网渗透之内网对抗:横向移动篇域控系统提权NetLogonADCSPACKDC永恒之蓝CVE漏洞

红队内网攻防渗透 1. 内网横向移动1.1 横向移动-域控提权-CVE-2020-1472 NetLogon1.2 横向移动-域控提权-CVE-2021-422871.3 横向移动-域控提权-CVE-2022-269231.4 横向移动-系统漏洞-CVE-2017-01461.5 横向移动-域控提权-CVE-2014-63241. 内网横向移动 1、横向移动-域控提权-…...

VMware Workstation安装Windows Server2019系统详细操作步骤

虚拟机版本 VMware Workstation 16 Prp 16.2.5 build-20904516 实现操作 创建虚拟机 创建新的虚拟机 自定义->下一步 默认即可&#xff0c;下一步 稍后安装操作系统->下一步 按照图下所示选择好系统->下一步 设置好虚拟机名称和位置->下一步 默认即可&#xff0…...

HTML5【新特性总结】

HTML5【新特性总结】 HTML5 的新增特性主要是针对于以前的不足&#xff0c;增加了一些新的标签、新的表单和新的表单属性等。 这些新特性都有兼容性问题&#xff0c;基本是 IE9 以上版本的浏览器才支持&#xff0c;如果不考虑兼容性问题&#xff0c;可以大量使用这些新特性。…...