-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmysql-master-slave.yml
47 lines (42 loc) · 1.12 KB
/
mysql-master-slave.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
---
- hosts: mysql
gather_facts: yes
vars:
mysql_root_password: p8TEM-veDRE<8c8h8serd
mysql_databases:
- name: demo
encoding: utf8mb4
collation: utf8mb4_general_ci
mysql_users:
- name: testuser
host: "%"
password: Sime32-SRpR-Paccw0rd
priv: "demo.*:ALL"
# proxysql监控账号
- name: monitor
host: "192.168.60.%"
#password: SIme*2-SR8R-hahpw0rd
password: monitor
#priv: "*.*:ALL"
priv: "*.*:SELECT"
mysql_replication_user:
name: repl
host: "{{ hostvars['slave001']['ansible_default_ipv4']['address'] }}"
password: Sime96-ScpR-Pahcw0rd
priv: "*.*:REPLICATION CLIENT,REPLICATION SLAVE"
mysql_port: 3306
mysql_bind_address: '0.0.0.0'
mysql_daemon: mysqld
mysql_version: 5.7
mysql_exact_version: 5.7.38
#mysql_daemon: mariadb
#mysql_version: 10.8
#mysql_exact_version: 10.8.3
mysql_datadir: "/data/mysql/data"
mysql_socket: "/data/mysql/data/mysql.sock"
mysql_max_binlog_size: "1G"
mysql_binlog_format: "ROW"
roles:
- mysql
tags:
- mysql