redismariadb + keepalived 高可用

目录

机器准备

安装后服务

redis

安装redis

mariadb

安装mariadb

启动和配置

互为主从同步配置

keepalived

keepalived安装

修改主从 keepalived的配置

主从配置-mariadb监控

主从配置-redis监控

查看和使用

Keepalived

Mariadb

redis


机器准备

两台机器:172.171.16.108-109   

操作系统 :centos7.6

两个虚拟ip :172.171.16.110-111

关闭防火墙

关闭防火墙

//临时关闭

systemctl stop firewalld

//禁止开机启动

systemctl disable firewalld

安装后服务

172.171.16.108

主数据库:Mariadb 10.5  3306  root  123456

主redis:Redis5.05  6379  123456

Keepalived

172.171.16.109

主数据库:Mariadb 10.5  3306  root  123456

从redis:Redis5.05  6379  123456  

Keepalived

Mariadb 虚拟ip  172.171.16.110

Redis虚拟ip  172.171.16.111

redis

安装redis

1.下载redis,并解压到/home/redis/目录下

mkdir /home/redis/

cd /home/redis/

wget http://download.redis.io/releases/redis-5.0.5.tar.gz

tar -xzvf redis-5.0.5.tar.gz

2.安装编译环境

yum -y install make automake cmake gcc g++

cd /home/redis/redis-5.0.5/

3.编译安装redis

make && make install

4、配置开机自启

vi /etc/systemd/system/redis.service

[Unit]

Description=redis-server

After=network.target



[Service]

Type=forking

ExecStart= /home/redis/redis-5.0.5/src/redis-server /home/redis/redis-5.0.5/redis.conf

PrivateTmp=true



[Install]

WantedBy=multi-user.target

ExecStart=/opt/software/redis-6.2.6/src/redis-server :启动服务的命令的位置
/etc/redis.conf 配置文件命令的位置

systemctl daemon-reload

systemctl enable redis

5.修改两台服务器上的redis配置文件,绑定所有ip,后台方式运行进程,设置密码

vim redis.conf

主库  172.171.16.108

bind 0.0.0.0

protected-mode no

pidfile  /home/redis/redis_6379.pid

daemonize yes

dir /home/redis

logfile "/home/redis/redis_6379.log"

requirepass 123456

从库  172.171.16.109

bind 0.0.0.0

protected-mode no

pidfile  /home/redis/redis_6379.pid

daemonize yes

dir /home/redis

logfile "/home/redis/redis_6379.log"

requirepass 123456



replicaof 172.171.16.108 6379

masterauth 123456

命令

# 启动

systemctl start redis

# 停止

systemctl stop redis

# 重启

systemctl restart redis

# 查看状态

systemctl status redis

mariadb

安装mariadb

查看已安装的包

命令:rpm -qa | grep mysql

如果存在已安装,逐个卸载掉这些包

命令:rpm -e --nodeps

配置yum源,并yum安装

vi /etc/yum.repos.d/MariaDB.repo

# MariaDB 10.5.9 CentOS repository list
# http://downloads.mariadb.org/mariadb/repositories/

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.5/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

yum update

yum install MariaDB-server MariaDB-client

配置两台服务器上的数据库配置文件

vim /etc/my.cnf.d/server.cnf

主库  172.171.16.108

#

# These groups are read by MariaDB server.

# Use it for options that only the server (but not clients) should see

#

# See the examples of server my.cnf files in /usr/share/mysql/

#



# this is read by the standalone daemon and embedded servers

[server]



# this is only for the mysqld standalone daemon

[mysqld]

skip-name-resolve



#event_scheduler=ON

datadir=/home/mariadb

socket=/home/mariadb/mysql.sock

slow_query_log=on

slow_query_log_file=/home/mariadb/slow_query_log.log

long_query_time=10

max_allowed_packet=512M

max_connections=1000

character-set-server=utf8mb4

collation-server=utf8mb4_general_ci

lower_case_table_names=0



#skip_name_resolve=ON

innodb_file_per_table=ON

server-id=108

log-bin=mysql-bin

log-bin-index=master-bin.index



# ignored databases

binlog-ignore-db=mysql

binlog-ignore-db=information_schema

binlog-ignore-db=performance_schema

# ignored tables

# #replicate-ignore-table=test



auto-increment-increment=2

auto-increment-offset=1

slave-skip-errors=all

relay_log=slave_relay_bin



wait_timeout=31536000

interactive_timeout=31536000

thread_pool_size=128

thread_pool_stall_limit=10



# Specifies the number of days before automatic removal of binary log files

expire_logs_days=30



#

# * Galera-related settings

#

[galera]

# Mandatory settings

#wsrep_on=ON

#wsrep_provider=

#wsrep_cluster_address=

#binlog_format=row

#default_storage_engine=InnoDB

#innodb_autoinc_lock_mode=2

#

# Allow server to accept connections on all interfaces.

#

#bind-address=0.0.0.0

#

# Optional setting

#wsrep_slave_threads=1

#innodb_flush_log_at_trx_commit=0



innodb_flush_log_at_trx_commit=0

innodb_autoextend_increment=128M

innodb_log_buffer_size=16M

innodb_log_file_size=128M



# this is only for embedded server

[embedded]



# This group is only read by MariaDB servers, not by MySQL.

# If you use the same .cnf file for MySQL and MariaDB,

# you can put MariaDB-only options here

[mariadb]



# This group is only read by MariaDB-10.5 servers.

# If you use the same .cnf file for MariaDB of different versions,

# use this group for options that older servers don't understand

[mariadb-10.5]

主库  172.171.16.109

#

# These groups are read by MariaDB server.

# Use it for options that only the server (but not clients) should see

#

# See the examples of server my.cnf files in /usr/share/mysql/

#



# this is read by the standalone daemon and embedded servers

[server]



# this is only for the mysqld standalone daemon

[mysqld]

skip-name-resolve



#event_scheduler=ON

datadir=/home/mariadb

socket=/home/mariadb/mysql.sock

slow_query_log=on

slow_query_log_file=/home/mariadb/slow_query_log.log

long_query_time=10

max_allowed_packet=512M

max_connections=1000

character-set-server=utf8mb4

collation-server=utf8mb4_general_ci

lower_case_table_names=0



#skip_name_resolve=ON

innodb_file_per_table=ON

server-id=109

log-bin=mysql-bin

log-bin-index=master-bin.index



# ignored databases

binlog-ignore-db=mysql

binlog-ignore-db=information_schema

binlog-ignore-db=performance_schema

# ignored tables

# #replicate-ignore-table=test



auto-increment-increment=2

auto-increment-offset=2

slave-skip-errors=all

relay_log=slave_relay_bin



wait_timeout=31536000

interactive_timeout=31536000

thread_pool_size=128

thread_pool_stall_limit=10



# Specifies the number of days before automatic removal of binary log files

expire_logs_days=30



#

# * Galera-related settings

#

[galera]

# Mandatory settings

#wsrep_on=ON

#wsrep_provider=

#wsrep_cluster_address=

#binlog_format=row

#default_storage_engine=InnoDB

#innodb_autoinc_lock_mode=2

#

# Allow server to accept connections on all interfaces.

#

#bind-address=0.0.0.0

#

# Optional setting

#wsrep_slave_threads=1

#innodb_flush_log_at_trx_commit=0



innodb_flush_log_at_trx_commit=0

innodb_autoextend_increment=128M

innodb_log_buffer_size=16M

innodb_log_file_size=128M



# this is only for embedded server

[embedded]



# This group is only read by MariaDB servers, not by MySQL.

# If you use the same .cnf file for MySQL and MariaDB,

# you can put MariaDB-only options here

[mariadb]



# This group is only read by MariaDB-10.5 servers.

# If you use the same .cnf file for MariaDB of different versions,

# use this group for options that older servers don't understand

[mariadb-10.5]



创建数据库目录,并将原有的数据库目录下文件复制到新的目录下,给sock文件设置软连接

mkdir /home/mariadb

chown -R mysql:mysql /home/mariadb

cp -a /var/lib/mysql/*     /home/mariadb

ln -s /home/mariadb/mysql.sock /var/lib/mysql/mysql.sock

启动和配置

命令

systemctl start mariadb  #启动MariaDB
systemctl stop mariadb  #停止MariaDB
systemctl restart mariadb  #重启MariaDB
systemctl enable mariadb  #设置开机启动

对两台服务器上的数据库做初始化配置

mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB

      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!



In order to log into MariaDB to secure it, we'll need the current

password for the root user. If you've just installed MariaDB, and

haven't set the root password yet, you should just press enter here.



Enter current password for root (enter for none):

OK, successfully used password, moving on...



Setting the root password or using the unix_socket ensures that nobody

can log into the MariaDB root user without the proper authorisation.



You already have your root account protected, so you can safely answer 'n'.



Switch to unix_socket authentication [Y/n] n

 ... skipping.



You already have your root account protected, so you can safely answer 'n'.



Change the root password? [Y/n] y

New password:

Re-enter new password:

Password updated successfully!

Reloading privilege tables..

 ... Success!





By default, a MariaDB installation has an anonymous user, allowing anyone

to log into MariaDB without having to have a user account created for

them.  This is intended only for testing, and to make the installation

go a bit smoother.  You should remove them before moving into a

production environment.



Remove anonymous users? [Y/n] y

 ... Success!



Normally, root should only be allowed to connect from 'localhost'.  This

ensures that someone cannot guess at the root password from the network.



Disallow root login remotely? [Y/n] n

 ... skipping.



By default, MariaDB comes with a database named 'test' that anyone can

access.  This is also intended only for testing, and should be removed

before moving into a production environment.



Remove test database and access to it? [Y/n] y

 - Dropping test database...

 ... Success!

 - Removing privileges on test database...

 ... Success!



Reloading the privilege tables will ensure that all changes made so far

will take effect immediately.



Reload privilege tables now? [Y/n] y

 ... Success!



Cleaning up...



All done!  If you've completed all of the above steps, your MariaDB

installation should now be secure.



Thanks for using MariaDB!

设置远程登录 ,并更新生效

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY '123456' WITH GRANT OPTION;
flush privileges;

互为主从同步配置

保持 108 和 109 上的数据库、表完全一致

通过执行如下sql 设置两台数据库互相同步

108认为是master1  需要同步master2

change master 'master2' to master_host='172.171.16.109',master_port=3306,master_user='root',master_password='123456';

start SLAVE 'master2';

show all slaves status;

109认为是master2  需要同步master1

change master 'master1' to master_host='172.171.16.108',master_port=3306,master_user='root',master_password='123456';

start SLAVE 'master1';

show all slaves status;

keepalived

keepalived安装

卸载

查找安装目录

[root@CentOS-003 keepalived]# find / -name keepalived

删除安装目录

rm -rf /etc/sysconfig/keepalived

rm -rf /etc/keepalived

rm -rf /var/lib/selinux/targeted/active/modules/100/keepalived

rm -rf /usr/sbin/keepalived

rm -rf /usr/share/doc/keepalived

rm -rf /usr/share/selinux/targeted/default/active/modules/100/keepalived

rm -rf /usr/libexec/keepalived

rm -rf /etc/selinux/targeted/active/modules/100/keepalived

查看进程

[root@CentOS-001 /]#  ps aux|grep keepalived

创建目录

mkdir /home/keepalived

cd  /home/keepalived

下载压缩包 keepalived-2.0.20.tar.gz 并放在该目录下

解压

tar xvf keepalived-2.0.20.tar.gz

安装

[root@CentOS-003 opt]# cd keepalived-2.0.20/

[root@CentOS-003 keepalived-2.0.20]#  ./configure --prefix=/usr/local/keepalived

如果报错

configure: error:

  !!! OpenSSL is not properly installed on your system. !!!

  !!! Can not include OpenSSL headers files.            !!!

Yum安装解决

yum -y install openssl openssl-devel

解决后继续执行命令

[root@CentOS-003 keepalived-2.0.20]#  ./configure --prefix=/usr/local/keepalived

[root@CentOS-003 keepalived-2.0.20]# make & make install

# keepalived 启动脚本变量引用文件,默认文件路径是 /etc/sysconfig/,也可以不做软链接,直接修改启动脚本中文件路径即可(安装目录下)

[root@CentOS-001 keepalived-2.0.20]# cp /usr/local/keepalived/etc/sysconfig/keepalived  /etc/sysconfig/keepalived



# 将keepalived 主程序加入到环境变量(安装目录下)

[root@CentOS-001 keepalived-2.0.20]# cp /usr/local/keepalived/sbin/keepalived /usr/sbin/keepalived



# keepalived 启动脚本(源码目录下),放到 /etc/init.d/ 目录下就可以使用 service 命令便捷调用



[root@CentOS-001 keepalived-2.0.20]# cp /home/keepalived/keepalived-2.0.20/keepalived/etc/init.d/keepalived  /etc/init.d/keepalived

# 将配置文件放到默认路径下

[root@CentOS-001 keepalived-2.0.20]# mkdir /etc/keepalived

[root@CentOS-001 keepalived-2.0.20]# cp /usr/local/keepalived/etc/keepalived/keepalived.conf /etc/keepalived/keepalived.conf

chmod 644 /etc/keepalived/keepalived.conf

启动

[root@CentOS-001 keepalived-2.0.20]# service keepalived start

日志位置

[root@CentOS-001 log]# tail -f /var/log/messages

加为系统服务:chkconfig --add keepalived

开机启动:chkconfig keepalived on

查看开机启动的服务:chkconfig --list

启动、关闭、重启 service keepalived start|stop|restart

ip a show |grep -w inet

修改主从 keepalived的配置

vim /etc/keepalived/keepalived.conf

主库  172.171.16.108


global_defs {
	router_id redis-mysql-master
	script_user root
	enable_script_security
}

vrrp_script chk_mysql
{
	#监控脚本
	script "/home/keepalived-scripts/mysql/mysql_check.sh"
	#监控时间,脚本的执行时间间隔
	interval 2
	#超时时间
	timeout 2
	weight -15
	#3次失败才算失败,会用weight减少优先级(1-255之间)
	fall 3
	#1次成功就算成功,但不修改优先级
	rise 1
}

vrrp_script chk_redis
{
	#监控脚本
	script "/home/keepalived-scripts/redis/redis_check.sh"
	#监控时间,脚本的执行时间间隔
	interval 2
	#超时时间
	timeout 2
	weight -15
	#3次失败才算失败,会用weight减少优先级(1-255之间)
	fall 3
	#1次成功就算成功,但不修改优先级
	rise 1
}


vrrp_instance VI_1 {
	#设置为MASTER
	state MASTER
	#本机监控网卡
	interface ens192
        # garp_master_delay 10
	#主从需要在同一路由编号
	virtual_router_id 55
	#权重值
    	priority 100
	#默认抢占
    	#nopreempt
	#vrrp通告的时间间隔,默认1s
	advert_int 1
	authentication {
		#加密
		auth_type PASS
		#密码
 		auth_pass 123456
	}

	virtual_ipaddress {
		#Keppalived虚拟出来的VIP
		172.171.16.110
	}

	track_script {
		chk_mysql
	}
}

vrrp_instance VI_2 {
        #设置为MASTER
	state MASTER
	#本机监控网卡
	interface ens192
	#主从需要在同一路由编号
	virtual_router_id 60
	#权重值
    	priority 100
	#vrrp通告的时间间隔,默认1s
	advert_int 5
	authentication {
		#加密
		auth_type PASS
		#密码
 		auth_pass 123456
	}

	virtual_ipaddress {
		#Keppalived虚拟出来的VIP
		172.171.16.111
	}

	track_script {
		chk_redis
	}

	#keepalived成为master
	notify_master /home/keepalived-scripts/redis/redis_master.sh
	#keepalived成为backup
	notify_backup /home/keepalived-scripts/redis/redis_slave.sh
	#keepalived fault时
	notify_fault /home/keepalived-scripts/redis/redis_fault.sh
	#keepalived服务中止时
	notify_stop /home/keepalived-scripts/redis/redis_stop.sh

}

主库  172.171.16.109


global_defs {
        router_id redis-mysql-slave
        script_user root
        enable_script_security
}

vrrp_script chk_mysql
{
        #监控脚本
        script "/home/keepalived-scripts/mysql/mysql_check.sh"
        #监控时间,脚本的执行时间间隔
        interval 2
        #超时时间
        timeout 2
        weight -15
        #3次失败才算失败,会用weight减少优先级(1-255之间)
        fall 3
        #1次成功就算成功,但不修改优先级
        rise 1
}

vrrp_script chk_redis
{       
        #监控脚本
        script "/home/keepalived-scripts/redis/redis_check.sh"
        #监控时间,脚本的执行时间间隔
        interval 2
        #超时时间
        timeout 2
        weight -15
        #3次失败才算失败,会用weight减少优先级(1-255之间)
        fall 3
        #1次成功就算成功,但不修改优先级
        rise 1
}


vrrp_instance VI_1 {
        #设置为BACKUP
        state BACKUP
        #本机监控网卡
        interface em1
#   garp_master_delay 10
        #主从需要在同一路由编号
        virtual_router_id 55
        #权重值
        priority 90
        #默认抢占
        #nopreempt
        #vrrp通告的时间间隔,默认1s
        advert_int 1
        authentication {
                #加密
                auth_type PASS
                #密码
                auth_pass 123456
        }

        virtual_ipaddress {
                #Keppalived虚拟出来的VIP
                172.171.16.110
        }

        track_script {
                chk_mysql
        }
}

vrrp_instance VI_2 {
        #设置为BACKUP
        state BACKUP
        #本机监控网卡
        interface em1
        #主从需要在同一路由编号
        virtual_router_id 60
        #权重值
        priority 90
        #vrrp通告的时间间隔,默认1s
        advert_int 5
        authentication {
                #加密
                auth_type PASS
                #密码
                auth_pass 123456
        }

        virtual_ipaddress {
                #Keppalived虚拟出来的VIP
                172.171.16.111
        }

        track_script {
                chk_redis
        }

        #keepalived成为master
        notify_master /home/keepalived-scripts/redis/redis_master.sh
        #keepalived成为backup
        notify_backup /home/keepalived-scripts/redis/redis_slave.sh
        #keepalived fault时
        notify_fault /home/keepalived-scripts/redis/redis_fault.sh
        #keepalived服务中止时
        notify_stop /home/keepalived-scripts/redis/redis_stop.sh

}

主从配置-mariadb监控

创建监控脚本目录,用来放监控脚本文件

mkdir /home/keepalived-scripts

mkdir /home/keepalived-scripts/mysql

cd  /home/keepalived-scripts/mysql

vim mysql_check.sh(当前目录的 /script目录下)

编辑mysql_check.sh脚本,108、109服务器一致

#!/bin/bash
MYSQL_HOST=localhost
MYSQL_USER=root
MYSQL_PASSWORD=123456
CHECK_TIME=3
#mysql is working MYSQL_OK is 1, mysql down MYSQL_OK is 0
MYSQL_OK=1
#select 1;
function check_mysql_helth() {
	mysqladmin -h $MYSQL_HOST -u $MYSQL_USER -p${MYSQL_PASSWORD} ping &>/dev/null
	if [ $? = 0 ] ;then
		MYSQL_OK=1
	else
 		MYSQL_OK=0
    	fi
	echo $MYSQL_OK
    	return $MYSQL_OK
}
while [ $CHECK_TIME -ne 0 ]
do
	let "CHECK_TIME -= 1"
   	check_mysql_helth
	if [ $MYSQL_OK = 1 ]; then
    		CHECK_TIME=0
    	exit 0
fi
if [ $MYSQL_OK -eq 0 ] &&  [ $CHECK_TIME -eq 0 ]
then
	exit 1
fi
sleep 2
done

主从配置-redis监控

mkdir /home/keepalived-scripts

mkdir /home/keepalived-scripts/redis

mkdir /home/keepalived-scripts/log

cd  /home/keepalived-scripts/ redis

vim 编辑如下脚本

/home/keepalived-scripts/redis/redis_master.sh
/home/keepalived-scripts/redis/redis_slave.sh
/home/keepalived-scripts/redis/redis_fault.sh
/home/keepalived-scripts/redis/redis_stop.sh

/home/keepalived-scripts/redis/redis_stop.sh

具体查看下面链接中资源

       keepalived 监测mysql&&redis 高可用配置和脚本icon-default.png?t=N5K3https://download.csdn.net/download/mengo1234/87954486

chmod +x /home/keepalived-scripts/redis/*

redis脚本日志所在位置:/home/keepalived-scripts/log

chmod +x /home/keepalived-scripts/mysql/*

查看和使用

Keepalived

启动、关闭、重启 service keepalived start|stop|restart

查看keepalived集群主节点在哪台服务器,执行命令:ip a

查看日志:tail -f /var/log/messages

Mariadb

systemctl start mariadb  #启动MariaDB
systemctl stop mariadb  #停止MariaDB
systemctl restart mariadb  #重启MariaDB
systemctl enable mariadb  #设置开机启动

redis

启动

systemctl start redis

# 停止

systemctl stop redis

# 重启

systemctl restart redis

# 查看状态

systemctl status redis

登录:redis-cli 

查看信息:Info

查看主从信息:info Replicatio

切换主从:replicaof NO ONE

replicaof 172.171.16.109 6379    108上redis从109

replicaof 172.171.16.108 6379    109上redis从108

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/32474.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

transformer零基础学习

声明:以下文章链接仅用于个人学习与备忘。 基础知识 1:零基础解析教程 [推荐] https://zhuanlan.zhihu.com/p/609271490 2:Transformer 详解 [推荐] https://wmathor.com/index.php/archives/1438/ 3:如何从浅入深理解transfor…

行为型模式--状态模式

目录 举例 状态模式 定义 结构 代码实现 优缺点 优点: 缺点: 使用场景 举例 【例】通过按钮来控制一个电梯的状态,一个电梯有开门状态,关门状态,停止状态,运行状态。每一 种状态改变,都…

STM32外设系列—BH1750

文章目录 一、BH1750简介二、BH1750原理图三、BH1750数据手册3.1 指令集3.2 IIC通信读/写 四、BH1750程序设计4.1 IIC程序4.2 BH1750初始化程序4.3 读取BH1750测量结果4.4 获取光照强度4.5 相关宏定义 五、应用实例六、拓展应用6.1 实时调节LED亮度6.2 实时调整颜色阈值 一、BH…

C++【位图/布隆过滤器—海量数据处理】

文章目录 一、位图(1)位图概念介绍(2)简单模拟实现(3)位图应用 二、布隆过滤器(1)关于布隆过滤器概念及介绍(2)布隆过滤器的使用场景(3&#xff0…

【前端布局篇】浮动、定位、弹性布局,固比固、双飞翼、圣杯布局

一、布局方式介绍 布局模型是基于盒模型基础上进行的拓展,关于布局有流式布局(标准的布局),浮动布局、定位布局、flex布局等。 1.1 标准流(流动模型) 描述:元素按照自己默认的元素类型在页面…

Unity3D 连接MySQL数据库

1、MySQL下载安装运行 详见:MySQL下载安装运行 2、使用mysql-connector-net (1)官方下载地址:https://downloads.mysql.com/archives/c-net/,下载后直接双击安装即可。 提示:不要使用版本过高的connect…

Jmeter(三) - 从入门到精通 - 测试计划(Test Plan)的元件(详解教程)

1.简介 上一篇中我已经教你如何通过JMeter来创建一个测试计划(Test Plan),那么这一篇我们就将JMeter启动起来,创建一个测试计划(Test plan),然后现在给大家介绍一下测试计划(Test P…

C# wpf 附加属性实现任意控件拖动调整大小

摘自这里 https://blog.csdn.net/u013113678/article/details/121719278 调试效果如下 using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using Syst…

【信号】信号处理与进程通信:快速上手

目录 0. 信号概述 1. 产生信号的方式: 1.1 当用户按某些终端键时,将产生信号。 1.2 硬件异常将产生信号。 1.3 软件异常将产生信号。 1.4 调用kill函数将发送信号。 1.5 运行kill命令将发送信号。 2. 信号的默认(缺省)处理…

Visual C++类的继承及类中成员的访问特性——搞懂public、protected、private

我是荔园微风,作为一名在IT界整整25年的老兵,今天来说说Visual C中类的继承及类中成员的访问特性,也就是来搞懂public、protected、private这三个东西。 很多人搞不清楚这三个东西,并且很容易弄错,其实不是学习的人的…

ModaHub魔搭社区:向量数据库MIlvus服务端配置(三)

目录 gpu 区域 logs 区域 metric_config 区域 gpu 区域 在该区域选择是否在 Milvus 里启用 GPU 用于搜索和索引创建。同时使用 CPU 和 GPU 可以达到资源的最优利用,在特别大的数据集里做搜索时性能更佳。 若要切换到 CPU-only 模式,只要将 enable 设…

【VMD-LSTM】变分模态分解-长短时记忆神经网络研究(Python代码实现)

💥💥💞💞欢迎来到本博客❤️❤️💥💥 🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。 ⛳️座右铭&a…

数据库大题

(计算题,20分) 设有两个关系R和S,求① R ∪ S R \cup S R∪S;② R − S R - S R−S;③ R S R \times S RS;④ ∏ C , A ( R ) \prod_{C,A}(R) ∏C,A​(R);⑤ σ B > ′ 4 ′ ( R ) \sigma_{B>4}(R) σB>′4′​(R) 关系R关系S (简答题,10…

基于深度学习FasterRCNN模型Restnet50 的生活垃圾智能分类(准确率达84%)-含python工程全源码

目录 前言总体设计系统整体结构图系统流程图 运行环境1. 硬件环境2. Python 环境 模块实现1. 数据预处理2. 数据加载3. 模型构建4. 模型训练及保存5. 模型加载与调用 系统测试1. 模型准确率2. 分类别准确率 工程源代码下载其它资料下载 前言 本项目基于Faster R-CNN模型&#…

jenkins流水线Pipeline的使用

pipeline流水线 1、jenkins安装pipeline插件 2、创建流水线项目 1、创建pipeline的流水线项目 2、编写流水线 pipeline {agent anystages {stage(拉去代码) {steps {git credentialsId: gitee, url: https://gitee.com/xwb1056481167/jenkins-demo.gitecho 拉去代码}}stage(m…

Vue中如何进行数据导入与Excel导入

Vue中如何进行数据导入与Excel导入 Vue是一款非常流行的JavaScript框架,它提供了一套用于构建用户界面的工具和库。在Vue中,我们可以使用多种方式来导入数据,包括从服务器获取数据、从本地存储获取数据、从文件中读取数据等等。其中&#xf…

NVIDIA Jetson TX1,TX2,TX2 NX,AGX Xavier 和 Nano开发板GPIO口配置及应用

NVIDIA Jetson TX1,TX2,TX2 NX,AGX Xavier 和 Nano开发板GPIO口配置及应用 简介 ​ Jetson TX1、TX2、TX2 NX、AGX Xavier和Nano开发板都配备了一个包含40个引脚的GPIO接头,这些引脚可以用于数字输入输出。如下图 ​ 类似于Rasp…

Solid Converter PDF v10 安装及使用教程

目录 一、软件介绍二、下载教程三、安装教程四、使用教程1.PDF转Word、Html等2.合并PDF文件 一、软件介绍 Solid Converter PDF是一套专门将PDF文件转换成Word的软件。 能够将PDF转换为Word、Excel、HTML、PowerPoint、纯文本文件从PDF文档中提取数据并以CSV等格式保存能够转…

【人工智能】— 深度神经网络、卷积神经网络(CNN)、多卷积核、全连接、池化

【人工智能】— 深度神经网络、卷积神经网络(CNN)、多卷积核、全连接、池化 深度神经网络训练训练深度神经网络参数共享 卷积神经网络(CNN)卷积多卷积核卷积全连接最大池化卷积池化拉平向量激活函数优化小结 深度神经网络训练 Pr…

Pytest+selenium+allure+Jenkins自动化测试框架搭建及使用

一、 环境搭建 1. Python下载及安装 Python可应用于多平台包括windows, Linux 和 Mac OS X, 本文主要介绍windows环境下。你可以通过终端窗口输入 "python" 命令来查看本地是否已经安装Python以及Python的安装版本。 如未安装python, 推荐下载python 3.8.3以…
最新文章