gpt4 book ai didi

mysql - 由于 'Sending passwords in plain text without SSL/TLS is extremely insecure.',ansible mysql 复制无法将 master 更改为

转载 作者:行者123 更新时间:2023-11-29 03:33:44 25 4
gpt4 key购买 nike

我正在使用 ansible mysql 复制模块设置 mysql 复制,但失败了:

TASK: [mysql | change the master in slave to start the replication] ***********
failed: [mysql-master-1] => {"failed": true, "parsed": false}
invalid output was: Change master
Traceback (most recent call last):
File "/root/.ansible/tmp/ansible-tmp-1414844287.9-261276925072204/mysql_replication", line 1714, in <module>
main()
File "/root/.ansible/tmp/ansible-tmp-1414844287.9-261276925072204/mysql_replication", line 351, in main
changemaster(cursor,chm)
File "/root/.ansible/tmp/ansible-tmp-1414844287.9-261276925072204/mysql_replication", line 164, in changemaster
cursor.execute("CHANGE MASTER TO " + SQLPARAM)
File "/usr/lib64/python2.6/site-packages/MySQLdb/cursors.py", line 175, in execute
if not self._defer_warnings: self._warning_check()
File "/usr/lib64/python2.6/site-packages/MySQLdb/cursors.py", line 89, in _warning_check
warn(w[-1], self.Warning, 3)
_mysql_exceptions.Warning: Sending passwords in plain text without SSL/TLS is extremely insecure.

基础设施:

target servers:centos 6.4
ansible: 1.7.2
mysqldb:5.6.12-1.el6.x86_64

剧本:

- name: change the master in slave to start the replication
mysql_replication: >
mode=changemaster
master_host={{ mysql_master_host }}
master_user={{ mysql_repl_user }}
master_password={{ mysql_repl_password }}

我尝试手动设置复制,它起作用了:

mysql>change master to
>master_host='mysql-master-1'
>master_user='repl_user'
>master_password='123456';

似乎 mysqldb python 模块无法解析命令,如何在不使用 ssl 复制的情况下解决此问题?

更新

我通过将 _defer_warning 从 False 更改为 True 修改了“/usr/lib64/python2.6/site-packages/MySQLdb/cursors.py”的源文件,问题已解决。但是有没有更优雅的解决方案呢?

最佳答案

更新了复制模块,增加了两个选项:

  1. warnings_filtered - 哪些类型的警告应该被静音(所有,警告,无)。取自here .
  2. master_delay - 与 mysql 变量相同。

https://github.com/vbkunin/ansible-modules-extras/blob/devel/database/mysql/mysql_replication.py

替换为:/usr/lib/python2.7/dist-packages/ansible/modules/extras/database/mysql/mysql_replication.py

关于mysql - 由于 'Sending passwords in plain text without SSL/TLS is extremely insecure.',ansible mysql 复制无法将 master 更改为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26689329/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com