Centos 7 搭建OpenStack 私有云——(1)基础环境配置
1.简介:
OpenStack是一个由NASA(美国国家航空航天局)和Rackspace合作研发并发起的,以Apache许可证授权的自由软件和开放源代码项目。
OpenStack是一个开源的云计算管理平台项目,由几个主要的组件组合起来完成具体工作。OpenStack支持几乎所有类型的云环境,项目目标是提供实施简单、可大规模扩展、丰富、标准统一的云计算管理平台。OpenStack通过各种互补的服务提供了基础设施即服务(IaaS)的解决方案,每个服务提供API以进行集成。
2.环境准备:
openstack-node1 172.30.10.9
openstack-node2 172.30.10.11
域名解析:
/etc/hosts
172.30.10.9 openstack-node1
172.30.10.11 openstack-node2
关闭selinux:
vi /etc/sysconfig/selinux
SELINUX=disabled
setenforce 0
关闭iptables:
systemctl stop firewalld.service
systemctl disable firewalld.service
3.安装配置OpenStack:
3.1 安装软件包
openstack-node1
*****************************************************************************************
# Base
yum install -y http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm
yum install -y centos-release-openstack-liberty
yum install -y python-openstackclient # Mysql
# 在Centos7中mysql改名为mariadb
yum install -y mariadb mariadb-server MySQL-python # RabbitMQ
yum install -y rabbitmq-server # Keystone
yum install -y openstack-keystone httpd mod_wsgi memcached python-memcached # Glance
yum install -y openstack-glance python-glance python-glanceclient # Nova
yum install -y openstack-nova-api openstack-nova-cert openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler python-novaclient # Neutron
yum install -y openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge python-neutronclient ebtables ipset # Dashboard
yum install -y openstack-dashboard # Cinder
yum install -y openstack-cinder python-cinderclient
openstack-node2
*****************************************************************************************
# Base
yum install -y http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm
yum install centos-release-openstack-liberty
yum install python-openstackclient # Nova
yum install -y openstack-nova-compute sysfsutils # Neutron
yum install -y openstack-neutron openstack-neutron-linuxbridge ebtables ipset # Cinder
yum install -y openstack-cinder python-cinderclient targetcli python-oslo-policy
3.2 时间同步
在openstack-node1上配置:(centos7用chrony,centos6用ntp)
# 安装chrony
[root@openstack-node1 ~]#yum install -y chrony # 配置chrony
[root@openstack-node1 ~]#vi /etc/chrony.conf
# 允许哪些服务器和自己同步
allow 172.30/16 # 设置服务开机启动
[root@openstack-node1 ~]#systemctl enable chronyd.service
[root@openstack-node1 ~]#systemctl start chronyd.service
[root@openstack-node1 ~]#timedatectl set-timezone Asia/Shanghai
[root@openstack-node1 ~]#timedatectl status
在openstack-node2上配置:
# 安装chrony
[root@openstack-node2 ~]#yum install -y chrony # 配置chrony
[root@openstack-node2 ~]#vi /etc/chrony.conf
#只保留一行
server 172.30.10.9 iburst # 设置服务开机启动
[root@openstack-node2 ~]#systemctl enable chronyd.service
[root@openstack-node2 ~]#systemctl start chronyd.service
[root@openstack-node2 ~]#timedatectl set-timezone Asia/Shanghai
[root@openstack-node2 ~]#chronyc sources
3.3 配置mysql
修改配置文件,并初始化mysql
[root@openstack-node1 ~]#cp /usr/share/mariadb/my-medium.cnf /etc/my.cnf
[root@openstack-node1 ~]#vi /etc/my.cnf
# 在[mysqld]下添加下面的参数
[mysqld]
default-storage-engine = innodb
innodb_file_per_table
collation-server = utf8_general_ci
init-connect = 'SET NAMES utf8'
character-set-server = utf8 # 设置开机启动
[root@openstack-node1 ~]#systemctl enable mariadb.service
[root@openstack-node1 ~]#ln -s '/usr/lib/systemd/system/mariadb.service' '/etc/systemd/system/multi-user.target.wants/mariadb.service' # 初始化数据库
[root@openstack-node1 ~]#mysql_install_db --datadir="/var/lib/mysql" --user="mysql"
# 启动mysql
[root@openstack-node1 ~]#systemctl start mariadb.service
# 设置密码及初始化
[root@openstack-node1 ~]#mysql_secure_installation
创建数据库
[root@openstack-node1 ~]#mysql -u root -p
# 创建keystone库,并授权
MariaDB [(none)]> create database keystone;
MariaDB [(none)]> grant all privileges on keystone.* to 'keystone'@'172.30.10.9' identified by 'keystone';
MariaDB [(none)]> grant all privileges on keystone.* to 'keystone'@'%' identified by 'keystone'; # 创建glance库,并授权
MariaDB [(none)]> create database glance;
MariaDB [(none)]> grant all privileges on glance.* to 'glance'@'172.30.10.9' identified by 'glance';
MariaDB [(none)]> grant all privileges on glance.* to 'glance'@'%' identified by 'glance'; # 创建nova库,并授权
MariaDB [(none)]> create database nova;
MariaDB [(none)]> grant all privileges on nova.* to 'nova'@'%' identified by 'nova';
MariaDB [(none)]> grant all privileges on nova.* to 'nova'@'172.30.10.9' identified by 'nova'; # 创建neutron库,并授权
MariaDB [(none)]> create database neutron;
MariaDB [(none)]> grant all privileges on neutron.* to 'neutron'@'172.30.10.9' identified by 'neutron';
MariaDB [(none)]> grant all privileges on neutron.* to 'neutron'@'%' identified by 'neutron'; # 创建cinder库,并授权
MariaDB [(none)]> create database cinder;
MariaDB [(none)]> grant all privileges on cinder.* to 'cinder'@'%' identified by 'cinder';
MariaDB [(none)]> grant all privileges on cinder.* to 'cinder'@'172.30.10.9' identified by 'cinder'; # 刷新数据库
MariaDB [(none)]> flush privileges;
# 查看数据库列表
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| cinder |
| glance |
| information_schema |
| keystone |
| mysql |
| neutron |
| nova |
| performance_schema |
+--------------------+
8 rows in set (0.00 sec)
3.4 安装配置rabbitmq
MQ 全称 Message Queue,消息队列(MQ)是一种应用程序对应用程序的通信方法。应用程序通过读写出入队列的消息(针对应用程序的数据)来通信,而无需专用连接来链接它们。消息传递指的是程序之间通过在消息中发送数据进行通信,而不是通过直接调用彼此来通信,直接调用通常是用于诸如远程过程调用的技术。排队指的是应用程序通过队列来通信。队列的使用出去了接收和发送应用程序同时执行的要求。RabbitMQ是一个在AMQP基础上完整的,可复用的企业消息系统。他遵循Mozilla Public License开源协议。
启动rabbitmq,端口5672,添加openstack用户
# 启动rabbitmq,端口5672,添加openstack用户
[root@openstack-node1 lib]# systemctl enable rabbitmq-server.service
Created symlink from /etc/systemd/system/multi-user.target.wants/rabbitmq-server.service to /usr/lib/systemd/system/rabbitmq-server.service.
[root@openstack-node1 lib]# ln -s '/usr/lib/systemd/system/rabbitmq-server.service''/etc/systemd/system/multi-user.target.wants/rabbitmq-server.service'
[root@openstack-node1 lib]# systemctl start rabbitmq-server.service # 添加用户名和密码
[root@openstack-node1 lib]# rabbitmqctl add_user openstack openstack
Creating user "openstack" ...
# 允许openstack用户配置、写、读访问
[root@openstack-node1 lib]# rabbitmqctl set_permissions openstack ".*" ".*" ".*"
Setting permissions for user "openstack" in vhost "/" ... # 查看支持的插件
[root@openstack-node1 lib]# rabbitmq-plugins list
Configured: E = explicitly enabled; e = implicitly enabled
| Status: * = running on rabbit@openstack-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 # 使用此插件实现web管理
[root@openstack-node1 lib]# 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@openstack-node1... started 6 plugins. # 重启rabbitmq服务
[root@openstack-node1 lib]# systemctl restart rabbitmq-server.service
[root@openstack-node1 lib]# lsof -i:15672
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
beam 33692 rabbitmq 49u IPv4 80606 0t0 TCP *:15672 (LISTEN)
访问rabbitMQ,访问地址http://172.30.10.9:15672 默认用户名密码都是guest
1.点击Admin,创建openstack用户密码
2.点击用户名openstack,在“Update this user”菜单中输入密码及标签(administrator)
3.登出当前用户,使用openstack登录,测试是否创建成功

* 如何使用zabbix监控,可以点击左下角HTTP API的介绍

到这所有基础环境的配置就算完成了,接下来开始安装openstack组件。
Centos 7 搭建OpenStack 私有云——(1)基础环境配置的更多相关文章
- 搭建OpenStack私有云准备工作
Centos7安装完成后克隆其他子节点 首先在VMware中:右击 虚拟机controller-->设置-->添加-->网络适配器,然后做如下设置: 在VMware中操作 点击:克隆 ...
- 四种方案:将OpenStack私有云部署到Hadoop MapReduce环境中
摘要:OpenStack与Hadoop被誉为继Linux之后最有可能获得巨大成功的开源项目.这二者如何结合成为更猛的新方案?业内给出两种答案:Hadoop跑在OpenStack上或OpenStack部 ...
- linux下使用URLOS搭建nextcloud私有云盘系统
Nextcloud是一个免费专业的私有云存储网盘开源项目,可以让你简单快速地在个人/公司电脑.服务器甚至是树莓派等设备上架设一套属于自己或团队专属的云同步网盘,从而实现跨平台跨设备文件同步.共享.版本 ...
- CentOS 8.2 对k8s基础环境配置
一.基础环境配置 1 IP 修改 机器克隆后 IP 修改,使Xshell连接上 [root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg- ...
- Windows 8 64位系统 在VS2010 32位软件上 搭建 PCL点云库 开发环境
Windows 8 64位系统 在VS2010 32位软件上 搭建 PCL点云库 开发环境 下载PCL For windows 软件包 到这个网站下载PCL-All-In-One Installer: ...
- kubernetes基础环境配置
一.基础环境配置 环境详情 主机名(FQDN) IP地址(NAT) 描述 linux-node1.example.com eth0:192.168.56.11 1VCPU.2G内存.一块硬盘s da5 ...
- linux--->阿里云centos6.9环境配置安装lnmp
阿里云centos6.9环境配置安装lnmp mysql安装 本人博客:http://www.cnblogs.com/frankltf/p/8615418.html PHP安装 1.安装依赖关系 yu ...
- 【No.1 Ionic】基础环境配置
Node 安装 git clone https://github.com/nodejs/node cd node ./configure make sudo make install node -v ...
- k8s基础环境配置:基于CentOS7.9
k8s基础环境配置:基于CentOS7.9 wmware15安装centos7.9:https://www.cnblogs.com/uncleyong/p/15261742.html 1.配置静态ip ...
随机推荐
- Visual Studio中的/MD, /MT, /MDd, /MTd 选项
Visual Studio中/MD, /MT, /MDd, /MTd表示多线程模块是否为dll.对于这几个选项我的理解如下: /MD: 定义了_MT和_DLL,让程序用多线程和dll版本的运行库. / ...
- bzoj1266 [AHOI2006]上学路线route floyd+最小割
1266: [AHOI2006]上学路线route Time Limit: 3 Sec Memory Limit: 162 MBSubmit: 2490 Solved: 898[Submit][S ...
- python注解(装饰器)的用法
带参数的要用三层def,第一层写注解里的参数,第二层写函数,第三层写具体逻辑. 如果是不带参数的注解,直接使用后两层即可 def needPermission(permissionstr): def ...
- [03] html 中引入与使用css
1. 使用style属性 <a style="color: red;"> hello ,there use style attribute</a> 2. l ...
- 判断pc还是手机打开跳转到别的网页
function is_mobile() { var regex_match = /(nokia|iphone|android|motorola|^mot-|softbank|foma|docomo| ...
- SecureCRT指南
本文主要介绍SecureCRT的使用方法和技巧. [概念解释]什么是SSH? SSH的英文全称是Secure Shell 传统的网络服务程序,如:FTP和telnet在本质上都是不安全的, 因为它们在 ...
- WCF技术解剖2-TcpTracer路由解析代码
TcpTrace路由解析,参考页面-http://www.cnblogs.com/artech/archive/2008/09/19/1294227.html. TcpTrace工具下载地址:http ...
- 管理页面的类 PageHelper
using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Da ...
- artDialog组件与iframe
背景 组件官网. 未用过的朋友可以先了解下. 当Content参数传递html元素时,官方的解释是: 备注:1.元素不是复制而是完整移动到对话框中,所以原有的事件与属性都将会保留 2.如果隐藏元素被传 ...
- J.U.C并发框架源码阅读(六)ConditionObject
基于版本jdk1.7.0_80 java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject 代码如下 /** * Con ...