redismariadb + keepalived 高可用

news2024/11/16 17:45:42

目录

机器准备

安装后服务

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.coloradmin.cn/o/692776.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

计算机专业套装书书单推荐

1、深度学习经典教程 深度学习动手学深度学习 “花书”与沐神大作双剑合璧,入门深度学习看这一套就够了,来自一线科学家的经验总结,人工智能机器学习AI算法数据科学领域的重磅作品。理论实战,一套书帮你get深度学习的各种知识。 …

RK3568/RK3588+LinuxCNC+Ethercat解决方案

RK3588是瑞芯微新一代旗舰级高端处理器,具有高算力、低功耗、超强多媒体、丰富数据接口等特点。搭载四核A76四核A55的八核CPU和ARM G610MP4 GPU,内置6.0TOPs算力的NPU。 有五大技术优势 1. 内置多种功能强大的嵌入式硬件引擎,支持8K60fps 的…

IDEA、Webstorm 书签(bookmark)使用

①设置标签 ctrl shift 数字 就可以给软件设置上标签 或者 直接F11就可以添加标签 ②查看设置的标签的位置 使用shift F11 就可以标记记录的标签。

Mysql经典面试题

***搜集到的一些有用的Mysql经典《八股文》,全篇手打,大家觉得有用的话点一个赞,持续更新 目录 1.Mysql锁的机制: 粒度分类: 思想分类: 实现分类: 状态分类: 1.Mysql锁的机制&…

【雕爷学编程】Arduino动手做(130)---5A交流电流模块

37款传感器与执行器的提法,在网络上广泛流传,其实Arduino能够兼容的传感器模块肯定是不止这37种的。鉴于本人手头积累了一些传感器和执行器模块,依照实践出真知(一定要动手做)的理念,以学习和交流为目的&am…

Jetson Orin定制载板SPI接口调试记录

1.前言 按照如下步骤操作配置SPI,但仍无法正常工作 启用spi的步骤: (1)使用jetson-io为spi1启用40pin 座子 (2)编辑dts(把TPM(slb9670)设备通过spi 连接),并使用dtc工具将dts编译为dtb。 将TPM的reg设置为0x02。 (3)设置extlinux.conf的FDT (4)reboot 应该…

多张显卡之间通信方式

显卡之间常见的通信方式有以下几种 1.broadcast(广播):将一张卡上的数据传到其它所有的卡上(下图中的out就是等于in) 2. reduce(归约):将所有显卡上的数据,相加/取平均/…

【AcWing】夏季每日一题2023 -- 4908. 饥饿的牛 -- Java Version

题目链接:https://www.acwing.com/problem/content/description/4911/ 1. 题解(4908. 饥饿的牛) y总视频讲解:https://www.acwing.com/video/4739/ 1.1 顺序遍历:区间计算 ⭐ 时间复杂度O(1),空间复杂度O…

简单电感量测量装置电路设计

在电子制作和设计,经常会用到不同参数的电感线圈,这些线圈的电感量不像电阻那么容易测量,有些数字万用表虽有电感测量挡,但测量范围很有限。该电路以谐振方法测量电感值,测量下限可达 10nH,测量范围很宽&am…

iNav开源代码之AOCODARCH7DUAL蜂鸣器持续蜂鸣问题

iNav开源代码之AOCODARCH7DUAL蜂鸣器持续蜂鸣问题 1. 源由2. 分析2.1 逻辑分析2.2 接线连接2.3 动态测量2.4 软件配置2.5 现象分析2.6 对比分析 3. 总结4. 参考资料 1. 源由 最近上了iNav 6.1.1固件,总体感觉非常不错。但是出现了一个百思不得其解的蜂鸣器持续蜂鸣…

让MBR使用硬盘

前提知识: BIOS中断 BIOS 和 DOS 都是存在于实模式下的程序,由它们建立的中断调用都是建立在中断向量表(Interrupt Vector Table,IVT)中的。它们都是通过软中断指令 int 中断号来调用的。中断向量表中第 0H&#xff…

关于30KW储能PCS逆变器的设计方案。它包括双向DCDC和三电平逆变PCS

关于30KW储能PCS逆变器的设计方案。它包括双向DCDC和三电平逆变PCS。资料中提供了仿真源码,其中包含并网和离网两个模型 30KW储能PCS逆变器双向变流器设计方案资料 1.此系列为30KW储能PCS逆变器设计方案资料,双向DCDC和三电平逆变PCS; 2.仿真…

使用Android Jetpack Compose构建菜单(Menu)

Android Jetpack Compose是一种现代化的声明式UI工具,它让构建美观且功能强大的界面变得更加简单和直观。在本文中,我们将介绍如何使用Jetpack Compose构建一个简单的下拉菜单。 一、什么是下拉菜单? 下拉菜单是一种用户界面元素&#xff0…

无迹卡尔曼滤波在目标跟踪中的作用(二)

在上一节的内容中,我们介绍了UKF中最重要的内容—无迹变换UT,今天我们将具体介绍UKF是如何实现的。 好了,话不多说,开整!!! UKF算法的实现 我们知道,我们可以使用状态方程和观测方…

04 Web全栈 闭包/this指针

专业术语 变量、常量、数据类型形参、实参匿名函数、具名函数、自执行函数函数声明、函数表达式堆、栈同步、异步、进程、线程 执行上下文 当函数执行时,会创建一个执行上下文的环境,分为创建和执行两个阶段 创建阶段 创建阶段,指函数被调…

Android开发有必要深耕Framework吗?该如何着手?

前言 前段时间朋友在找 Android 高级开发工作,想进一步提升自己的能力,看了很多招聘信息,都要求熟练掌握 Framwork,了解底层原理等,发现是不是该深入研究底层技术…… 同时在网上也看到过相关问题,有很多…

iOS应用上架指iOS应用上架指南:综合详解

目录 引言 一、基本需求信息。 二、证书 一.证书管理 二.新建证书 三.使用appuploader服务同步证书 三、打包 三、审核 四、整体架构流程 五、代码实现 六、总结 转载自iOS开发上架的文章:iOS应用全面上架指南 引言 上架IOS应用到app store,…

An unexpected connection driver error occured

安装下载好rabbitmq,我在springboot整合mq,启动的时候报错了 An unexpected connection driver error occured 后来又报 Failed to check/redeclare auto-delete queue(s). 综合就是连接问题,端口有问题 我试过添加账户,提高权限&…

Docker 环境安装

博文目录 文章目录 CentOS 安装 Docker Engine安装 Docker升级 Docker卸载 Docker阿里云镜像加速 使用 DNF 命令安装最新 Docker Docker 官方文档 下载与安装 Linux 版本选择 Docker 官方文档 下载与安装 CentOS CentOS 安装 Docker Engine 安装 Docker 卸载旧版。卸载docke…