SQL数据库

SQL数据库

大多数 OpenStack 服务使用 SQL 数据库来存储信息。 典型地,数据库运行在控制节点上。指南中的步骤依据不同的发行版使用MariaDB或 MySQL。OpenStack 服务也支持其他 SQL 数据库,包括`PostgreSQL <http://www.postgresql.org/>`__.

安全并配置组件

  1. 安装软件包:

    # zypper install mariadb-client mariadb python-PyMySQL
    
  1. 创建并编辑 /etc/mysql/conf.d/mariadb_openstack.cnf,然后完成如下动作:

    • [mysqld] 部分,设置 ``bind-address``值为控制节点的管理网络IP地址以使得其它节点可以通过管理网络访问数据库:

      [mysqld]
      ...
      bind-address = 10.0.0.11
      
    • 在``[mysqld]`` 部分,设置如下键值来启用一起有用的选项和 UTF-8 字符集:

      [mysqld]
      ...
      default-storage-engine = innodb
      innodb_file_per_table
      collation-server = utf8_general_ci
      character-set-server = utf8
      

完成安装

  1. 启动数据库服务,并将其配置为开机自启:

    # systemctl enable mysql.service
    # systemctl start mysql.service
    
  1. 执行 mysql_secure_installation 脚本来对数据库进行安全加固。

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.