Sophie

Sophie

distrib > Fedora > 17 > i386 > media > updates > by-pkgid > b50d8ee6d7871fcc13c0677a9364ed59 > files > 211

bcfg2-doc-1.3.0-1.fc17.noarch.rpm

.. -*- 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]