OpenStack Pike Minimal安装:环境准备

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了OpenStack Pike Minimal安装:环境准备相关的知识,希望对你有一定的参考价值。

1.关闭防火墙和selinux

2.配置hosts

[[email protected] ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
20.0.20.21 controller
20.0.20.22 compute

3.配置ntp

yum -y install chrony
[[email protected] ~]# vim /etc/chrony.conf
allow 20.0.20.0/16
server ntp1.aliyun.com iburst 
#compute节点只需同步到controller节点
[[email protected] ~]# systemctl enable chronyd.service
[[email protected] ~]# systemctl start chronyd.service

4.在所有节点上安装openstack

[[email protected] ~]# yum install centos-release-openstack-pike -y
[[email protected] ~]# yum upgrade
[[email protected] ~]# yum install python-openstackclient -y

5.在controller节点上安装数据库

[[email protected] ~]# yum install mariadb mariadb-server python2-Pymysql -y
[[email protected] ~]# cat /etc/my.cnf.d/openstack.cnf
[mysqld]
bind-address = 20.0.20.21
default-storage-engine = innodb
innodb_file_per_table
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
[[email protected] ~]# systemctl enable mariadb.service
[[email protected] ~]# systemctl start mariadb.service
[[email protected] ~]# mysql_secure_installation

6.数据库配置,创建数据库、用户授权

mysql -u root -p

create database keystone;
grant all privileges on keystone.* to ‘keystone‘@‘localhost‘ identified by ‘keystone‘;
grant all privileges on keystone.* to ‘keystone‘@‘%‘ identified by ‘keystone‘;
grant all privileges on keystone.* to ‘keystone‘@‘controller‘ identified by ‘keystone‘;

create database glance;
grant all privileges on glance.* to ‘glance‘@‘localhost‘ identified by ‘glance‘;
grant all privileges on glance.* to ‘glance‘@‘%‘ identified by ‘glance‘;
grant all privileges on glance.* to ‘glance‘@‘controller‘ identified by ‘glance‘;

create database nova;
grant all privileges on nova.* to ‘nova‘@‘localhost‘ identified by ‘nova‘;
grant all privileges on nova.* to ‘nova‘@‘%‘ identified by ‘nova‘;
grant all privileges on nova.* to ‘nova‘@‘controller‘ identified by ‘nova‘;

create database nova_api;
grant all privileges on nova_api.* to ‘nova‘@‘localhost‘ identified by ‘nova‘;
grant all privileges on nova_api.* to ‘nova‘@‘%‘ identified by ‘nova‘;
grant all privileges on nova_api.* to ‘nova‘@‘controller‘ identified by ‘nova‘;

create database nova_cell0;
grant all privileges on nova_cell0.* to ‘nova‘@‘localhost‘ identified by ‘nova‘;
grant all privileges on nova_cell0.* to ‘nova‘@‘%‘ identified by ‘nova‘;
grant all privileges on nova_cell0.* to ‘nova‘@‘controller‘ identified by ‘nova‘;

create database neutron;
grant all privileges on neutron.* to ‘neutron‘@‘localhost‘ identified by ‘neutron‘;
grant all privileges on neutron.* to ‘neutron‘@‘%‘ identified by ‘neutron‘;
grant all privileges on neutron.* to ‘neutron‘@‘controller‘ identified by ‘neutron‘;

flush privileges;
MariaDB [(none)]> select user,host from mysql.user;
+----------+------------+
| user     | host       |
+----------+------------+
| glance   | %          |
| keystone | %          |
| neutron  | %          |
| nova     | %          |
| root     | 127.0.0.1  |
| root     | ::1        |
| glance   | controller |
| keystone | controller |
| neutron  | controller |
| nova     | controller |
| root     | controller |
| glance   | localhost  |
| keystone | localhost  |
| neutron  | localhost  |
| nova     | localhost  |
| root     | localhost  |
+----------+------------+
16 rows in set (0.00 sec)

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| glance             |
| information_schema |
| keystone           |
| mysql              |
| neutron            |
| nova               |
| nova_api           |
| nova_cell0         |
| performance_schema |
+--------------------+
9 rows in set (0.00 sec)

7.在controller节点安装RabbitMQ消息队列

[[email protected] ~]# yum install rabbitmq-server -y
[[email protected] ~]# systemctl enable rabbitmq-server.service
[[email protected] ~]# systemctl start rabbitmq-server.service
[[email protected] ~]# rabbitmqctl add_user openstack openstack
Creating user "openstack" ...
[[email protected] ~]# rabbitmqctl set_permissions openstack ".*" ".*" ".*" 
Setting permissions for user "openstack" in vhost "/" ...
[[email protected] ~]# rabbitmq-plugins enable rabbitmq_management
[[email protected] ~]# lsof -i:15672
COMMAND   PID     USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
beam.smp 3162 rabbitmq   54u  IPv4 449707      0t0  TCP *:15672 (LISTEN)

#访问RabbitMQ,访问地址是http://ip:15672
#默认用户名密码都是guest,浏览器添加openstack用户到组并登陆测试
技术分享图片

8.在controller节点上安装memcached

[[email protected] ~]# yum install memcached python-memcached -y
[[email protected] ~]# systemctl enable memcached.service
[[email protected] ~]# systemctl start memcached.service

以上是关于OpenStack Pike Minimal安装:环境准备的主要内容,如果未能解决你的问题,请参考以下文章

OpenStack Pike Minimal安装:计算服务

OpenStack Pike Minimal安装:身份认证

OpenStack Pike Minimal安装:环境准备

OpenStack pike版 安装openstack服务 续基本环境部署

openstack-pike安装--目录汇总

OpenStack pike版 安装openstack服务 续安装openstack服务