(转)基于OpenStack构建企业私有云实验环境准备
Posted liujiacai
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了(转)基于OpenStack构建企业私有云实验环境准备相关的知识,希望对你有一定的参考价值。
原文:https://www.unixhot.com/article/407
https://www.cnblogs.com/kevingrace/p/5707003.html-----完整部署CentOS7.2+OpenStack+kvm 云平台环境(1)--基础环境搭建
基于OpenStack构建企业私有云(1)实验环境准备
一.基础软件包安装
1.安装EPEL仓库
2.安装OpenStack仓库
3.安装OpenStack客户端
4.安装openstack SELinux管理包
二.mysql数据库部署
1.MySQL安装
2.修改MySQL配置文件
3.启动MySQL Server并设置开机启动
4.进行数据库安全设置
5.数据库创建
[[email protected] ~]# mysql -u root -p
Enter password:
…
MariaDB [(none)]>
Keystone数据库
CREATE DATABASE keystone;
GRANT ALL PRIVILEGES ON keystone.* TO ‘keystone‘@‘localhost‘ IDENTIFIED BY ‘keystone‘;
GRANT ALL PRIVILEGES ON keystone.* TO ‘keystone‘@‘%‘ IDENTIFIED BY ‘keystone‘;
Glance数据库
CREATE DATABASE glance;
GRANT ALL PRIVILEGES ON glance.* TO ‘glance‘@‘localhost‘ IDENTIFIED BY ‘glance‘;
GRANT ALL PRIVILEGES ON glance.* TO ‘glance‘@‘%‘ IDENTIFIED BY ‘glance‘;
Nova数据库
CREATE DATABASE nova;
GRANT ALL PRIVILEGES ON nova.* TO ‘nova‘@‘localhost‘ IDENTIFIED BY ‘nova‘;
GRANT ALL PRIVILEGES ON nova.* TO ‘nova‘@‘%‘ 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‘;
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‘;
Neutron 数据库
CREATE DATABASE neutron;
GRANT ALL PRIVILEGES ON neutron.* TO ‘neutron‘@‘localhost‘ IDENTIFIED BY ‘neutron‘;
GRANT ALL PRIVILEGES ON neutron.* TO ‘neutron‘@‘%‘ IDENTIFIED BY ‘neutron‘;
Cinder数据库
CREATE DATABASE cinder;
GRANT ALL PRIVILEGES ON cinder.* TO ‘cinder‘@‘localhost‘ IDENTIFIED BY ‘cinder‘;
GRANT ALL PRIVILEGES ON cinder.* TO ‘cinder‘@‘%‘ IDENTIFIED BY ‘cinder‘;
三:消息代理RabbitMQ
1.安装RabbitMQ
2.设置开启启动,并启动RabbitMQ
3.添加openstack用户。
4.给刚才创建的openstack用户,创建权限。
5.启用Web监控插件
1.安装EPEL仓库
# rpm -ivh [url]http://mirrors.aliyun.com/epel ... h.rpm[/url]
2.安装OpenStack仓库
# yum install -y centos-release-openstack-queens
3.安装OpenStack客户端
# yum install -y python-openstackclient
4.安装openstack SELinux管理包
# yum install -y openstack-selinux
二.mysql数据库部署
1.MySQL安装
[[email protected] ~]# yum install -y mariadb mariadb-server python2-PyMySQL
2.修改MySQL配置文件
[[email protected] ~]# vim /etc/my.cnf.d/openstack.cnf [mysqld] bind-address = 192.168.56.11 #设置监听的IP地址 default-storage-engine = innodb #设置默认的存储引擎 innodb_file_per_table = on#使用独享表空间 collation-server = utf8_general_ci #服务器的默认校对规则 character-set-server = utf8 #服务器安装时指定的默认字符集设定 max_connections = 4096 #设置MySQL的最大连接数,生产请根据实际情况设置。
3.启动MySQL Server并设置开机启动
[[email protected] ~]# systemctl enable mariadb.service [[email protected] ~]# systemctl start mariadb.service
4.进行数据库安全设置
[[email protected] ~]# mysql_secure_installation
5.数据库创建
[[email protected] ~]# mysql -u root -p
Enter password:
…
MariaDB [(none)]>
Keystone数据库
CREATE DATABASE keystone;
GRANT ALL PRIVILEGES ON keystone.* TO ‘keystone‘@‘localhost‘ IDENTIFIED BY ‘keystone‘;
GRANT ALL PRIVILEGES ON keystone.* TO ‘keystone‘@‘%‘ IDENTIFIED BY ‘keystone‘;
Glance数据库
CREATE DATABASE glance;
GRANT ALL PRIVILEGES ON glance.* TO ‘glance‘@‘localhost‘ IDENTIFIED BY ‘glance‘;
GRANT ALL PRIVILEGES ON glance.* TO ‘glance‘@‘%‘ IDENTIFIED BY ‘glance‘;
Nova数据库
CREATE DATABASE nova;
GRANT ALL PRIVILEGES ON nova.* TO ‘nova‘@‘localhost‘ IDENTIFIED BY ‘nova‘;
GRANT ALL PRIVILEGES ON nova.* TO ‘nova‘@‘%‘ 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‘;
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‘;
Neutron 数据库
CREATE DATABASE neutron;
GRANT ALL PRIVILEGES ON neutron.* TO ‘neutron‘@‘localhost‘ IDENTIFIED BY ‘neutron‘;
GRANT ALL PRIVILEGES ON neutron.* TO ‘neutron‘@‘%‘ IDENTIFIED BY ‘neutron‘;
Cinder数据库
CREATE DATABASE cinder;
GRANT ALL PRIVILEGES ON cinder.* TO ‘cinder‘@‘localhost‘ IDENTIFIED BY ‘cinder‘;
GRANT ALL PRIVILEGES ON cinder.* TO ‘cinder‘@‘%‘ IDENTIFIED BY ‘cinder‘;
三:消息代理RabbitMQ
1.安装RabbitMQ
[[email protected] ~]# yum install -y rabbitmq-server
2.设置开启启动,并启动RabbitMQ
[[email protected] ~]# systemctl enable rabbitmq-server.service [[email protected] ~]# systemctl start rabbitmq-server.service
3.添加openstack用户。
[[email protected] ~]# rabbitmqctl add_user openstack openstack Creating user "openstack" ...
4.给刚才创建的openstack用户,创建权限。
[[email protected] ~]# rabbitmqctl set_permissions openstack ".*" ".*" ".*" Setting permissions for user "openstack" in vhost "/" ...
5.启用Web监控插件
[[email protected] ~]# rabbitmq-plugins list [[email protected] ~]# rabbitmq-plugins enable rabbitmq_management
以上是关于(转)基于OpenStack构建企业私有云实验环境准备的主要内容,如果未能解决你的问题,请参考以下文章