(1)安装mariadb软件包
# yum install mariadb mariadb-server python2-PyMySQL
创建并编辑 /etc/my.cnf.d/openstack.cnf,然后完成如下动作:1)在 [mysqld] 部分,设置 `bind-address`值为控制节点的管理网络IP地址以使得其它节点可以通过管理网络访问数据库:
[mysqld]
bind-address = 172.16.70.203
default-storage-engine = innodb
innodb_file_per_table
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
启动数据库服务,并将其配置为开机自启:
# systemctl enable mariadb.service
# systemctl start mariadb.service
2)设置数据库安全密码
为了保证数据库服务的安全性,运行``mysql_secure_installation``脚本。特别需要说明的是,为数据库的root用户设置一个适当的密码。
[[email protected] ~]# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, 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 MySQL
root user without the proper authorisation.
Set root password? [Y/n] <– 是否设置root用户密码,输入y并回车或直接回车
New password: <– 设置root用户的密码
Re-enter new password: <– 再输入一次你设置的密码
Password updated successfully!
Reloading privilege tables..
… Success!
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL 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] <– 是否删除匿名用户,生产环境建议删除,所以直接回车
… 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] <–是否禁止root远程登录,根据自己的需求选择Y/n并回车,建议禁止
… Success!
By default, MySQL 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] <– 是否删除test数据库,直接回车
- 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] <– 是否重新加载权限表,直接回车
… Success!
Cleaning up…
All done! If you've completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!
(2)安装rabbitmq软件包
1)# yum -y install rabbitmq-server
启动消息队列服务并将其配置为随系统启动:
# systemctl enable rabbitmq-server.service
# systemctl start rabbitmq-server.service
2)添加 openstack 用户:
# rabbitmqctl add_user openstack RABBIT_PASS
Creating user "openstack" ...
...done.
用合适的密码替换 RABBIT_PASS。
3)给``openstack``用户配置写和读权限:
# rabbitmqctl set_permissions openstack ".*" ".*" ".*"
Setting permissions for user "openstack" in vhost "/" ...
...done.
4)RabbitMQ web管理
启用WEB管理:# rabbitmq-plugins enable rabbitmq_management
创建管理员用户,因为缺省的guest/guest用户只能在本地登录,所以先用命令行创建一个admin/123456,并让他成为管理员。
#rabbitmqctl add_user admin 123456
#rabbitmqctl set_user_tags admin administrator
现在可用使用浏览器访问管理台,就用刚才创建的admin登录即可,端口是15672。
(3)安装Memcached
认证服务认证缓存使用Memcached缓存令牌。缓存服务memecached运行在控制节点。
1)安装软件包:
# yum -y install memcached python-memcached
2)配置vim /etc/sysconfig/memcached
[[email protected] sysconfig]# vim memcached
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="64"
OPTIONS="" #设置为空,让所有IP都可以访问
•启动Memcached服务,并且配置它随机启动。
# systemctl enable memcached.service# systemctl start memcached.service
在另一台主机上测试访问memcached :# telnet 172.16.70.204 11211