Skip to content

Configuration

ByteWatch edited this page Dec 27, 2018 · 3 revisions

Configuration of dolphinbeat is very simple, you can have a look at toml.sample to start quickly.

However, you can have a further study by reading this page.

Election options

When the election feature enabled, you can run multi dolphinbeat instances in the same time. A leader will be determined base on zookeeper, and only leader dolphinbeat will work. When leader is dead, one dolphinbeat follower will become new leader.

If you want to have a high available dolphinbeat, you should enable the election feature.

Sample configuration

[election]
  enabled = false
  zk_hosts = "172.17.0.2:2181"
  zk_path = "/dolphinbeat/nodes"
  # The lease of leader, in seconds
  lease = 40

Checkpoint options

When dolphinbeat pushs incremental update into sinks continuously, the progress infos (or checkpoints) of each sink are saved at specified interval, default is every 10 seconds.

Checkpoints can help dolphinbeat recover faster when crash recover. After recovering, dolphinbeat will know the binlog position or GTID_SET at which it can continue to pull binlog from MySQL.

Sample configuration

[checkpoint]
  interval = 10
  storage = "file"
  dir = "../etc"
  #storage = "zookeeper"
  #zk_hosts = "172.17.0.2:2181"
  #zk_path = "/dolphinbeat/ckp"

Following are some options about checkpoint.

interval

The interval time at which dolphinbeat saves checkpoints. It is in seconds.

storage

The storage of checkpoints, may be:

  • file
  • zookeeper

Checkpoints are saved in file default. If you want to have a high available dolphinbeat, you should save it in zookeeper.

If "file" choosed, you should also set dir options.

If "zookeeper" choosed, you should also set zk_hosts and zk_path.

Schema tracker options

Dolphinbeat can parse DDL statement and replay DDL upon it's own schema data in memory. When DDL is replayed successfully, new schema data will be saved in BoltDB or MySQL.

Sample configuration

[schema_tracker]
  storage = "boltdb"
  dir = "../etc"
  #storage = "mysql"
  #addr="172.17.0.3:3306"
  #user="root"
  #password=""
  #database="test"

Following are some options about checkpoint.

storage

The storage of schema data, may be:

  • boltdb
  • mysql

Schema data is saved in boltdb default. If you want to have a high available dolphinbeat, you should save it in mysql.

If "boltdb" choosed, you should also set dir options.

If "mysql" choosed, you should also set addr , user, password and database options.