summaryrefslogtreecommitdiffstats
path: root/doc/server/plugins/generators/examples/genshi/mycnf.txt
diff options
context:
space:
mode:
Diffstat (limited to 'doc/server/plugins/generators/examples/genshi/mycnf.txt')
-rw-r--r--doc/server/plugins/generators/examples/genshi/mycnf.txt31
1 files changed, 31 insertions, 0 deletions
diff --git a/doc/server/plugins/generators/examples/genshi/mycnf.txt b/doc/server/plugins/generators/examples/genshi/mycnf.txt
new file mode 100644
index 000000000..76e2fc2bb
--- /dev/null
+++ b/doc/server/plugins/generators/examples/genshi/mycnf.txt
@@ -0,0 +1,31 @@
+.. -*- mode: rst -*-
+
+my.cnf
+======
+
+The following template generates a ``server-id`` based on the last two
+numeric parts of the IP address. The "slave" portion of the configuration
+only applies to machines in the "slave" group::
+
+ {% python
+ import socket
+ parts = socket.gethostbyname(metadata.hostname).split('.')
+ server_id = parts[2] + parts[3]
+ %}\
+ [mysqld]
+
+ # [snip]
+
+ server-id = ${server_id}
+
+ # Replication configuration
+
+ {% if "slave" in metadata.groups %}\
+ relay-log = /data01/mysql/log/mysql-relay-bin
+ log-slave-updates = 1
+ {% end %}\
+ sync-binlog = 1
+ #read-only = 1
+ #report-host = <server fqdn>
+
+ # [snip]