快速入门Openstack,无脑多节点部署Mitaka(2)--完善ControllerNode的基础建设

参考资料:官方配置文档(http://docs.openstack.org/mitaka/install-guide-rdo/overview.html

上一篇文章我们把NTP和DNS搭好了,还在每个节点安装了openstack packages,那么按照官方的process,还需要进一步配置controller节点,也就是给它加上mysql数据库,rabbitMQ消息队列和Mencached。

SQL Database

在这里我们按照官方文档的推荐,使用的是mariadb数据库,这是mysql的一个分支,完全兼容Mysql。但是openstack是支持多种数据库的,比如postgreSQL。
1.安装packages,不过我安装的时候出现”Could not resolve host: mirror.neu.edu.cn; Unknown error”的报错,原因是我没有指定DNS服务器,解析不到mirror.neu.edu.cn的域名,所以只需要在/etc/resolv.conf下添加nameserver 8.8.8.8(谷歌的)就没问题了

yum install mariadb mariadb-server python2-PyMySQL -y

2.创建和编辑/etc/my.cnf.d/openstack.cnf,其中bind-address是指定管理网络,也就是我们的ManageSubnet(192.168.0.0/24),而剩余的代码就是让它支持UTF-8编码

[mysqld]
bind-address = 192.168.0.17   #controllerNode的Manage IP
default-storage-engine = innodb
innodb_file_per_table
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8

3.启动服务,并设置开机自启

systemctl enable mariadb.service
systemctl start mariadb.service

4.mysql_secure_installation,初始化数据库的密码,当前密码是没有设置的,所以直接敲回车就能通过认证,然后再设置新密码即可。请记住更改后的新密码。为了方便,我把密码设置成123456。

[root@controller my.cnf.d]# 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!

RabbitMQ

1.简介:
RabbitMQ是一个支持多种通信协议的消息通信中间件。通过RabbitMQ能够将各种不同的分布式系统整合在一起,使得分布式系统更加灵活高效的进行协作。RabbitMQ主要的亮点有:

* 可靠:在分布式系统中, 保证消息传递的可靠性是一个很大的难题,比如底层网络的不稳定,或其他的原因导致网络暂时不可达, 都会造成消息丢失。Rabbitmq提供了AMQP协议中的事务机制和ACK机制来保证可靠性,同时也提供了很多的特性,允许你在性能和可靠性之间进行权衡。
* 灵活的路由机制:消息路由到队列之前要经过exchange,不同类型的exchange可以有不同的路由策略。
* 高可用的消息队列:通过镜像队列,可以将消息保存到集群中多个服务器上,保证硬件失效时消息仍然是安全的。
* 支持多种通信协议:RabbitMQ支持AMQP-0.8、AMQP-0.9、AMQP-0.9.1、STOMP、MQTT、AMQP 1.0等多种通信协议。
* 支持多种语言的客户端:RabbitMQ支持Java、Ruby、python、PHP、Erlang、Node.js 等许多的编程语言。
* 易用的管理界面:可以通过web接口的UI来管理和控制服务的每个层面。

2.安装

yum install rabbitmq-server -y 

3.启动服务并设置为开机自启

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

4.创建openstack用户,请记住账号密码,因为以后其他服务想调用rabbitMQ的时候,是需要这个账号和密码做认证的。

rabbitmqctl add_user openstack henry    #openstack是用户名,henry是密码

5.给openstack用户添加读写和执行权限。

rabbitmqctl set_permissions openstack ".*" ".*" ".*"

Memcached

是认证服务,也就是keystone用来存储token的,至于什么是token,下一篇文章部署keystone的时候再顺便说说。

1.安装

yum install memcached python-memcached -y

2.启动服务和开机自启

systemctl enable memcached.service
systemctl start memcached.service
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值