MySQL 5.7.42 主从复制环境搭建

news2024/10/9 22:17:55

MySQL 5.7.42 主从复制环境搭建

  • 下载MySQL二进制包
  • 操作系统环境配置
  • 安装过程
  • 搭建从库

本次安装环境:
OS版本:Red Hat Enterprise Linux Server release 6.8 (Santiago)
MySQL版本:5.7.42
架构:同一台机器,多实例安装搭建
ip地址:10.1.11.250
安装方式:采用MySQL二进制安装
在这里插入图片描述

下载MySQL二进制包

参考之前文章链接MySQL 8.0 安装
下载MySQL 5.7.42 安装包,唯一注意的点是glibc的版本。

[root@testbed opt]# rpm -qa|grep glibc      
glibc-2.12-1.192.el6.x86_64
glibc-headers-2.12-1.192.el6.x86_64
glibc-common-2.12-1.192.el6.x86_64
glibc-devel-2.12-1.192.el6.x86_64

glibc的版本是2.12。
官方的MySQL安装包的glibc版本只有一个,也是2.12,所以他适配的也就是rhel6。
在这里插入图片描述

操作系统环境配置

# groupadd mysql
# useradd -g mysql -s /sbin/nologin -d /usr/local/mysql -MN mysql
# cd /opt
# tar -zxvf mysql-5.7.42-linux-glibc2.12-x86_64.tar.gz 
# cd /usr/local
# ln -s /opt/mysql-5.7.42-linux-glibc2.12-x86_64 mysql
# chown -R mysql:mysql /usr/local/mysql/
# mkdir -p /data/mysql/mysql3306/{data,logs,tmp}
# chown -R mysql:mysql /usr/local/mysql/
# chown -R mysql:mysql /data/mysql/mysql3306/

上传修改MySQL配置文件

[root@testbed mysql3306]# ls -ltr
total 20
-rw-r--r--. 1 mysql mysql 8129 Nov  5  2018 my3306.cnf
drwxr-xr-x. 2 mysql mysql 4096 Jun 25 09:11 tmp
drwxr-xr-x. 2 mysql mysql 4096 Jun 25 09:11 logs
drwxr-xr-x. 2 mysql mysql 4096 Jun 25 09:11 data
[root@testbed mysql3306]# cat my3306.cnf 
[client]
port            = 3306

[mysql]
auto-rehash
prompt="\\u@\\h [\\d]>"
#pager="less -i -n -S"
#tee=/opt/mysql/query.log

[mysqld]
####: for global
user                                =mysql                          #   mysql
basedir                             =/usr/local/mysql/              #   /usr/local/mysql/
datadir                             =/data/mysql/mysql3306/data     #   /usr/local/mysql/data
server_id                           =33306                        #     0
port                                =3306                           #   3306
character_set_server                =utf8                           #   latin1
explicit_defaults_for_timestamp     =off                            #    off
log_timestamps                      =system
default_time_zone                   ='+8:00'                   #        utc
socket                              =/tmp/mysql3306.sock                #       /tmp/mysql.sock
read_only                           = 1                             #   off
super_read_only                     = 1
skip_name_resolve                   =off                             #   0
auto_increment_increment            =1                              #   1
auto_increment_offset               =1                              #   1
lower_case_table_names              =1                              #   0
secure_file_priv                    =  /tmp/                         #  null
open_files_limit                    =65536                          #   1024
max_connections                     =1000                           #   151
thread_cache_size                   =64                             #   9
table_open_cache                    =81920                          #   2000
table_definition_cache              =4096                           #   1400
table_open_cache_instances          =64                             #   16
max_prepared_stmt_count             =1048576                        #

####: for binlog
binlog_format                       =row                          #     row
log_bin                             =/data/mysql/mysql3306/logs/mysql-bin                      #        off
binlog_rows_query_log_events        =on                             #   off
log_slave_updates                   =on                             #   off
expire_logs_days                    =7                              #   0
binlog_cache_size                   =65536                          #   65536(64k)
#binlog_checksum                     =none                           #  CRC32
sync_binlog                         =1                              #   1
slave-preserve-commit-order         =ON                             #

####: for error-log
log_error                           =error.log                        # /usr/local/mysql/data/localhost.localdomain.err

general_log                         =off                            #   off
general_log_file                    =general.log                    #   hostname.log

####: for slow query log
slow_query_log                      =on                             #    off
slow_query_log_file                 =slow.log                       #    hostname.log
#log_queries_not_using_indexes       =on                             #    off
long_query_time                     =1.000000                       #    10.000000

####: for gtid
#gtid_executed_compression_period    =1000                          #   1000
gtid_mode                           =on                            #    off
enforce_gtid_consistency            =on                            #    off


####: for replication
skip_slave_start                     =1                              #
#master_info_repository              =table                         #   file
#relay_log_info_repository           =table                         #   file
slave_parallel_type                  =logical_clock                 #    database | LOGICAL_CLOCK
slave_parallel_workers               =4                             #    0
#rpl_semi_sync_master_enabled        =1                             #    0
#rpl_semi_sync_slave_enabled         =1                             #    0
#rpl_semi_sync_master_timeout        =1000                          #    1000(1 second)
#plugin_load_add                     =semisync_master.so            #
#plugin_load_add                     =semisync_slave.so             #
binlog_group_commit_sync_delay       =100                           #    500(0.05%秒)、默认值0
binlog_group_commit_sync_no_delay_count = 10                       #    0


####: for innodb
innodb_data_file_path                           =ibdata1:100M:autoextend    #   ibdata1:12M:autoextend
innodb_temp_data_file_path                      =ibtmp1:12M:autoextend      #   ibtmp1:12M:autoextend
innodb_buffer_pool_filename                     =ib_buffer_pool             #   ib_buffer_pool
innodb_log_group_home_dir                       =./                         #   ./
innodb_log_files_in_group                       =3                          #   2
innodb_log_file_size                            =100M                       #   50331648(48M)
innodb_file_per_table                           =on                         #   on
innodb_online_alter_log_max_size                =128M                       #   134217728(128M)
innodb_open_files                               =65535                      #   2000
innodb_page_size                                =16k                        #   16384(16k)
innodb_thread_concurrency                       =0                          #   0
innodb_read_io_threads                          =4                          #   4
innodb_write_io_threads                         =4                          #   4
innodb_purge_threads                            =4                          #   4(垃圾回收)
innodb_page_cleaners                            =4                          #   4(刷新lru脏页)
innodb_print_all_deadlocks                      =on                         #   off
innodb_deadlock_detect                          =on                         #   on
innodb_lock_wait_timeout                        =20                         #   50
innodb_spin_wait_delay                          =128                          # 6
innodb_autoinc_lock_mode                        =2                          #   1
innodb_io_capacity                              =200                        #   200
innodb_io_capacity_max                          =2000                       #   2000
#--------Persistent Optimizer Statistics
innodb_stats_auto_recalc                        =on                         #   on
innodb_stats_persistent                         =on                         #   on
innodb_stats_persistent_sample_pages            =20                         #   20

innodb_change_buffer_max_size                   =25                         #   25
innodb_flush_neighbors                          =1                          #   1
#innodb_flush_method                             =                           #
innodb_doublewrite                              =on                         #   on
innodb_log_buffer_size                          =128M                        #  16777216(16M)
innodb_flush_log_at_timeout                     =1                          #   1
innodb_flush_log_at_trx_commit                  =1                          #   1
innodb_buffer_pool_size                         =100M                  #        134217728(128M)
innodb_buffer_pool_instances                    =4
#--------innodb scan resistant
innodb_old_blocks_pct                           =37                         #    37
innodb_old_blocks_time                          =1000                       #    1000
#--------innodb read ahead
innodb_read_ahead_threshold                     =56                         #    56 (0..64)
innodb_random_read_ahead                        =OFF                        #    OFF
#--------innodb buffer pool state
innodb_buffer_pool_dump_pct                     =25                         #    25
innodb_buffer_pool_dump_at_shutdown             =ON                         #    ON
innodb_buffer_pool_load_at_startup              =ON                         #    ON
innodb_flush_method                             = O_DIRECT

安装过程

数据库初始化

# /usr/local/mysql/bin/mysqld --defaults-file=/data/mysql/mysql3306/my3306.cnf --initialize

初始化日志:

[root@testbed data]# cat error.log 
2024-06-25T09:17:46.464009+08:00 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
 100
 100
 100
 100
2024-06-25T09:17:47.233135+08:00 0 [Warning] InnoDB: New log files created, LSN=45790
2024-06-25T09:17:47.256665+08:00 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2024-06-25T09:17:47.330735+08:00 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: bb72a663-3290-11ef-bc60-000c29e3c118.
2024-06-25T09:17:47.332265+08:00 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2024-06-25T09:17:47.504191+08:00 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2024-06-25T09:17:47.504205+08:00 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2024-06-25T09:17:47.504620+08:00 0 [Warning] CA certificate ca.pem is self signed.
2024-06-25T09:17:47.565232+08:00 1 [Note] A temporary password is generated for root@localhost: Rcftzek;w80s

启动数据库

[root@testbed data]# ps -ef|grep mysql
root      27181   2151  0 09:20 pts/0    00:00:00 grep mysql
[root@testbed data]# /usr/local/mysql/bin/mysqld --defaults-file=/data/mysql/mysql3306/my3306.cnf &
[1] 27182
[root@testbed data]# ps -ef|grep mysql
mysql     27182   2151  6 09:20 pts/0    00:00:00 /usr/local/mysql/bin/mysqld --defaults-file=/data/mysql/mysql3306/my3306.cnf
root      27211   2151  0 09:20 pts/0    00:00:00 grep mysql

启动日志

2024-06-25T09:20:50.194162+08:00 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2024-06-25T09:20:50.196146+08:00 0 [Warning] Insecure configuration for --secure-file-priv: Location is accessible to all OS users. Consider choosing a different directory.
2024-06-25T09:20:50.196174+08:00 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.7.42-log) starting as process 27182 ...
2024-06-25T09:20:50.202558+08:00 0 [Note] InnoDB: PUNCH HOLE support available
2024-06-25T09:20:50.202579+08:00 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2024-06-25T09:20:50.202583+08:00 0 [Note] InnoDB: Uses event mutexes
2024-06-25T09:20:50.202586+08:00 0 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier
2024-06-25T09:20:50.202590+08:00 0 [Note] InnoDB: Compressed tables use zlib 1.2.13
2024-06-25T09:20:50.202593+08:00 0 [Note] InnoDB: Using Linux native AIO
2024-06-25T09:20:50.202603+08:00 0 [Note] InnoDB: Adjusting innodb_buffer_pool_instances from 4 to 1 since innodb_buffer_pool_size is less than 1024 MiB
2024-06-25T09:20:50.202947+08:00 0 [Note] InnoDB: Number of pools: 1
2024-06-25T09:20:50.203010+08:00 0 [Note] InnoDB: Using CPU crc32 instructions
2024-06-25T09:20:50.205724+08:00 0 [Note] InnoDB: Initializing buffer pool, total size = 100M, instances = 1, chunk size = 100M
2024-06-25T09:20:50.210624+08:00 0 [Note] InnoDB: Completed initialization of buffer pool
2024-06-25T09:20:50.211465+08:00 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2024-06-25T09:20:50.228895+08:00 0 [Note] InnoDB: Highest supported file format is Barracuda.
2024-06-25T09:20:50.287124+08:00 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2024-06-25T09:20:50.287250+08:00 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2024-06-25T09:20:50.293233+08:00 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2024-06-25T09:20:50.293682+08:00 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2024-06-25T09:20:50.293689+08:00 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2024-06-25T09:20:50.294077+08:00 0 [Note] InnoDB: Waiting for purge to start
2024-06-25T09:20:50.360419+08:00 0 [Note] InnoDB: 5.7.42 started; log sequence number 2766912
2024-06-25T09:20:50.363656+08:00 0 [Note] Plugin 'FEDERATED' is disabled.
2024-06-25T09:20:50.365561+08:00 0 [Note] InnoDB: Loading buffer pool(s) from /data/mysql/mysql3306/data/ib_buffer_pool
2024-06-25T09:20:50.373689+08:00 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2024-06-25T09:20:50.373703+08:00 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2024-06-25T09:20:50.373711+08:00 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2024-06-25T09:20:50.373713+08:00 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2024-06-25T09:20:50.378248+08:00 0 [Warning] CA certificate ca.pem is self signed.
2024-06-25T09:20:50.378292+08:00 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2024-06-25T09:20:50.378514+08:00 0 [Note] Server hostname (bind-address): '*'; port: 3306
2024-06-25T09:20:50.386005+08:00 0 [Note] IPv6 is available.
2024-06-25T09:20:50.386028+08:00 0 [Note]   - '::' resolves to '::';
2024-06-25T09:20:50.386040+08:00 0 [Note] Server socket created on IP: '::'.
2024-06-25T09:20:50.404028+08:00 0 [Note] Event Scheduler: Loaded 0 events
2024-06-25T09:20:50.404302+08:00 0 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.7.42-log'  socket: '/tmp/mysql3306.sock'  port: 3306  MySQL Community Server (GPL)
2024-06-25T09:20:50.405925+08:00 0 [Note] InnoDB: Buffer pool(s) load completed at 240625  9:20:50

连接数据库

[root@testbed data]# /usr/local/mysql/bin/mysql -uroot -p -S /tmp/mysql3306.sock
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.42-log

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> alter user user() identified by 'mysql';
ERROR 1290 (HY000): The MySQL server is running with the --super-read-only option so it cannot execute this statement
mysql>  set global super_read_only=off;
Query OK, 0 rows affected (0.00 sec)

mysql> alter user user() identified by 'mysql';
Query OK, 0 rows affected (0.16 sec)

模拟有数据变化

mysql> create database test;
Query OK, 1 row affected (0.18 sec)

mysql> use test;
Database changed
mysql> create table test (id int,name char);
Query OK, 0 rows affected (0.19 sec)

mysql> insert into test values(1,'a');
Query OK, 1 row affected (0.15 sec)

mysql> select * from test;
+------+------+
| id   | name |
+------+------+
|    1 | a    |
+------+------+
1 row in set (0.00 sec)

搭建从库

环境准备,由于在同一台机器搭建,省略了安装软件的步骤

# mkdir -p /data/mysql/mysql3308/{data,logs,tmp}
# cp /data/mysql/mysql3306/my3306.cnf /data/mysql/mysql3308/my3308.cnf
# chown -R mysql:mysql /data/mysql/mysql3308/

批量修改配置文件:
:%s/3306/3308/g
sed -i ‘s/3306/3308/g’ my3308.cnf
主要就是port和server_id的修改,其余的可以和主库参数保持一致。
数据库初始化及启动

# /usr/local/mysql/bin/mysqld --defaults-file=/data/mysql/mysql3308/my3308.cnf --initialize
# /usr/local/mysql/bin/mysqld --defaults-file=/data/mysql/mysql3308/my3308.cnf &
# /usr/local/mysql/bin/mysql -uroot -p -S /tmp/mysql3308.sock

主库备份

# /usr/local/mysql/bin/mysqldump -uroot -p -S /tmp/mysql3306.sock --master-data=2 --set-gtid-purged=OFF --single-transaction -A  >db3306-`date +%Y%m%d`.sql    

备份文件有如下内容,下面可以用到


-- CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000002', MASTER_LOG_POS=1062;

从库导入

# /usr/local/mysql/bin/mysql -uroot -p -S /tmp/mysql3308.sock < db3306-20240625.sql

主库创建用户,及赋权

mysql> create user repl@'%' identified by 'repl';
Query OK, 0 rows affected (0.10 sec)

mysql> grant replication slave on *.* to repl@'%';
Query OK, 0 rows affected (0.13 sec)

mysql> show grants;
+---------------------------------------------------------------------+
| Grants for root@localhost                                           |
+---------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION |
| GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION        |
+---------------------------------------------------------------------+
2 rows in set (0.00 sec)

从库启动进程:

[root@testbed ~]# /usr/local/mysql/bin/mysql -uroot -p -S /tmp/mysql3308.sock
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.42-log MySQL Community Server (GPL)

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show slave status\G;
Empty set (0.00 sec)

ERROR: 
No query specified

mysql> change master to master_host='10.1.11.250', master_port=3306, master_user='repl', master_password='repl',master_auto_position=1;
Query OK, 0 rows affected, 2 warnings (0.01 sec)
mysql> start slave;
Query OK, 0 rows affected (0.01 sec)
mysql> show slave status\G
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: 10.1.11.250
                  Master_User: repl
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000002
          Read_Master_Log_Pos: 1502
               Relay_Log_File: testbed-relay-bin.000003
                Relay_Log_Pos: 454
        Relay_Master_Log_File: mysql-bin.000002
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB: 
          Replicate_Ignore_DB: 
           Replicate_Do_Table: 
       Replicate_Ignore_Table: 
      Replicate_Wild_Do_Table: 
  Replicate_Wild_Ignore_Table: 
                   Last_Errno: 0
                   Last_Error: 
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 1502
              Relay_Log_Space: 2224
              Until_Condition: None
               Until_Log_File: 
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File: 
           Master_SSL_CA_Path: 
              Master_SSL_Cert: 
            Master_SSL_Cipher: 
               Master_SSL_Key: 
        Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error: 
               Last_SQL_Errno: 0
               Last_SQL_Error: 
  Replicate_Ignore_Server_Ids: 
             Master_Server_Id: 33306
                  Master_UUID: f1870083-32aa-11ef-9129-000c29e3c118
             Master_Info_File: /data/mysql/mysql3308/data/master.info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates
           Master_Retry_Count: 86400
                  Master_Bind: 
      Last_IO_Error_Timestamp: 
     Last_SQL_Error_Timestamp: 
               Master_SSL_Crl: 
           Master_SSL_Crlpath: 
           Retrieved_Gtid_Set: f1870083-32aa-11ef-9129-000c29e3c118:1-6
            Executed_Gtid_Set: 7dd629bf-32ab-11ef-9b8d-000c29e3c118:1-132,
f1870083-32aa-11ef-9129-000c29e3c118:1-6
                Auto_Position: 1
         Replicate_Rewrite_DB: 
                 Channel_Name: 
           Master_TLS_Version: 
1 row in set (0.00 sec)

整个过程如下:

groupadd mysql
useradd -g mysql -s /sbin/nologin -d /usr/local/mysql -MN mysql
cd /opt
tar -zxvf mysql-5.7.42-linux-glibc2.12-x86_64.tar.gz 
cd /usr/local
ln -s /opt/mysql-5.7.42-linux-glibc2.12-x86_64 mysql
chown -R mysql:mysql /usr/local/mysql/
mkdir -p /data/mysql/mysql3306/{data,logs,tmp}
chown -R mysql:mysql /usr/local/mysql/
chown -R mysql:mysql /data/mysql/mysql3306/
sed -i 's/3311/3306/g' my3306.cnf

/usr/local/mysql/bin/mysqld --defaults-file=/data/mysql/mysql3306/my3306.cnf --initialize
/usr/local/mysql/bin/mysqld --defaults-file=/data/mysql/mysql3306/my3306.cnf &

/usr/local/mysql/bin/mysql -uroot -p -S /tmp/mysql3306.sock


mkdir -p /data/mysql/mysql3308/{data,logs,tmp}
cp /data/mysql/mysql3306/my3306.cnf /data/mysql/mysql3308/my3308.cnf
chown -R mysql:mysql /data/mysql/mysql3308/
sed -i 's/3306/3308/g' my3308.cnf

/usr/local/mysql/bin/mysqld --defaults-file=/data/mysql/mysql3308/my3308.cnf --initialize
/usr/local/mysql/bin/mysqld --defaults-file=/data/mysql/mysql3308/my3308.cnf &
/usr/local/mysql/bin/mysql -uroot -p -S /tmp/mysql3308.sock

/usr/local/mysql/bin/mysqldump -uroot -p -S /tmp/mysql3306.sock --master-data=2 --set-gtid-purged=OFF --single-transaction -A  >db3306-`date +%Y%m%d`.sql 
create user repl@'%' identified by 'repl';
grant replication slave on *.* to repl@'%';


/usr/local/mysql/bin/mysql -uroot -p -S /tmp/mysql3308.sock < db3306-20240625.sql
change master to master_host='10.1.11.250', master_port=3306, master_user='repl', master_password='repl',master_auto_position=1;

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

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

相关文章

国标GB28181视频汇聚平台EasyCVR安防监控系统常见播放问题分析及解决方法

国标GB28181安防综合管理系统EasyCVR视频汇聚平台能在复杂的网络环境中&#xff0c;将前端设备统一集中接入与汇聚管理。平台支持多协议接入&#xff0c;包括&#xff1a;国标GB/T 28181协议、GA/T 1400协议、RTMP、RTSP/Onvif协议、海康Ehome、海康SDK、大华SDK、华为SDK、宇视…

【工具测评】ONLYOFFICE8.1版本桌面编辑器测评:好用!

随着远程工作的普及和数字化办公的发展&#xff0c;越来越多的人开始寻找功能强大、易于使用的办公软件。在这个背景下&#xff0c;ONLYOFFICE 8.1应运而生&#xff0c;成为许多用户的新选择。ONLYOFFICE 8.1是一款办公套件软件&#xff0c;提供文档处理、电子表格和幻灯片制作…

【node】深入探讨 class URL

【node】深入探讨 class URL &#x1f4cc; 浅说 fileURLToPath() 在vite.config.ts中有这么一段代码&#xff1a; import { fileURLToPath, URL } from node:url import { defineConfig } from vite export default defineConfig({resolve: {alias: {: fileURLToPath(new U…

python学习笔记四

1.自己平方本身 x2 x**4#xx**4 print(x) 2.把一个多位数拆分成单个数&#xff0c;方法一通过字符串下标获取对应元素&#xff0c;并对获取的元素使用eval函数把左右引号去掉&#xff0c;是字符串变为整型&#xff1b;方法二&#xff0c;通过对数进行取余和整除得到各个位的数 …

RK3568平台开发系列讲解(I2C篇)利用逻辑分析仪进行I2C总线的全面分析

🚀返回专栏总目录 文章目录 1. 基础协议1.1. 协议简介1.2. 物理信号1.3. 总线连接沉淀、分享、成长,让自己和他人都能有所收获!😄 1. 基础协议 1.1. 协议简介 IIC-BUS(Inter-IntegratedCircuit Bus)最早是由PHilip半导体(现在被NXP收购)于1982年开发。 主要是用来方…

安卓应用开发学习:获取导航卫星信息

一、引言 我昨天写了《安卓应用开发学习&#xff1a;获取经纬度及地理位置描述信息》日志&#xff0c;今天再接再厉&#xff0c;记录一下跟着《Android App 开发进阶与项目实战》一书&#xff0c;实现获取导航卫星信息&#xff0c;并在手机上显示的功能的情况。先上实现后的在…

go语言day2 配置

使用cmd 中的 go install &#xff1b; go build 命令出现 go cannot find main module 错误怎么解决&#xff1f; go学习-问题记录(开发环境)go: cannot find main module&#xff1b; see ‘go help modules‘_go: no flags specified (see go help mod edit)-CSDN博客 在本…

FPGA学习笔记(6)——硬件调试与网表添加探针

对信号进行分析&#xff0c;除了使用内置的ILA IP核&#xff0c;还可以在网表中添加探针。 本节采用之前配置的LED灯闪烁代码&#xff0c;对原始工程进行修改。 如果是新建工程&#xff0c;需要现将代码进行综合Synthesis&#xff0c;然后再进行接下来的操作。 1、点击Open S…

链表数组遍历输出的辨析(二者都含指针的情况下)----PTA期末复习题

输入输出三位学生的学号和信息 一开始我认为是指针&#xff0c;直接背了指针输出的方式&#xff1b;p;p!NULL;pp->next 这个是错误的 下面这个输出是正确的方式 分析怎么区分这两个 举个例子来 数组遍历&#xff1a; 链表遍历&#xff1a; 输出的结果&#xff1a; 如果将…

浏览器扩展V3开发系列之 chrome.cookies 的用法和案例

【作者主页】&#xff1a;小鱼神1024 【擅长领域】&#xff1a;JS逆向、小程序逆向、AST还原、验证码突防、Python开发、浏览器插件开发、React前端开发、NestJS后端开发等等 chrome.cookies API能够让我们在扩展程序中去操作浏览器的cookies。 在使用 chrome.cookies 要先声明…

【Redis】Zset有序集合常用命令以及使用场景

Redis 的有序集合&#xff08;Sorted Set&#xff0c;简称 Zset&#xff09;是一个非常强大的数据结构&#xff0c;它结合了集合&#xff08;Set&#xff09;的唯一性和列表&#xff08;List&#xff09;的有序性。每个元素都关联一个评分&#xff08;score&#xff09;&#x…

减少液氮罐内液氮损耗的方法

监测与管理液氮容器的密封性能 液氮容器的密封性能直接影响液氮的损耗情况。一个常见的损耗源是容器本身的密封不良或老化导致的泄漏。为了有效减少液氮损耗&#xff0c;首先应当定期检查液氮容器的密封性能。这可以通过简单的方法如肉眼检查外观&#xff0c;或者更精确的方法…

SEO与AI的结合:如何用ChatGPT生成符合搜索引擎优化的内容

在当今数字时代&#xff0c;搜索引擎优化&#xff08;SEO&#xff09;已成为每个网站和内容创作者都必须掌握的一项技能。SEO的主要目标是通过优化内容&#xff0c;使其在搜索引擎结果页面&#xff08;SERP&#xff09;中排名更高&#xff0c;从而吸引更多的流量。然而&#xf…

嵌入式学习——硬件(ARM体系架构)——day51

1. S3C2440基础知识——一条指令四个字节 1.1 定义 S3C2440 是三星&#xff08;Samsung&#xff09;公司设计的一款基于 ARM920T 核心的微处理器&#xff0c;广泛应用于嵌入式系统中&#xff0c;属于三星的 S3C24xx 系列。 1.2 处理器核心 ARM920T&#xff1a;基于 ARM v5T …

[C#][opencvsharp]C#使用opencvsharp进行年龄和性别预测支持视频图片检测

使用 OpenCVSharp 来调用 age_net.caffemodel 和 gender_net.caffemodel 来进行性别和年龄预测涉及几个步骤。以下是一个简化的流程和示例文案&#xff1a; 1. 准备工作 确保你已经安装了 OpenCVSharp 和相关的依赖项。确保你有 age_net.prototxt、age_net.caffemodel、gende…

市面上很轻的 100kW 负载组

FX100S-C 负载组 EAK的 FX100S-C 负载组在轻质外壳中以 415Vac 50Hz 提供 100kW 的连续负载。数字仪表允许您测量功率、电压、电流和频率&#xff0c;同时还允许您在进行测试时记录数据。 EAK是市场上最轻的 100kW 负载组之一&#xff0c;它将使您能够访问其他负载组无法到达…

离线部署OpenIM

目录 1.提取相关安装包和镜像 2.安装docker和docker-compose 3.依次导入镜像 4.解压安装包 5.执行安装命令 6.PC Web 验证 7.开放端口 7.1IM 端口 7.2Chat 端口 7.3 PC Web 及管理后台前端资源端口 “如果您在解决类似问题时也遇到了困难&#xff0c;希望我的经验分享…

服务运营 | MS文章精选:线上点单,当真免排队?餐饮零售与医疗场景中的全渠道运营

编者按&#xff1a; 小A走进了一家奶茶店&#xff0c;准备向店员点单&#xff0c;但却在屏幕上看到还有98杯奶茶待制作&#xff08;因为线上订单突然暴增&#xff09;。因此&#xff0c;小A不满地嘟囔着离开了奶茶店。这个例子展示了线上渠道可能会对线下渠道造成一些负面影响…

并发编程-04synchronized原理

并发编程-04synchronized原理 一 synchronized基础 1.1 并发安全问题 在学习synchronized原理之前&#xff0c;我们先要了解synchronized是干嘛用的&#xff0c;什么场景下需要使用它&#xff0c;以及它的使用方式有哪些&#xff1f;接下来我们去根据一个业务场景去了解下sy…

【排序 队列】1585. 检查字符串是否可以通过排序子字符串得到另一个字符串

本文涉及知识点 排序 队列 LeetCode1585. 检查字符串是否可以通过排序子字符串得到另一个字符串 给你两个字符串 s 和 t &#xff0c;请你通过若干次以下操作将字符串 s 转化成字符串 t &#xff1a; 选择 s 中一个 非空 子字符串并将它包含的字符就地 升序 排序。 比方说&a…