@@ -7,10 +7,10 @@ production. Use at your own risk.**
7
7
8
8
## What is MySQL replication?
9
9
10
- Replication enables data from one MySQL database server (the master ) to be
11
- replicated to one or more MySQL database servers (the slaves ). Replication is
12
- asynchronous - slaves do not need not be connected permanently to receive updates from
13
- the master . This means that updates can occur over long-distance connections and
10
+ Replication enables data from one MySQL database server (the source ) to be
11
+ replicated to one or more MySQL database servers (the replicas ). Replication is
12
+ asynchronous - replicas do not need not be connected permanently to receive updates from
13
+ the source . This means that updates can occur over long-distance connections and
14
14
even over temporary or intermittent connections such as a dial-up service.
15
15
Depending on the configuration, you can replicate all databases, selected
16
16
databases, or even selected tables within a database.
@@ -21,7 +21,7 @@ See: https://dev.mysql.com/doc/refman/en/replication.html
21
21
22
22
The provided JSON file (` mysql_replica.json ` ) contains a ` Template ` resource that
23
23
groups the Kubernetes and OpenShift resources which are meant to be created.
24
- This template will start with one MySQL master server and one slave server.
24
+ This template will start with one MySQL source server and one replica server.
25
25
26
26
## Persistent storage
27
27
@@ -33,36 +33,36 @@ claimed when the template is instantiated. Refer to the [OpenShift
33
33
documentation] ( https://docs.okd.io/latest/install_config/persistent_storage/persistent_storage_nfs.html )
34
34
to learn how to create persistent volumes.
35
35
36
- ### Service 'mysql-master '
36
+ ### Service 'mysql-source '
37
37
38
38
This resource provides 'headless' Service for the MySQL server(s) which acts
39
- as the 'master '. The headless means that the Service does not use IP
39
+ as the 'source '. The headless means that the Service does not use IP
40
40
addresses but it uses the DNS sub-system. This behavior is configured by setting
41
41
the ` clusterIP ` attribute to ` None ` .
42
42
43
- In this case, you can query the DNS (eg. ` dig mysql-master A +search +short ` ) to
43
+ In this case, you can query the DNS (eg. ` dig mysql-source A +search +short ` ) to
44
44
obtain the list of the Service endpoints (the MySQL servers that subscribe to
45
45
this service).
46
46
47
- ### Service 'mysql-slave '
47
+ ### Service 'mysql-replica '
48
48
49
49
This resource provides the 'headless' Service for the MySQL servers that the
50
- MySQL master uses as 'slaves ' which are used to replicate the data from the
51
- MySQL master .
50
+ MySQL source uses as 'replicas ' which are used to replicate the data from the
51
+ MySQL source .
52
52
53
53
You can use the same DNS lookup as mentioned above to obtain the list of the
54
54
Service endpoints.
55
55
56
- ### ReplicationController 'mysql-master '
56
+ ### ReplicationController 'mysql-source '
57
57
58
58
This resource defines the ` PodTemplate ` of the MySQL server that acts as the
59
- 'master '. The Pod uses the ` quay.io/sclorg/mysql-80-c9s ` image, but it sets the
60
- special 'entrypoint' named ` mysqld-master ` . This will tell the MySQL image to
61
- configure the MySQL server as the 'master '.
59
+ 'source '. The Pod uses the ` quay.io/sclorg/mysql-80-c9s ` image, but it sets the
60
+ special 'entrypoint' named ` mysqld-source ` . This will tell the MySQL image to
61
+ configure the MySQL server as the 'source '.
62
62
63
- To configure the 'master ', you have to provide the credentials for the user that
64
- will act as the 'master ' admin. This user has special privileges to add or
65
- remove 'slaves '.
63
+ To configure the 'source ', you have to provide the credentials for the user that
64
+ will act as the 'source ' admin. This user has special privileges to add or
65
+ remove 'replicas '.
66
66
The other thing you have to provide is the regular MySQL username that you can
67
67
use to connect to the MySQL server. This user has lower privileges and it is
68
68
safe to use it in your application.
@@ -77,19 +77,19 @@ If you want to perform administration tasks, you can also set the
77
77
` MYSQL_ROOT_PASSWORD ` . In that case you will be able to connect to the MySQL
78
78
server as the 'root' user and create more users or more databases.
79
79
80
- Once the MySQL master server is started, it has no slaves preconfigured as the
81
- slaves registers automatically.
80
+ Once the MySQL source server is started, it has no replicas preconfigured as the
81
+ replicas registers automatically.
82
82
83
- Note that currently the multiple-master configuration is not supported (even
84
- though the ` mysql-master ` is defined as ReplicationController. If you increase the
85
- number of replicas, then a new MySQL master server is started, but it will not
86
- receive any slaves . This will be solved in future.
83
+ Note that currently the multiple-source configuration is not supported (even
84
+ though the ` mysql-source ` is defined as ReplicationController. If you increase the
85
+ number of replicas, then a new MySQL source server is started, but it will not
86
+ receive any replicas . This will be solved in future.
87
87
88
- To check that the master MySQL server is working, you can issue the following
89
- command on the master container:
88
+ To check that the source MySQL server is working, you can issue the following
89
+ command on the source container:
90
90
91
91
```
92
- mysql> SHOW MASTER STATUS;
92
+ mysql> SHOW BINARY LOG STATUS;
93
93
+------------------+----------+--------------+------------------+
94
94
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
95
95
+------------------+----------+--------------+------------------+
@@ -98,44 +98,44 @@ mysql> SHOW MASTER STATUS;
98
98
1 row in set (0.00 sec)
99
99
```
100
100
101
- ### ReplicationController 'mysql-slave '
101
+ ### ReplicationController 'mysql-replica '
102
102
103
103
This resource defines the ` PodTemplate ` of the MySQL servers that act as the
104
- ` slaves ` to the ` master ` server. In the provided JSON example, this Replication
105
- Controller starts with 3 slaves . Each ` slave ` server first waits for the ` master `
106
- server to become available (getting the ` master ` server IP using the DNS
107
- lookup). Once the ` master ` is available, the MySQL 'slave ' server is started and
108
- connected to the ` master ` . The unique ` server-id ` configuration property is
104
+ ` replicas ` to the ` source ` server. In the provided JSON example, this Replication
105
+ Controller starts with 3 replicas . Each ` replica ` server first waits for the ` source `
106
+ server to become available (getting the ` source ` server IP using the DNS
107
+ lookup). Once the ` source ` is available, the MySQL 'replica ' server is started and
108
+ connected to the ` source ` . The unique ` server-id ` configuration property is
109
109
generated from the unique IP address of the container (and hashed to a number).
110
- Each ` slave ` must have unique ` server-id ` .
110
+ Each ` replica ` must have unique ` server-id ` .
111
111
112
- Once the ` slave ` is running, it will fetch the database and users from the
113
- ` master ` server, so you don't have to configure the user accounts for this
112
+ Once the ` replica ` is running, it will fetch the database and users from the
113
+ ` source ` server, so you don't have to configure the user accounts for this
114
114
resources.
115
115
116
- To check the 'slave ' status, you can issue the following command on the slave
116
+ To check the 'replica ' status, you can issue the following command on the replica
117
117
container:
118
118
119
119
```
120
- mysql> SHOW SLAVE STATUS\G
120
+ mysql> SHOW REPLICA STATUS\G
121
121
*************************** 1. row ***************************
122
- Slave_IO_State : Waiting for master to send event
123
- Master_Host : 172.17.0.17
124
- Master_User: master
125
- Master_Port : 3306
122
+ Replica_IO_State : Waiting for source to send event
123
+ Source_Host : 172.17.0.17
124
+ Source_User: source
125
+ Source_Port : 3306
126
126
Connect_Retry: 60
127
127
```
128
128
129
- This output means that the 'slave ' is successfully connected to the 'master '
129
+ This output means that the 'replica ' is successfully connected to the 'source '
130
130
MySQL server running on '172.17.0.17'.
131
131
132
- To see the 'slave ' hosts from the 'master ', you can issue the following command
133
- on the 'master ' container:
132
+ To see the 'replica ' hosts from the 'source ', you can issue the following command
133
+ on the 'source ' container:
134
134
135
135
```
136
- mysql> SHOW SLAVE HOSTS;
136
+ mysql> SHOW REPLICA HOSTS;
137
137
+------------+-------------+------+------------+
138
- | Server_id | Host | Port | Master_id |
138
+ | Server_id | Host | Port | Source_id |
139
139
+------------+-------------+------+------------+
140
140
| 3314680171 | 172.17.0.20 | 3306 | 1301393349 |
141
141
| 3532875540 | 172.17.0.18 | 3306 | 1301393349 |
@@ -144,8 +144,8 @@ mysql> SHOW SLAVE HOSTS;
144
144
145
145
```
146
146
147
- You can add more slaves if you want, using the following ` oc ` command.
147
+ You can add more replicas if you want, using the following ` oc ` command.
148
148
149
149
```
150
- $ oc scale rc mysql-slave --replicas=4
150
+ $ oc scale rc mysql-replica --replicas=4
151
151
```
0 commit comments