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

准备

为了下载各种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 = innodb
innodb_file_per_table
collation-server = utf8_general_ci
init-connect = 'SET NAMES utf8'
character-set-server = utf8

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

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

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

# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you 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 MariaDB
root user without the proper authorisation.
Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] Y
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures 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 can
access. This is also intended only for testing, and should be removed
before 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 far
will 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 MariaDB
installation 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 用户,密码123456
Creating user "openstack" ...
...done.
# rabbitmqctl set_permissions openstack ".*" ".*" ".*"//给该用户赋予最大的权限
Setting permissions for user "openstack" in vhost "/" ...
...done.
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值