COM_REGISTER_SLAVE

This command is sent by the slave server in order to start MariaDB replication and should be sent before requesting binlog events with COM_BINLOG_DUMP.

The payload is:

Note:

  • Slave hostname, slave user, slave password and slave port are usually not set.
    Some slave replication parameters can be used for such settings (report_host, report_port etc).
  • Replication rank is not set.
  • Master server id is not set as well.

Example of COM_REGISTER_SLAVE

The slave server is configured with:

  • server-id=10101
  • report-host=slave_n_1
  • report-port=23241
 1b 00 00 00 15 75 27 00    00 09 73 6c 61 76 65 5f    .....u'...slave_
 6e 5f 31 00 00 c9 5a 00    00 00 00 00 00 00 00       n_1...Z.......

We can see from the example:

  • server_id [4] = 75 27 00 00 => 10101
  • hostname_len [1] = 09
  • hostname[n] = slave_n_1 (9 bytes)
  • username len [1] = 0 (not set)
  • password len [1] = 0 (not set)
  • slave port [2] = c9 5a => 23241
  • rank [4] = 0
  • master server id = 0

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.