MySQL / MariaDB

Technically MidoNet only relies on the Neutron and Keystone tables, but for completeness and ease of use a full backup of the database is recommended.



To ensure that Neutron’s MySQL database and MidoNet’s ZooKeeper data are in sync, set the MidoNet API to read-only before starting the backup.

Backup both MySQL database and ZooKeeper data (as described in the section called “ZooKeeper”) at the same time!

  1. Set MidoNet API to READONLY

    Set the MidoNet API to READONLY to avoid topology changes during the backup process:

    # midonet-cli
    midonet> set system-state availability READONLY
  2. Create Database Dump

    Use the mysqldump command to create a database backup:

    # mysqldump \
       -uroot -p_*password*_ \
       --lock-tables --events --routines --triggers --all-databases | \
      gzip > /tmp/ost_backup/data/ost_database.sql.gz
  3. Create ZooKeeper Backup

    Create the ZooKeeper backup (as described in the section called “ZooKeeper”) to ensure that MySQL and ZooKeeper data are in sync.

  4. Reset MidoNet API to READWRITE

    Reset the MidoNet API to READWRITE:

    # midonet-cli
    midonet> set system-state availability READWRITE


  1. Stop Affected Services

    Stop all services that access the database.

    This includes, but is not limited to the following services (depending on your OpenStack installation):


    # service apache2 stop
    # service keystone stop
    # service neutron-server stop


    # systemctl stop openstack-keystone.service
    # systemctl stop neutron-server.service
    # systemctl stop httpd.service
  2. Restore Database Dump

    # gunzip -c /tmp/ost_backup/data/ost_database.sql.gz | mysql -uroot -p_*password*_
  3. Restart Services

    Restart the services.


    # service apache2 start
    # service keystone start
    # service neutron-server start


    # systemctl start openstack-keystone.service
    # systemctl start neutron-server.service
    # systemctl start httpd.service
Questions? Discuss on Mailing Lists or Chat.
Found an error? Report a bug.

loading table of contents...