节点 | Eth0(外网) | Eth1(内网) |
controller | 192.77.108.243 | 10.0.0.243 |
compute1 | 192.77.108.244 | 10.0.0.244 |
compute2 | 192.77.108.242 | 10.0.0.242 |
结构图:
2.安装
2.1安装操作系统
三个节点采用CentOS6.5,安装都采用Minimal Desktop方式,其中:
控制节点安装使用手动分区,主要是分出一个LVM分区,方法如下:
(创建一个物理卷即可,不用创建物理卷组)
计算节点的安装采用手动分区。
(如果有多块硬盘,建议先把一块硬盘分成两部分,一个500M,为主分区,挂载/boot,ext4;另一部分做成LVM。其他硬盘也都做成LVM,将所有LVM做成一个卷组,给系统使,系统挂载系统分区、/home,交换分区。)
系统分区--/---磁盘空间一定要大,决定虚拟机存储空间;
/home ; 交换分区; /boot 主要要为主要分区
2.2设置LVM
(只在controller节点,如果没有进行手动分区的话,这步可忽略)(这个主要是提高虚拟机性能)
# pvcreate /dev/sda5
# vgcreate cinder-volumes /dev/sda5
#sed -i ‘/cinder-volume/s/^/#/’ /etc/fstab #去掉开机挂载
3.操作系统配置
(1) /etc/hosts:保证所有结点互相能ping通hostname
(2) /etc/resolv.conf:保证DNS服务器正常
(3) /etc/selinux/config
中设置 SELinux: disabled
(4) sshd config: /etc/ssh/sshd_config: ListenAddress 0.0.0.0
(5) EPEL Repo:
# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
# rpm -Uvh http://www.elrepo.org/elrepo-release-6-5.el6.elrepo.noarch.rpm
# rpm -Uvh http://mirrors.hustunique.com/epel/6/x86_64/epel-release-6-8.noarch.rpm
(6)
rpm -Uvh http://rdo.fedorapeople.org/openstack-icehouse/rdo-release-icehouse.rpm
(7) 更新操作系统到最新版本
# yum -y update
# reboot
4.RDO安装(在控制结点上操作)
(1) yum install -y openstack-packstack
生成RDO配置文件
(2) packstack --gen-answer-file my_answers.txt
修改好配置文件之后
packstack --answer-file my_answers.txt
5.修改应答文件
默认的应答文件有点变化,所以需要调整一下
CONFIG_NOVA_COMPUTE_HOSTS=192.77.108.243,192.77.108.242,192.77.108.244
CONFIG_HEAT_INSTALL=y
CONFIG_KEYSTONE_ADMIN_PW=admin #CONFIG_NEUTRON_L2_PLUGIN=openvswitch CONFIG_NEUTRON_L2_PLUGIN=ml2 CONFIG_NEUTRON_ML2_TYPE_DRIVERS=gre CONFIG_NEUTRON_ML2_TENANT_NETWORK_TYPES=gre CONFIG_NEUTRON_ML2_TUNNEL_ID_RANGES=100:1000 CONFIG_NEUTRON_OVS_TENANT_NETWORK_TYPE=gre CONFIG_NEUTRON_OVS_TUNNEL_RANGES=100:1000 CONFIG_NEUTRON_OVS_TUNNEL_IF=eth1 ######### CONFIG_HEAT_CLOUDWATCH_INSTALL=y CONFIG_HEAT_CFN_INSTALL=y
在我的实际的环境中,我还做下面的调整
CONFIG_SSH_KEY=/root/.ssh/authorized_keys
CONFIG_NTP_SERVERS=1.cn.pool.ntp.org
CONFIG_PROVISION_DEMO=n
CONFIG_CINDER_VOLUMES_CREATE=n
6.调整网络
默认虚拟机是无法访问外网,所以我们需要设置一下。
查看当前网络情况
root@g133 ~]# ovs-vsctl show d5211ea0-c973-4f41-a7f4-69dd0cf7238c Bridge br-int Port br-int Interface br-int type: internal Port patch-tun Interface patch-tun type: patch options: {peer=patch-int} Bridge br-tun Port patch-int Interface patch-int type: patch options: {peer=patch-tun} Port "gre-0a01010a" Interface "gre-0a01010a" type: gre options: {in_key=flow, local_ip="10.1.1.133", out_key=flow, remote_ip="10.1.1.10"} Port br-tun Interface br-tun type: internal Port "gre-0a01010c" Interface "gre-0a01010c" type: gre options: {in_key=flow, local_ip="10.1.1.133", out_key=flow, remote_ip="10.1.1.12"} ovs_version: "1.11.0"没有创建br-ex 在网络节点上
我们需要创建 /etc/sysconfig/network-scripts/ifcfg-br-ex
# cat /etc/sysconfig/network-scripts/ifcfg-br-ex DEVICE=br-ex IPADDR=172.28.1.133 PREFIX=16 ONBOOT=yes调整eth0,注意:一定要加上eth0 的mac地址,不然会出错。
# cat /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 ONBOOT=yes HWADDR=00:E0:81:DE:23:65创建bridge br-ex
ovs-vsctl add-br br-ex这个时候查看网络
# ovs-vsctl show 3a0b7e02-78a1-475e-bc93-5b57a6749aa3 Bridge br-tun Port patch-int Interface patch-int type: patch options: {peer=patch-tun} Port br-tun Interface br-tun type: internal Port "gre-0a01010a" Interface "gre-0a01010a" type: gre options: {in_key=flow, local_ip="10.1.1.133", out_key=flow, remote_ip="10.1.1.10"} Port "gre-0a01010c" Interface "gre-0a01010c" type: gre options: {in_key=flow, local_ip="10.1.1.133", out_key=flow, remote_ip="10.1.1.12"} Bridge br-int Port patch-tun Interface patch-tun type: patch options: {peer=patch-int} Port br-int Interface br-int type: internal Bridge br-ex Port br-ex Interface br-ex type: internal ovs_version: "1.11.0"把bridge和网卡绑定
ovs-vsctl add-port br-ex eth0; service network restart这个时候,你再查看网络
# ovs-vsctl show 3a0b7e02-78a1-475e-bc93-5b57a6749aa3 Bridge br-tun Port patch-int Interface patch-int type: patch options: {peer=patch-tun} Port br-tun Interface br-tun type: internal Port "gre-0a01010a" Interface "gre-0a01010a" type: gre options: {in_key=flow, local_ip="10.1.1.133", out_key=flow, remote_ip="10.1.1.10"} Port "gre-0a01010c" Interface "gre-0a01010c" type: gre options: {in_key=flow, local_ip="10.1.1.133", out_key=flow, remote_ip="10.1.1.12"} Bridge br-int Port patch-tun Interface patch-tun type: patch options: {peer=patch-int} Port br-int Interface br-int type: internal Bridge br-ex Port "eth0" Interface "eth0" Port br-ex Interface br-ex type: internal ovs_version: "1.11.0"比较这几个,应该可以看到变化.
参考文档
http://www.chenshake.com/how-node-installation-centos-6-4-openstack-havana-ovsgre/
https://bugzilla.redhat.com/show_bug.cgi?id=1068962