小白装openstack(三) 安装数据库等必要服务

来源:互联网 发布:ubuntu 杀死进程 编辑:程序博客网 时间:2024/05/22 05:18

准备

为了下载各种OpenStack packages,我们需要定位一个资源库。

yum install http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epelrelease-7-7.noarch.rpm

这是一个linux扩展包的库;

yum install http://rdo.fedorapeople.org/openstack-kilo/rdo-release-kilo.rpm

这是openstack的库

 yum upgrade

更新一下各种包

# yum install openstack-selinux//管理各项关于openstack 安全的包

安装MariaDB

数据库是装在controller node 上;我装了MariaDB

MariaDB数据库管理系统是MySQL的一个分支,主要由开源社区在维护,采用GPL授权许可 MariaDB的目的是完全兼容MySQL,包括API和命令行,使之能轻松成为MySQL的代替品。在存储引擎方面,使用XtraDB(英语:XtraDB)来代替MySQL的InnoDB。

1.安装数据库包

yum install mariadb mariadb-server MySQL-python

2.编辑配置文件
文件是 /etc/my.cnf.d/mariadb_openstack.cnffile
这个文件本身不存在,需要自己创建。

/etc/my.cnf.d/mariadb_openstack.cnffile 文件内容

[mysqld]bind-address=192.168.11.4//监听的地址,也就是controller地址default-storage-engine = innodbinnodb_file_per_tablecollation-server = utf8_general_ciinit-connect = 'SET NAMES utf8'character-set-server = utf8

3.启动并自启数据库服务

# systemctl enable mariadb.service# systemctl start mariadb.service

4.对数据库进行密码设置,同时可以验证数据库是否正常工作。

# mysql_secure_installationNOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDBSERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!In order to log into MariaDB to secure it, we'll need the currentpassword for the root user. If you've just installed MariaDB, andyou haven't set the root password yet, the password will be blank,so you should just press enter here.Enter current password for root (enter for none):OK, successfully used password, moving on...Setting the root password ensures that nobody can log into the MariaDBroot user without the proper authorisation.Set root password? [Y/n] YNew password:Re-enter new password:Password updated successfully!Reloading privilege tables..... Success!By default, a MariaDB installation has an anonymous user, allowing anyoneto log into MariaDB without having to have a user account created forthem. This is intended only for testing, and to make the installationgo a bit smoother. You should remove them before moving into aproduction environment.Remove anonymous users? [Y/n] Y... Success!Normally, root should only be allowed to connect from 'localhost'. Thisensures that someone cannot guess at the root password from the network.Disallow root login remotely? [Y/n] Y... Success!By default, MariaDB comes with a database named 'test' that anyone canaccess. This is also intended only for testing, and should be removedbefore moving into a production environment.Remove test database and access to it? [Y/n] Y- Dropping test database...... Success!- Removing privileges on test database...... Success!Reloading the privilege tables will ensure that all changes made so farwill take effect immediately.Reload privilege tables now? [Y/n] Y... Success!Cleaning up...All done! If you've completed all of the above steps, your MariaDBinstallation should now be secure.Thanks for using MariaDB!

注意:让你输入初始密码时,没有设置过就直接enter.

安装 Message queue

安装文档:OpenStack uses a message queue to coordinate operations and status information among services. The message queue service typically runs on the controller node. OpenStack supports several message queue services including RabbitMQ, Qpid, and ZeroMQ. However, most distributions that package OpenStack support a particular message queue service.
This guide implements the RabbitMQ message queue service because most distributions support it. If you prefer to implement a different message queue service, consult the documentation associated with it.
翻译:OpenStack 使用 message queue在各个服务之间协调状态信息和操作。 message queue安装在controller node上,OpenStack支持多种 message queue服务,如RabbitMQ, Qpid, and ZeroMQ。而大多数的linux版本支持一种特定的 message queue服务,本文选择 RabbitMQ是因为大多数linux版本支持它。

1.安装message queue

 yum install rabbitmq-server

2.启动并自启服务

# systemctl enable rabbitmq-server.service# systemctl start rabbitmq-server.service

3.对RabbitMQ进行密码设置,同时可以验证该服务是否正常工作。

#rabbitmqctl add_user openstack 123456//创建openstack 用户,密码123456Creating user "openstack" ......done.
# rabbitmqctl set_permissions openstack ".*" ".*" ".*"//给该用户赋予最大的权限Setting permissions for user "openstack" in vhost "/" ......done.
0 0