Openstack

Posted 腐种发芽

tags:

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

Openstack

一、准备环境

1、配置两台虚拟机

vh01.tedu.cn 192.168.4.1/24   DNS服务器 NTP服务器

vh02.tedu.cn 192.168.4.2/24 192.168.2.2/24 OPENSTACK服务器

    DNS指向192.168.4.1 内存4G以上,加一块20G的额外硬盘

2、初始化虚拟机

   关闭防火墙/selinux

3、配置yum仓库

需要RHEL7安装光盘仓库,还需要osp光盘。osp光盘中的每一个目录都是一个仓库

 

二、DNS服务器

1、安装

[[email protected] ~]# yum install -y bind

2、主配置文件

[[email protected] ~]# vim /etc/named.conf

        listen-on port 53 { any; };

        allow-query     { any; };

[[email protected] ~]# vim /etc/named.rfc1912.zones

zone "tedu.cn" IN {

        type master;

        file "tedu.cn.zone";

        allow-update { none; };

};

3、区配置文件

[[email protected]vh01 ~]# vim /var/named/tedu.cn.zone

$TTL    86400

@       IN      SOA     vh01.tedu.cn.   root.tedu.cn. (

                                20171101

                                3H

                                15M

                                1W

                                1D )

        IN      NS      vh01.tedu.cn.

$generate       1-9     vh0$    IN      A       192.168.4.$

$generate       10-254  vh$     IN      A       192.168.4.$

4、检查语法

[[email protected] ~]# named-checkconf /etc/named.conf

[[email protected] ~]# named-checkconf /etc/named.rfc1912.zones

[[email protected] ~]# named-checkzone tedu.cn /var/named/tedu.cn.zone

5、验证

[[email protected] ~]# systemctl start named

[[email protected] ~]# systemctl enable named

[[email protected] ~]# nslookup vh01.tedu.cn

 

NTP配置

1、网络时间协议  UDP123

[[email protected] ~]# yum install -y ntp

[[email protected] ~]# vim /etc/ntp.conf

restrict 192.168.4.0 mask 255.255.255.0 nomodify

#server 0.rhel.pool.ntp.org iburst

#server 1.rhel.pool.ntp.org iburst

#server 2.rhel.pool.ntp.org iburst

#server 3.rhel.pool.ntp.org iburst

server 127.127.1.0 iburst

fudge 127.127.1.0 stratum 3    #第三层NTP服务器

2、测试

[[email protected] ~]# systemctl start ntpd

[[email protected] ~]# systemctl enable ntpd

[[email protected] ~]# netstat -ulnp | grep :123

[[email protected] ~]# date

[[email protected] ~]# date -s "2017-11-28 15:34:00"

[[email protected] ~]# ntpdate 192.168.4.1

[[email protected] ~]# date

配置OPENSTACK

1、关闭NetworkManager

[[email protected] ~]# systemctl stop NetworkManager

[[email protected] ~]# systemctl disable NetworkManager

2、创建名为cinder-volumes的卷组,用于为云主机提供云硬盘

[[email protected] ~]# pvcreate /dev/vdb

[[email protected] ~]# vgcreate cinder-volumes /dev/vdb

3、导公钥、安装rpm

[[email protected] ~]# cd openstack/

[[email protected] openstack]# rpm --import rabbitmq-signing-key-public.asc

[[email protected] openstack]# yum install -y rpms/*rpm

4、安装openstack部署工具packstack

[[email protected] openstack]# yum install -y openstack-packstack

5、生成应答文件

[[email protected] openstack]# packstack --gen-answer-file answer.txt

[[email protected] openstack]# vim answer.txt

CONFIG_DEFAULT_PASSWORD=redhat

CONFIG_SWIFT_INSTALL=n

CONFIG_NTP_SERVERS=192.168.4.1

ONFIG_KEYSTONE_ADMIN_PW=redhat

CONFIG_CINDER_VOLUMES_CREATE=n

CONFIG_NEUTRON_ML2_VXLAN_GROUP=239.1.1.2

CONFIG_NEUTRON_ML2_VNI_RANGES=1001:2000

CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=physnet1:br-ex

CONFIG_NEUTRON_OVS_TUNNEL_IF=eth1

CONFIG_PROVISION_DEMO=n

6、安装openstack

[[email protected] openstack]# packstack --answer-file answer.txt

 

网络配置

[[email protected] openstack]# cd /etc/sysconfig/network-scripts/

[[email protected] network-scripts]# cp ifcfg-eth0 ifcfg-br-ex

[[email protected] network-scripts]# vim ifcfg-br-ex

TYPE=OVSBridge

DEVICETYPE=ovs

BOOTPROTO=none

NAME=br-ex

DEVICE=br-ex

ONBOOT=yes

IPADDR=192.168.4.2

PREFIX=24

DNS1=192.168.4.1

[[email protected] network-scripts]# vim ifcfg-eth0

TYPE=OVSPort

OVS_BRIDGE=br-ex

DEVICE=eth0

ONBOOT=yes

DEVICETYPE=ovs

[[email protected] network-scripts]# systemctl restart network

[[email protected] cloud]# firefox http://192.168.4.2 &

 

 

http://mirrors.163.com/

http://mirrors.aliyun.com/

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

IaaS:云主机

PaaS:组件、中间件

SaaS:软件

 

HorizonWeb管理门户

Keystone:认证管理

Cinder:云硬盘

Glance:镜像管理

Neutron:网络管理

Nova:云主机管理

 

手工引导

1、重起系统后,在第一个菜单上按c

2、设置根分区

grub> set root=(hd0,msdos1)   相当于是vda1

3、指定内核

grub> linux16 /vmlinuz-3.10<tab> root=/dev/rhel/root

4、指定初始化内存盘的位置

grub> initrd16 /initamfs-3.10<tab>.img

5、起动

grub> boot

 

查看状态,activeinactive都是正常的,failed是有问题的

[[email protected] ~(keystone_admin)]# openstack-status

重启openstack

[[email protected] ~(keystone_admin)]# openstack-service restart

 

安装额外计算节点

1vh03.tedu.cn

192.168.4.3/24  192.168.2.3/24  dns: 192.168.4.1

防火墙/selinux

 

[[email protected] ~]# scp /etc/yum.repos.d/rhel7.repo 192.168.4.3:/etc/yum.repos.d/

[[email protected] ~]# scp /etc/yum.repos.d/osp8.repo 192.168.4.3:/etc/yum.repos.d/

[[email protected] ~]# scp -r openstack/ 192.168.4.3:/root

[[email protected] ~]# cd openstack/

[[email protected] openstack]# rpm --import rabbitmq-signing-key-public.asc

[[email protected] openstack]# yum install -y rpms/*rpm

[[email protected] openstack(keystone_admin)]# vim answer.txt

CONFIG_COMPUTE_HOSTS=192.168.4.2,192.168.4.3

[[email protected] openstack(keystone_admin)]# packstack --answer-file answer.txt

 

以上是关于Openstack的主要内容,如果未能解决你的问题,请参考以下文章

OpenStackOpenStack系列15之OpenStack高可用详解

OpenStackOpenStack与云计算概述

OpenStack概念

Openstack

OpenStack基础知识(持续更新)!

openstack-5computer(计算服务)