pt-config-diff

来源:互联网 发布:域名管理权 编辑:程序博客网 时间:2024/06/03 10:18

对比配置文件与配置文件、服务器与服务器 或者 配置文件与服务器 之前的参数差异。

 

1、用法

[html] view plain copy
  1. pt-config-diff [OPTION...] CONFIG CONFIG [CONFIG...]  
 CONFIG可以是文件也可以是数据源名称,最少必须指定两个配置文件源,就像unix下面的diff命令一样,如果配置完全一样就不会输出任何东西

例1、比较本地和远程服务器配置差异

[html] view plain copy
  1. [root@slave159 test]# pt-config-diff h=192.168.60.159 --user=huang --password=huang  h=192.168.61.42 --user=huang --password=huang  
  2. 35 config differences  
  3. Variable                  slave159                  kfpanda  
  4. ========================= ========================= =========================  
  5. basedir                   /opt/mysql-5.5.41         /usr/local/mysql  
  6. character_sets_dir        /opt/mysql-5.5.41/shar... /usr/local/mysql/share...  
  7. datadir                   /u02/data_3307/           /home/opaqdata/data/  
  8. event_scheduler           ON                        OFF  
  9. expire_logs_days          3                         0  
  10. general_log               ON                        OFF  
  11. general_log_file          /u02/data_3307/slave15... /home/opaqdata/data/kf...  
  12. hostname                  slave159                  kfpanda  
  13. innodb_version            5.5.41-tokudb-7.5.5       5.5.30-tokudb-7.0.1  
  14. lc_messages_dir           /opt/mysql-5.5.41/share/  /usr/local/mysql/share/  
  15. log                       ON                        OFF  
  16. log_bin_trust_function... ON                        OFF  
  17. log_error                 /u02/data_3307/slave15... /home/opaqdata/data/kf...  
  18. max_allowed_packet        5242880                   1048576  
  19. max_long_data_size        5242880                   1048576  
  20. open_files_limit          65534                     2500  
  21. pid_file                  /u02/data_3307/slave15... /home/opaqdata/data/kf...  
  22. plugin_dir                /opt/mysql-5.5.41/lib/... /usr/local/mysql/lib/p...  
  23. query_cache_size          0                         33554432  
  24. query_cache_type          OFF                       ON  
  25. server_id                 159                       1  
  26. skip_name_resolve         ON                        OFF  
  27. slow_query_log_file       /u02/data_3307/slave15... /home/opaqdata/data/kf...  
  28. socket                    /tmp/mysqltwo.sock        /tmp/mysql.sock  
  29. sort_buffer_size          31457280                  2097152  
  30. thread_stack              262144                    512000  
  31. tokudb_analyze_time       5                         60  
  32. tokudb_cache_size         16817350656               980219904  
  33. tokudb_commit_sync        OFF                       ON  
  34. tokudb_load_save_space    ON                        OFF  
  35. tokudb_max_lock_memory    2102168832                122527488  
  36. tokudb_read_block_size    65536                     131072  
  37. tokudb_row_format         tokudb_fast               tokudb_default  
  38. tokudb_version            tokudb-7.5.5              7.0.1  
  39. version                   5.5.41-tokudb-7.5.5-log   5.5.30-tokudb-7.0.1-log  
例2、比较配置文件和服务器配置
[html] view plain copy
  1. [root@slave159 test]# pt-config-diff /etc/my.cnf  h=192.168.60.159 --user=huang --password=huang  
  2. 2 config differences  
  3. Variable                  /etc/my.cnf slave159  
  4. ========================= =========== ========  
  5. sort_buffer_size          16777216    31457280  
  6. table_open_cache          510         512  
例3、比较两个文件得差异
[html] view plain copy
  1. [root@slave159 test]# pt-config-diff /etc/my.cnf  /opt/mysql-5.5.41/my.cnf   
  2. 2 config differences  
  3. Variable                  /etc/my.cnf /opt/mysql-5.5.41/my.cnf  
  4. ========================= =========== ========================  
  5. sort_buffer_size          16777216    31457280  
  6. table_open_cache          510         512  
--help
[html] view plain copy
  1. [root@slave159 test]# pt-config-diff --help  
  2. pt-config-diff diffs MySQL configuration files and server variables. CONFIG can  
  3. be a filename or a DSN.  At least two CONFIG sources must be given.  Like  
  4. standard Unix diff, there is no output if there are no differences.  For more  
  5. details, please use the --help option, or try 'perldoc  
  6. /usr/local/bin/pt-config-diff' for complete documentation.  
  7.   
  8. Usage: pt-config-diff [OPTIONS] CONFIG CONFIG [CONFIG...]  
  9.   
  10. Options:  
  11.   
  12.   --ask-pass            Prompt for a password when connecting to MySQL  
  13.   --charset=s       -A  Default character set  
  14.   --config=A            Read this comma-separated list of config files; if  
  15.                         specified, this must be the first option on the command  
  16.                         line. (This option does not specify a CONFIG; it's  
  17.                         equivalent to --defaults-file.)  
  18.   --database=s      -D  Connect to this database  
  19.   --defaults-file=s -F  Only read mysql options from the given file  
  20.   --help                Show help and exit  
  21.   --host=s          -h  Connect to host  
  22.   --[no]ignore-case     Compare the variables case-insensitively (default yes)  
  23.   --ignore-variables=a  Ignore, do not compare, these variables  
  24.   --password=s      -p  Password to use for connection  
  25.   --pid=s               Create the given PID file  
  26.   --port=i          -P  Port number to use for connection  
  27.   --[no]report          Print the MySQL config diff report to STDOUT (default  
  28.                         yes)  
  29.   --report-width=i      Truncate report lines to this many characters (default  
  30.                         78)  
  31.   --set-vars=A          Set the MySQL variables in this comma-separated list of  
  32.                         variable=value pairs  
  33.   --socket=s        -S  Socket file to use for connection  
  34.   --user=s          -u  MySQL user if not current user  
  35.   --version             Show version and exit  
  36.   --[no]version-check   Check for the latest version of Percona Toolkit, MySQL,  
  37.                         and other programs (default yes)  
  38.   
  39. Option types: s=stringi=integerf=float, h/H/a/A=comma-separated list, d=DSNz=sizem=time  
  40.   
  41. Rules:  
  42.   
  43.   This tool accepts additional command-line arguments. Refer to the SYNOPSIS and usage information for details.  
  44.   
  45. DSN syntax is key=value[,key=value...]  Allowable DSN keys:  
  46.   
  47.   KEY  COPY  MEANING  
  48.   ===  ====  =============================================  
  49.   A    yes   Default character set  
  50.   D    yes   Default database  
  51.   F    yes   Only read default options from the given file  
  52.   P    yes   Port number to use for connection  
  53.   S    yes   Socket file to use for connection  
  54.   h    yes   Connect to host  
  55.   p    yes   Password to use when connecting  
  56.   u    yes   User for login if not current user  
  57.   
  58.   If the DSN is a bareword, the word is treated as the 'h' key.  
  59.   
  60. Options and values after processing arguments:  
  61.   
  62.   --ask-pass            FALSE  
  63.   --charset             (No value)  
  64.   --config              /etc/percona-toolkit/percona-toolkit.conf,/etc/percona-toolkit/pt-config-diff.conf,/root/.percona-toolkit.conf,/root/.pt-config-diff.conf  
  65.   --database            (No value)  
  66.   --defaults-file       (No value)  
  67.   --help                TRUE  
  68.   --host                (No value)  
  69.   --ignore-case         TRUE  
  70.   --ignore-variables    (No value)  
  71.   --password            (No value)  
  72.   --pid                 (No value)  
  73.   --port                (No value)  
  74.   --report              TRUE  
  75.   --report-width        78  
  76.   --set-vars              
  77.   --socket              (No value)  
  78.   --user                (No value)  
  79.   --version             FALSE  
  80.   --version-check       TRUE  
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 买了西晒房怎么办 乳胶漆有打磨痕迹怎么办 墙上乳胶漆用水擦完太亮了怎么办 外墙腻子不好打磨怎么办 腻子打磨的灰尘怎么办 家里的壁纸脏了怎么办 家装用冷风管冬天取暖怎么办? 房子装修冷色系怎么办 高血压突然变低血压怎么办 玩单机游戏卡顿怎么办 老人血压太低怎么办 老年人血压太低怎么办 觉总是不够睡怎么办 老年人气不够用怎么办 卧室晒不到太阳怎么办 农村房子墙角受潮怎么办 房间里面有虫子怎么办 墙壁发霉生虫子怎么办 墙壁发霉有虫子怎么办 墙面发霉有虫子怎么办 白漆墙面脏了怎么办 房间贴完墙墙面发霉怎么办? 家里的墙壁发霉怎么办 黑豆生虫了怎么办 家具有小虫子怎么办 店铺对面有镜子怎么办 房间里有蛆虫怎么办 房间里有虫子怎么办 小宝宝发烧了怎么办啊 小孩不盖被子怎么办 孩子不爱盖被子怎么办 宝宝不喜欢盖被子怎么办 被单上染上颜色怎么办 白漆不够白怎么办 衣柜推拉门门缝宽怎么办 推拉门时声音大怎么办 电子门坏掉了怎么办 厨柜门坏掉了怎么办 乳胶漆刷花了怎么办 淋浴房靠窗户怎么办 墙漆滴在地板上怎么办