一、MySQL Utilities介绍

MySQL Utilities 提供一组命令行工具用于维护和管理 MySQL 服务器,包括:

管理工具 (克隆、复制、比较、差异、导出、导入)
复制工具 (安装、配置)
一般工具 (磁盘使用情况、冗余索引、搜索元数据)

MySQL Utilities是一系列的命令行工具以及Python库更容易完成管理的任务。库是用Python语言写的,这就意味着不需要安装其他任何工具和库。当前是基于Python2.6版本设计的,不支持Python3.1版本。

二、下载安装

2.1 下载地址

https://downloads.mysql.com/archives/utilities/

2.2 安装mysql utilities

shell> tar -xvzf mysql-utilities-1.6.5.tar.gz 
shell> cd mysql-utilities-1.6.5
shell> python ./setup.py build
shell> python ./setup.py install

三、工具使用

#下面为自测使用的参数,详细参数请查看--help
Binary Log Operations(二进制日志操作)
       mysqlbinlogmove   二进制日志移动
       mysqlbinlogpurge  二进制日志清理
       mysqlbinlogrotate 二进制日志老化工具    
​
Database Operations(数据库操作)
       mysqldbexport     数据导出
       mysqldbimport     数据导入
       mysqldbcopy       库级别数据库复制
       mysqldiff         数据库对象级别比较工具
       mysqldbcompare    数据库库级别比较工具
​
General Operations(通用用的操作)    
       mysqldiskusage    磁盘空间查看
       mysqlfrm          恢复故障表.frm文件
       mysqluserclone    用户克隆工具
       mysqluc           Utilities帮助工具
       mysqlindexcheck   索引检测工具
       mysqlmetagrep     元数据过滤器
       mysqlprocgrep     进程搜索及清理工具
​
High Availability Operations(高可用)
   mysqlreplicate   主从复制工具
   mysqlrpladmin    主从复制管理工具
   mysqlrplcheck    主从复制检测工具
   mysqlrplms       主从多元复制工具
   mysqlrplshow     主从复制拓扑图工具
   mysqlrplsync     主从复制同步工具
   mysqlfailover    主从failover工具
   mysqlslavetrx    从库事务跳过工具
​
Server Operations(服务器操作)
       mysqlserverinfo    服务器信息查看工具
       mysqlserverclone   服务器克隆工具    
​
Specialized Operations(特殊操作)
       mysqlauditadmin    审计管理工具
       mysqlauditgrep     审计日志过滤工具

本次只分享自己在实际使用中用到的工具!

3.1 mysqldbcopy 数据库复制工具使用

mysqldbcopy --source=root:mysql@127.0.0.1:3306 --destination=root:mysql@127.0.0.1:3306 tt:t1
#--source 源端数据库
#--destination 目标端数据库
#root:mysql@127.0.0.1:3306 数据库用户名:密码@ip地址:端口
#tt:t1 tt源端数据库名字:目标端数据库名字(目标端数据不用提前创建,执行命令时自动创建)

3.2 mysqlrplshow查看主从结构

my.cnf参数需要配置如下参数:

report_host=192.168.253.146
report_port=3306
[root@localhost ~]# mysqlrplshow --master=failover:pass@'192.168.253.146':3306 --discover-slaves-login=failover:pass --verbose
WARNING: Using a password on the command line interface can be insecure.
# master on 192.168.253.146: ... connected.
# Finding slaves for master: 192.168.253.146:3306
​
# Replication Topology Graph
192.168.253.146:3306 (MASTER)
  |
  +--- 192.168.253.130:3306 [IO: Yes, SQL: Yes] - (SLAVE)

#--master=failover:pass@'192.168.253.146':3306 主库用户名密码
#--discover-slaves-login=failover:pass 为从库复制账号和密码

3.3 非守护进程方式启动mysqlfailover查看主从

[root@localhost ~]# mysqlfailover --master=failover:pass@'192.168.253.146':3306 --discover-slaves-login=failover:pass
WARNING: Using a password on the command line interface can be insecure.
# Discovering slaves for master at 192.168.253.146:3306
# Discovering slave at 192.168.253.130:3306
# Found slave: 192.168.253.130:3306
# Checking privileges.
MySQL Replication Failover Utility
Failover Mode = auto     Next Interval = Mon May 31 14:26:34 2021
​
Master Information
------------------
Binary Log File      Position  Binlog_Do_DB  Binlog_Ignore_DB  
mysql-binlog.000003  194                                      
​
GTID Executed Set
ea4a306b-c1d3-11eb-bf34-000c29f06c14:1-16
​
Replication Health Status
+------------------+-------+---------+--------+------------+---------+
| host             | port  | role    | state  | gtid_mode  | health  |
+------------------+-------+---------+--------+------------+---------+
| 192.168.253.146  | 3306  | MASTER  | UP     | ON         | OK      |
| 192.168.253.130  | 3306  | SLAVE   | UP     | ON         | OK      |
+------------------+-------+---------+--------+------------+---------+
​
Q-quit R-refresh H-health G-GTID Lists U-UUIDs
# Discovering slaves for master at 192.168.253.146:3306
MySQL Replication Failover Utility
Failover Mode = auto     Next Interval = Mon May 31 14:28:58 2021

3.4 以守护进程方式启动mysalfailover

[root@localhost ~]# mysqlfailover --master=failover:pass@'192.168.253.146':3306 --discover-slaves-login=failover:pass --log=/tmp/failover.log --daemon=start
WARNING: Using a password on the command line interface can be insecure.
NOTE: Log file '/tmp/failover.log' does not exist. Will be created.
Starting failover daemon...

日志查看:

[root@node233 ~]# tail -fn 50 /tmp/failover.log
2016-10-17 17:47:54 PM INFO MySQL Utilities mysqlfailover version 1.6.4.
2016-10-17 17:47:54 PM INFO Server '192.168.253.131:3306' is using MySQL version 5.6.30-log.
2016-10-17 17:47:54 PM INFO Discovering slaves for master at 192.168.253.131:3306
2016-10-17 17:47:54 PM INFO Discovering slave at 192.168.253.146:3306
2016-10-17 17:47:54 PM INFO Found slave: 192.168.253.146:3306
2016-10-17 17:47:54 PM INFO Server '192.168.253.146:3306' is using MySQL version 5.6.30-log.
2016-10-17 17:47:54 PM INFO Discovering slave at 192.168.253.130:3306
2016-10-17 17:47:54 PM INFO Found slave: 192.168.253.130:3306
2016-10-17 17:47:54 PM INFO Server '192.168.253.130:3306' is using MySQL version 5.6.30-log.
2016-10-17 17:47:54 PM INFO Checking privileges.
2016-10-17 17:47:54 PM INFO Unregistering existing instances from slaves.
2016-10-17 17:47:54 PM INFO Registering instance on master.
2016-10-17 17:47:54 PM INFO Failover daemon started.
2016-10-17 17:47:54 PM INFO Failover mode = auto.
2016-10-17 17:47:57 PM INFO Master Information
2016-10-17 17:47:57 PM INFO Binary Log File: node233-binlog.000003, Position: 25463, Binlog_Do_DB: N/A, Binlog_Ignore_DB: N/A
2016-10-17 17:47:57 PM INFO GTID Executed Set: 8dc97c98-9439-11e6-9968-000c29b82d0d:1-511
2016-10-17 17:47:57 PM INFO Getting health for master: 192.168.253.131:3306.
2016-10-17 17:47:57 PM INFO Health Status:
2016-10-17 17:47:57 PM INFO host: 192.168.253.131, port: 3306, role: MASTER, state: UP, gtid_mode: ON, health: OK
2016-10-17 17:47:57 PM INFO host: 192.168.253.146, port: 3306, role: SLAVE, state: UP, gtid_mode: ON, health: OK
2016-10-17 17:47:57 PM INFO host: 192.168.253.130, port: 3306, role: SLAVE, state: UP, gtid_mode: ON, health: OK
###上述部分完成主从、权限检查,成功启动mysqlfailover后输出主从健康状态,后会间隔1s持续检查主从健康状态
​
2016-10-17 17:48:15 PM INFO Discovering slaves for master at 192.168.253.131:3306
2016-10-17 17:48:15 PM INFO Discovering slave at 192.168.253.146:3306
2016-10-17 17:48:15 PM INFO Discovering slave at 192.168.253.130:3306
2016-10-17 17:48:15 PM INFO Master Information
2016-10-17 17:48:15 PM INFO Binary Log File: node233-binlog.000003, Position: 33887, Binlog_Do_DB: N/A, Binlog_Ignore_DB: N/A
2016-10-17 17:48:15 PM INFO GTID Executed Set: 8dc97c98-9439-11e6-9968-000c29b82d0d:1-547
2016-10-17 17:48:15 PM INFO Getting health for master: 192.168.253.131:3306.
2016-10-17 17:48:15 PM INFO Health Status:
2016-10-17 17:48:15 PM INFO host: 192.168.253.131, port: 3306, role: MASTER, state: UP, gtid_mode: ON, health: OK
2016-10-17 17:48:15 PM INFO host: 192.168.253.146, port: 3306, role: SLAVE, state: UP, gtid_mode: ON, health: OK
2016-10-17 17:48:15 PM INFO host: 192.168.253.130, port: 3306, role: SLAVE, state: UP, gtid_mode: ON, health: OK
###此时将主节点mysql关闭,发布命令 [root@node233 ~]# service mysqld stop
​
2016-10-17 17:48:42 PM INFO Failed to reconnect to the master after 3 attemps. ###3次检测失败
2016-10-17 17:48:42 PM CRITICAL Master is confirmed to be down or unreachable.
2016-10-17 17:48:42 PM INFO Failover starting in 'auto' mode...
2016-10-17 17:48:42 PM INFO Candidate slave 192.168.253.146:3306 will become the new master.
2016-10-17 17:48:42 PM INFO Checking slaves status (before failover).
2016-10-17 17:48:42 PM INFO Preparing candidate for failover.   ###寻找candidate用于failover
2016-10-17 17:48:42 PM INFO Creating replication user if it does not exist.
2016-10-17 17:48:42 PM INFO Stopping slaves.
2016-10-17 17:48:42 PM INFO Performing STOP on all slaves.
2016-10-17 17:48:42 PM INFO Switching slaves to new master.
2016-10-17 17:48:42 PM INFO Disconnecting new master as slave.
2016-10-17 17:48:42 PM INFO Starting slaves.
2016-10-17 17:48:42 PM INFO Performing START on all slaves.
2016-10-17 17:48:42 PM INFO Checking slaves for errors.
2016-10-17 17:48:42 PM INFO Failover complete.                 ###此处failover完成
2016-10-17 17:48:42 PM INFO Discovering slaves for master at 192.168.253.146:3306
2016-10-17 17:48:47 PM INFO Unregistering existing instances from slaves.
2016-10-17 17:48:47 PM INFO Registering instance on new master 192.168.253.146:3306.
2016-10-17 17:48:48 PM INFO Master Information                 ###后续部分为持续的主从状态监测
2016-10-17 17:48:48 PM INFO Binary Log File: node245-binlog.000002, Position: 41173, Binlog_Do_DB: N/A, Binlog_Ignore_DB: N/A
2016-10-17 17:48:48 PM INFO GTID Executed Set: 5dacc005-943a-11e6-996d-000c29328504:1[...]
2016-10-17 17:48:48 PM INFO Getting health for master: 192.168.253.146:3306.
2016-10-17 17:48:48 PM INFO Health Status:
2016-10-17 17:48:48 PM INFO host: 192.168.253.146, port: 3306, role: MASTER, state: UP, gtid_mode: ON, health: OK
2016-10-17 17:49:06 PM INFO Discovering slaves for master at 192.168.253.146:3306
2016-10-17 17:49:06 PM INFO Discovering slave at 192.168.253.130:3306
2016-10-17 17:49:06 PM INFO Found slave: 192.168.253.130:3306
2016-10-17 17:49:06 PM INFO Server '192.168.253.130:3306' is using MySQL version 5.6.30-log.
2016-10-17 17:49:06 PM INFO Master Information
2016-10-17 17:49:06 PM INFO Binary Log File: node245-binlog.000002, Position: 41173, Binlog_Do_DB: N/A, Binlog_Ignore_DB: N/A
2016-10-17 17:49:06 PM INFO GTID Executed Set: 5dacc005-943a-11e6-996d-000c29328504:1[...]
2016-10-17 17:49:06 PM INFO Getting health for master: 192.168.253.146:3306.
2016-10-17 17:49:06 PM INFO Health Status:
2016-10-17 17:49:06 PM INFO host: 192.168.253.146, port: 3306, role: MASTER, state: UP, gtid_mode: ON, health: OK
2016-10-17 17:49:06 PM INFO host: 192.168.253.130, port: 3306, role: SLAVE, state: UP, gtid_mode: ON, health: OK
2016-10-17 17:49:24 PM INFO Discovering slaves for master at 192.168.253.146:3306
2016-10-17 17:49:24 PM INFO Discovering slave at 192.168.253.130:3306
2016-10-17 17:49:24 PM INFO Master Information
2016-10-17 17:49:24 PM INFO Binary Log File: node245-binlog.000002, Position: 41173, Binlog_Do_DB: N/A, Binlog_Ignore_DB: N/A
2016-10-17 17:49:24 PM INFO GTID Executed Set: 5dacc005-943a-11e6-996d-000c29328504:1[...]
2016-10-17 17:49:24 PM INFO Getting health for master: 192.168.253.146:3306.
2016-10-17 17:49:24 PM INFO Health Status:
2016-10-17 17:49:24 PM INFO host: 192.168.253.146, port: 3306, role: MASTER, state: UP, gtid_mode: ON, health: OK
2016-10-17 17:49:24 PM INFO host: 192.168.253.130, port: 3306, role: SLAVE, state: UP, gtid_mode: ON, health: OK

3.5 检查主从库的一致性,并且显示主库从库的信息

#官方关于主从端口一直会报错的问题,前面是按照3306测试的,从mysqlrplcheck开始将从库端口改为3307接下来的测试:
官方网址:https://forums.mysql.com/read.php?144,594276,596297

错误演示:

[root@localhost ~]# mysqlrplcheck --master=root:mysql@127.0.0.1:3306 --slave=root:mysql@192.168.253.130:3306 --show-slave-status -vv
WARNING: Using a password on the command line interface can be insecure.
Usage: mysqlrplcheck --master=root@localhost:3306 --slave=root@localhost:3310
mysqlrplcheck: error: The master and slave are the same host and port.

正确演示:

[root@localhost ~]# mysqlrplcheck  --master=root:mysql@192.168.253.146:3306  --slave=root:mysql@192.168.253.130:3307 --show-slave-status -vv
WARNING: Using a password on the command line interface can be insecure.
# master on 192.168.253.146: ... connected.
# slave on 192.168.253.130: ... connected.
Test Description                                                     Status
---------------------------------------------------------------------------
Checking for binary logging on master                                [pass]
Are there binlog exceptions?                                         [pass]
Replication user exists?                                             [pass]
Checking server_id values                                            [pass]
​
master id = 4
 slave id = 5
​
Checking server_uuid values                                          [pass]
​
master uuid = ea4a306b-c1d3-11eb-bf34-000c29f06c14
 slave uuid = 2d65fce7-ae65-11eb-8ca2-000c29d3b1da
​
Is slave connected to master?                                        [pass]
Check master information file                                        [pass]
​
#
# Master information file:
#
              Master_Log_File : mysql-binlog.000005
          Read_Master_Log_Pos : 194
                  Master_Host : 192.168.253.146
                  Master_User : repl
              Master_Password : 123
                  Master_Port : 3306
                Connect_Retry : 60
           Master_SSL_Allowed : 0
           Master_SSL_CA_File :
           Master_SSL_CA_Path :
              Master_SSL_Cert :
            Master_SSL_Cipher :
               Master_SSL_Key :
Master_SSL_Verify_Server_Cert : 0
                    Heartbeat : 30
                         Bind :
           Ignored_server_ids : 0
                         Uuid : ea4a306b-c1d3-11eb-bf34-000c29f06c14
                  Retry_count : 86400
                      SSL_CRL :
                 SSL_CRL_Path :
        Enabled_auto_position : 1
                 Channel_Name :
​
Checking InnoDB compatibility                                        [pass]
Checking storage engines compatibility                               [pass]
Checking lower_case_table_names settings                             [pass]
​
 Master lower_case_table_names: 0
  Slave lower_case_table_names: 0
​
Checking slave delay (seconds behind master)                         [pass]
​
#
# Slave status:
#
               Slave_IO_State : Waiting for master to send event
                  Master_Host : 192.168.253.146
                  Master_User : repl
                  Master_Port : 3306
                Connect_Retry : 60
              Master_Log_File : mysql-binlog.000005
          Read_Master_Log_Pos : 345
               Relay_Log_File : localhost-relay-bin.000008
                Relay_Log_Pos : 413
        Relay_Master_Log_File : mysql-binlog.000005
             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 : 345
              Relay_Log_Space : 664
              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 : 4
                  Master_UUID : ea4a306b-c1d3-11eb-bf34-000c29f06c14
             Master_Info_File : mysql.slave_master_info
                    SQL_Delay : 0
          SQL_Remaining_Delay : None
      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 : ea4a306b-c1d3-11eb-bf34-000c29f06c14:7-16
            Executed_Gtid_Set : ea4a306b-c1d3-11eb-bf34-000c29f06c14:1-16
                Auto_Position : 1
         Replicate_Rewrite_DB :
                 Channel_Name :
           Master_TLS_Version :
# ...done.

3.6 mysqlreplicate快速创建主从,

mysqlreplicate  --master=root:mysql@192.168.253.146:3306  --slave=root:mysql@192.168.253.130:3307  --rpl-user=repl:123

3.6 查看数据库占用的空间大小

[root@localhost ~]# mysqldiskusage --server=root:mysql@localhost
WARNING: Using a password on the command line interface can be insecure.
# Source on localhost: ... connected.
# Database totals:
+---------------------+-------------+
| db_name             |      total  |
+---------------------+-------------+
| mysql               | 12,165,302  |
| performance_schema  | 822,167     |
| sys                 | 480,242     |
| tt                  | 106,997     |
+---------------------+-------------+
​
Total database disk usage = 13,574,708 bytes or 12.95 MB
​
#...done.

3.7 索引检查,看是否有冗余的索引

mysqlindexcheck --server=root:mysql@localhost tt

附录:

几类常见的错误: 1、访问拒绝权限问题

# mysqlrplshow --master=failover:pass@192.168.253.131:3306 --discover-slaves-login=failover:pass  
WARNING: Using a password on the command line interface can be insecure.
# master on 192.168.253.131: ...
FAILED.
​
ERROR: Access denied for user 'failover'@'pass' (using password: YES)
​
应对方案,用户需要授予基于主机名的访问权限
mysql> grant all privileges on *.* to 'failover'@'pass' ;

2、权限不足的问题

# ERROR: User root on 192.168.253.131@3306 does not have sufficient privileges to execute the failover command 
   (required: SUPER, GRANT OPTION, REPLICATION SLAVE, SELECT, RELOAD, DROP, CREATE, INSERT).
2016-10-08 16:18:20 PM CRITICAL Not enough privileges to execute command.
​
应对方案,用户需要授予with grant option权限
mysql> grant all privileges on *.* to 'root'@'pass';
​

3、配置参数问题

[root@node233 ~]# mysqlfailover --master=root:pass@192.168.253.131:3306 --discover-slaves-login=root:pass
WARNING: Using a password on the command line interface can be insecure.
# Discovering slaves for master at 192.168.253.131:3306
# Discovering slave at 192.168.253.130:3306
# Found slave: 192.168.253.130:3306
# Discovering slave at 192.168.253.146:3306
# Found slave: 192.168.253.146:3306
# Checking privileges.
2016-10-08 16:21:40 PM CRITICAL Failover requires --master-info-repository=TABLE for all slaves.
ERROR: Failover requires --master-info-repository=TABLE for all slaves.
​
# 应对方案,需要在配置文件中增加上述参数,如本文之前描述

4、多个mysqlfailover进程启动问题

[root@node233 ~]# mysqlfailover --master=failover:pass@'192.168.253.131':3306 --discover-slaves-login=failover:pass
WARNING: Using a password on the command line interface can be insecure.
# Discovering slaves for master at 192.168.253.131:3306
# Discovering slave at 192.168.253.130:3306
# Found slave: 192.168.253.130:3306
# Discovering slave at 192.168.253.146:3306
# Found slave: 192.168.253.146:3306
# Checking privileges.
Multiple instances of failover console found for master 192.168.253.131:3306.
If this is an error, restart the console with --force.
Failover mode changed to 'FAIL' for this instance.
Console will start in 10 seconds..........starting Console.
MySQL Replication Failover Utility
Failover Mode = fail     Next Interval = Mon Oct 17 17:02:17 2016
​
如上,如果已经有启动的mysqlfailover,则出现上述failover模式
如果无启动的mysqlfailover,也出现上述情形,建议执行以下命令
mysql > truncate table mysql.failover_console;  --该表记录了主节点及端口号  
mysql> select * from mysql.failover_console \G
*************************** 1. row ***************************
host: 192.168.253.146
port: 3306
1 row in set (0.00 sec)

MySQL Utilities工具教程的更多相关文章

  1. MySQL Utilities管理工具

    前提: 1.安装MySQL Utilities工具 2.复制my_print_defaults命令至/usr/bin下或写入环境变量. 卸载方式: python ./setup.py clean -- ...

  2. 大数据工具篇之Hive与MySQL整合完整教程

    大数据工具篇之Hive与MySQL整合完整教程 一.引言 Hive元数据存储可以放到RDBMS数据库中,本文以Hive与MySQL数据库的整合为目标,详细说明Hive与MySQL的整合方法. 二.安装 ...

  3. MySQL管理工具MySQL Utilities — 介绍与安装(1)

    MySQL Utilities介绍 MySQL Utilities 提供一组命令行工具用于维护和管理 MySQL 服务器,包括: 管理工具 (克隆.复制.比较.差异.导出.导入) 复制工具 (安装.配 ...

  4. (5.6)mysql高可用系列——MySQL Utilities 管理工具

    关键词:mysql工具集,mysql管理工具,mysql utilities [1]安装mysql utilities cd /download wget https://cdn.mysql.com/ ...

  5. Windows Server 2012 R2 IIS8.5+PHP(FastCGI)+MySQL环境搭建教程

    原文地址:http://www.osyunwei.com/archives/7378.html 搬运是为了自己找资料方便. 准备篇 一.环境说明: 操作系统:Windows Server 2012 R ...

  6. Windows Server 2012 R2 IIS8.5+PHP(FastCGI)+MySQL环境搭建教程

    准备篇 一.环境说明: 操作系统:Windows Server 2012 R2 PHP版本:php 5.5.8 MySQL版本:MySQL5.6.15 二.相关软件下载: 1.PHP下载地址: htt ...

  7. mysql 基本使用教程(源于网络)

    http://dev.mysql.com/doc/refman/5.1/zh/index.html 3.1. 连接与断开服务器 3.2. 输入查询 3.3. 创建并使用数据库 3.3.1. 创建并选择 ...

  8. 从零开始学数据分析,什么程度可以找到工作?( 内附20G、5000分钟数据分析工具教程大合集 )

    从零开始学数据分析,什么程度可以找到工作?( 内附20G.5000分钟数据分析工具教程大合集 )   我现在在Coursera上面学data science 中的R programming,过去很少接 ...

  9. MySQL WorkBench中文教程

    在网上找到了一份MySQL WorkBench的教程,点此可以下载Work Bench教程(原文),为了便于学习和交流,请朋友帮忙翻译成了中文,点此可以下载Work Bench教程(中文翻译版). 具 ...

随机推荐

  1. CAS你知道吗?底层如何实现?ABA问题又是什么?关于这些你知道答案吗

    CAS你知道吗?如何实现? 1. compareAndSet 在volatile当中我们提到,volatile不能保证原子语义,所以当用到变量自增时,如果用到synchronized会太"重 ...

  2. 图的存储与遍历C++实现

    1.图的存储 设点数为n,边数为m 1.1.二维数组 方法:使用一个二维数组 adj 来存边,其中 adj[u][v] 为 1 表示存在 u到 v的边,为 0 表示不存在.如果是带边权的图,可以在 a ...

  3. Vue 动态参数

    v-on和v-bind可以动态绑定一个参数,用[]来绑定一个可以改变的值. <li v-on:[event]="print"></li> <scrip ...

  4. redis学习笔记(一)——windows下redis的安装与配置

    前言 很久没有写东西了(.......我的水平就是记个笔记),北漂实习的我,每天晚上回来都不想动,但是做为社会主义接班人的我,还是要时刻给自己充充电,趁着年轻,趁着日渐脱发的脑袋还没有成为" ...

  5. SpringMvc实现批量删除,使用post传值一直报404错误

    Ajax结合SpringMVC实现批量删除信息,在前台使用post向后台传递要删除的id的集合额时候,一直报404错误, 前台post传值的源码如下: 了解一下: (1)第二行的rows为前面得到的一 ...

  6. netcore3.1 + vue (前后端分离) ElementUI多文件带参数上传

    vue前端代码 前端主要使用了ElementUI的el-uploda插件,除去业务代码需要注意的是使用formdata存储片上传时所需的参数 <el-upload class="upl ...

  7. 禅道项目管理软件-Linux上一键安装

    一.安装 1.将安装包直接解压到/opt目录下 特别说明:不要解压到别的目录再拷贝到/opt/,因为这样会导致文件的所有者和读写权限改变,也不要解压后把整个目录777权限. 可以使用命令: tar - ...

  8. JAVA 中日志的记录于使用

    java中常用的日志框架 日志接口 Commons Logging Apache Commons Logging是一个基于Java的日志记录实用程序,是用于日志记录和其他工具包的编程模型.它通过其他一 ...

  9. C语言的编译与链接

    C语言源文件要经过编译.链接才能生成可执行程序:编译(Compile)会将源文件(.c文件)转换为目标文件.对于 VC/VS,目标文件后缀为.obj:对于GCC,目标文件后缀为.o.编译是针对单个源文 ...

  10. MapReduce学习总结之Combiner、Partitioner、Jobhistory

    一.Combiner 在MapReduce编程模型中,在Mapper和Reducer之间有一个非常重要的组件,主要用于解决MR性能瓶颈问题 combiner其实属于优化方案,由于带宽限制,应该尽量ma ...