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、安装

[root@vh01 ~]# yum install -y bind

2、主配置文件

[root@vh01 ~]# vim /etc/named.conf

        listen-on port 53 { any; };

        allow-query     { any; };

[root@vh01 ~]# vim /etc/named.rfc1912.zones

zone "tedu.cn" IN {

        type master;

        file "tedu.cn.zone";

        allow-update { none; };

};

3、区配置文件

[root@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、检查语法

[root@vh01 ~]# named-checkconf /etc/named.conf

[root@vh01 ~]# named-checkconf /etc/named.rfc1912.zones

[root@vh01 ~]# named-checkzone tedu.cn /var/named/tedu.cn.zone

5、验证

[root@vh01 ~]# systemctl start named

[root@vh01 ~]# systemctl enable named

[root@vh02 ~]# nslookup vh01.tedu.cn

 

NTP配置

1、网络时间协议  UDP123

[root@vh01 ~]# yum install -y ntp

[root@vh01 ~]# 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、测试

[root@vh01 ~]# systemctl start ntpd

[root@vh01 ~]# systemctl enable ntpd

[root@vh01 ~]# netstat -ulnp | grep :123

[root@vh02 ~]# date

[root@vh01 ~]# date -s "2017-11-28 15:34:00"

[root@vh02 ~]# ntpdate 192.168.4.1

[root@vh02 ~]# date

配置OPENSTACK

1、关闭NetworkManager

[root@vh02 ~]# systemctl stop NetworkManager

[root@vh02 ~]# systemctl disable NetworkManager

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

[root@vh02 ~]# pvcreate /dev/vdb

[root@vh02 ~]# vgcreate cinder-volumes /dev/vdb

3、导公钥、安装rpm

[root@vh02 ~]# cd openstack/

[root@vh02 openstack]# rpm --import rabbitmq-signing-key-public.asc

[root@vh02 openstack]# yum install -y rpms/*rpm

4、安装openstack部署工具packstack

[root@vh02 openstack]# yum install -y openstack-packstack

5、生成应答文件

[root@vh02 openstack]# packstack --gen-answer-file answer.txt

[root@vh02 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

[root@vh02 openstack]# packstack --answer-file answer.txt

 

网络配置

[root@vh02 openstack]# cd /etc/sysconfig/network-scripts/

[root@vh02 network-scripts]# cp ifcfg-eth0 ifcfg-br-ex

[root@vh02 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

[root@vh02 network-scripts]# vim ifcfg-eth0

TYPE=OVSPort

OVS_BRIDGE=br-ex

DEVICE=eth0

ONBOOT=yes

DEVICETYPE=ovs

[root@vh02 network-scripts]# systemctl restart network

[root@room8pc16 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是有问题的

[root@vh02 ~(keystone_admin)]# openstack-status

重启openstack

[root@vh02 ~(keystone_admin)]# openstack-service restart

 

安装额外计算节点

1vh03.tedu.cn

192.168.4.3/24  192.168.2.3/24  dns: 192.168.4.1

防火墙/selinux

 

[root@vh02 ~]# scp /etc/yum.repos.d/rhel7.repo 192.168.4.3:/etc/yum.repos.d/

[root@vh02 ~]# scp /etc/yum.repos.d/osp8.repo 192.168.4.3:/etc/yum.repos.d/

[root@vh02 ~]# scp -r openstack/ 192.168.4.3:/root

[root@vh03 ~]# cd openstack/

[root@vh03 openstack]# rpm --import rabbitmq-signing-key-public.asc

[root@vh03 openstack]# yum install -y rpms/*rpm

[root@vh02 openstack(keystone_admin)]# vim answer.txt

CONFIG_COMPUTE_HOSTS=192.168.4.2,192.168.4.3

[root@vh02 openstack(keystone_admin)]# packstack --answer-file answer.txt

 

posted @ 2018-05-01 13:32  腐种发芽  阅读(296)  评论(0编辑  收藏  举报