OpenStack入门修炼之组件介绍及数据库、RabbitMQ配置(7)

1.OpenStack各组件介绍

Service Project name Description
Dashboard Horizon 提供一个基于web的自助服务接口,用来和openstack交互。例如生产实例、分配IP地址和配置接入控制等
Compute Nova 管理计算实例的生命周期。功能主要是按需生成、调度、停止虚拟机
Networking Neutron 提供网络连接服务给其他组件,例如给compute提供网络服务;提供API让用户自己定义网络并使用
Block Storage Cinder 提供永久存储块给在运行中的实例
Identify service Keystone 给其他服务提供认证和授权服务
Image service Glance 存储虚拟机磁盘镜像,生成实例时调用glance中的镜像文件

2.数据库配置
OpenStack需要的基础服务:
MySQL:OpenStack各个组件使用,生产环境中需要做集群
RabbitMQ:分布式消息队列,作为OpenStack各个组件的通信枢纽,支持集群
tips:除了Horizon,OpenStack其他组件都需要连接数据库
除了Horizon和Keystone,其他组件都需要连接RabbitMQ

(1)数据库配置,并设置开机自启动

[root@linux-node1 ~]# vi /etc/my.cnf.d/openstack.cnf
[mysqld]
bind-address = 192.168.56.11

default-storage-engine = innodb
innodb_file_per_table
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8

[root@linux-node1 ~]# systemctl enable mariadb.service
[root@linux-node1 ~]# systemctl start mariadb.service

(2)为了保证数据库服务的安全性,运行mysql_secure_installation脚本。特别需要说明的是,为数据库的root用户设置一个适当的密码。

[root@linux-node1 ~]# 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: 123456
Re-enter new password: 123456
Password updated successfully!
Reloading privilege tables..
 ... Success!

3.RabbitMQ配置
(1)设置rabbitmq开机自启动

[root@linux-node1 ~]# systemctl enable rabbitmq-server.service
[root@linux-node1 ~]# systemctl start rabbitmq-server.service

(2)添加openstack用户,并给openstack用户配置读写权限

[root@linux-node1 ~]# rabbitmqctl add_user openstack openstack
Creating user "openstack" ...

[root@linux-node1 ~]# rabbitmqctl set_permissions openstack ".*" ".*" ".*"
Setting permissions for user "openstack" in vhost "/" ...

(3)查看rabbitmq的插件,增加web页面的浏览插件

[root@linux-node1 ~]# rabbitmq-plugins list
 Configured: E = explicitly enabled; e = implicitly enabled
 | Status:   * = running on rabbit@linux-node1
 |/
[  ] amqp_client                       3.6.5
[  ] cowboy                            1.0.3
[  ] cowlib                            1.0.1
[  ] mochiweb                          2.13.1
[  ] rabbitmq_amqp1_0                  3.6.5
[  ] rabbitmq_auth_backend_ldap        3.6.5
[  ] rabbitmq_auth_mechanism_ssl       3.6.5
[  ] rabbitmq_consistent_hash_exchange 3.6.5
[  ] rabbitmq_event_exchange           3.6.5
[  ] rabbitmq_federation               3.6.5
[  ] rabbitmq_federation_management    3.6.5
[  ] rabbitmq_jms_topic_exchange       3.6.5
[  ] rabbitmq_management               3.6.5
[  ] rabbitmq_management_agent         3.6.5
[  ] rabbitmq_management_visualiser    3.6.5
[  ] rabbitmq_mqtt                     3.6.5
[  ] rabbitmq_recent_history_exchange  1.2.1
[  ] rabbitmq_sharding                 0.1.0
[  ] rabbitmq_shovel                   3.6.5
[  ] rabbitmq_shovel_management        3.6.5
[  ] rabbitmq_stomp                    3.6.5
[  ] rabbitmq_top                      3.6.5
[  ] rabbitmq_tracing                  3.6.5
[  ] rabbitmq_trust_store              3.6.5
[  ] rabbitmq_web_dispatch             3.6.5
[  ] rabbitmq_web_stomp                3.6.5
[  ] rabbitmq_web_stomp_examples       3.6.5
[  ] sockjs                            0.3.4
[  ] webmachine                        1.10.3

启用rabbitmq的页面管理插件:

[root@linux-node1 ~]# rabbitmq-plugins enable rabbitmq_management
The following plugins have been enabled:
  mochiweb
  webmachine
  rabbitmq_web_dispatch
  amqp_client
  rabbitmq_management_agent
  rabbitmq_management

Applying plugin configuration to rabbit@linux-node1... started 6 plugins.

[root@linux-node1 ~]# lsof -i:15672
COMMAND   PID     USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
beam    21833 rabbitmq   50u  IPv4  55754      0t0  TCP *:15672 (LISTEN)

(4)使用浏览器访问192.168.56.11:15672,用户名密码:guest
OpenStack入门修炼之组件介绍及数据库、RabbitMQ配置(7)


本文转自 IT_外卖小哥  51CTO博客,原文链接:http://blog.51cto.com/jinlong/2049462


上一篇:《Redis入门指南(第2版)》一2.2 启动和停止Redis


下一篇:百胜软件与阿里共筑信息安全生态系统