packstack + vxlan 利用vbox虚拟机搭建1控制节点+2计算节点openstack

1.实验环境

先参照笔者另一篇博文http://blog.csdn.net/u010366748/article/details/45366045(packstack allinone + vxlan 用vbox的虚拟机搭建openstack(单节点双网卡) )的第一步配置好实验环境(3台机器都要配置好)

2.搭建openstack

(1).启动虚拟机(当物理机用)后,为其配置网卡

节点 eth0(management network ) eth1(public/external    network ) eth2(private network) eth3
controller1 10.20.0.201 172.16.0.201 192.168.4.201 nat
compute1 10.20.0.202 172.16.0.201 192.168.4.201 nat
compute2 10.20.0.203 172.16.0.201 192.168.4.201 nat

下面给出compute1的网卡配置为例,另外的controller1和compute2可参考此配置

[root@compute1 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=10.20.0.202
NETMASK=255.255.255.0
[root@compute1 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=172.16.0.202
NETMASK=255.255.255.0
[root@compute1 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth2
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.4.202
NETMASK=255.255.255.0
[root@compute1 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth3
DEVICE=eth3
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=dhcp

(2).其他公共配置(all nodes)
修改hosts文件
vi /etc/hosts

      127.0.0.1 localhost
      ::1 localhost
      10.20.0.201 controller1
      10.20.0.202 compute1
      10.20.0.203 compute2
安装NTP 服务
      yum install ntp -y
      service ntpd start
      chkconfig ntpd on
修改NTP配置文件,配置从controller0时间同步。(除了controller0以外)
      vi /etc/ntp.conf
      server 10.20.0.201
      fudge 10.20.0.201 stratum 10 # LCL is unsynchronized

立即同步并检查时间同步配置是否正确。(除了controller0以外)
      ntpdate -u 10.20.0.201
      service ntpd restart
      ntpq -p
清空防火墙规则
      vi /etc/sysconfig/iptables
      *filter
      :INPUT ACCEPT [0:0]
      :FORWARD ACCEPT [0:0]
      :OUTPUT ACCEPT [0:0]
      COMMIT
重启防火墙,查看是否生效
      service iptables restart
      iptables -L
禁用 selinux
      vi /etc/selinux/config

    SELINUX=disabled

    reboot -h 0
(3).安装
yum install -y https://repos.fedorapeople.org/repos/openstack/openstack-icehouse/rdo-release-icehouse-4.noarch.rpm
yetall openstack-packstack
产生应答文件:
packstack –gen-answer-file=myanswer.txt
vi myanswer.txt

CONFIG_CONTROLLER_HOST=10.20.0.201
CONFIG_COMPUTE_HOSTS=10.20.0.202,10.20.0.203
CONFIG_NETWORK_HOSTS=10.20.0.201
CONFIG_VCENTER_HOST=10.20.0.201
CONFIG_STORAGE_HOST=10.20.0.201
CONFIG_AMQP_HOST=10.20.0.201
CONFIG_MARIADB_HOST=10.20.0.201
CONFIG_KEYSTONE_ADMIN_PW=admin
CONFIG_KEYSTONE_DEMO_PW=demo
CONFIG_NOVA_COMPUTE_PRIVIF=eth2
CONFIG_NOVA_NETWORK_PUBIF=eth1
CONFIG_NOVA_NETWORK_PRIVIF=eth2
CONFIG_NOVA_NETWORK_FIXEDRANGE=
CONFIG_NOVA_NETWORK_FLOATRANGE=
CONFIG_MONGODB_HOST=10.20.0.201
......
其他仍为默认项

packstack –answer-file=myanswer.txt

这一过程比较漫长

测试:
cat keystonerc_admin
vi /etc/nova/nova.conf
service openstack-nova-compute restart
service openstack-nova-scheduler restart
vi /etc/sysconfig/network-scripts/ifcfg-eth1
vi /etc/sysconfig/network-scripts/ifcfg-br-ex
vi /etc/neutron/plugin.ini
service network restart
service neutron-openvswitch-agent restart
service neutron-metadata-agent restart
service neutron-dhcp-agent restart
service neutron-l3-agent restart
ping 172.16.0.4
ssh 172.16.0.4 -l cirros
nova-manage vm list
. keystonerc_admin
nova-manage service list
neutron agent-list
service openstack-nova-compute stop
nova-manage service list
neutron agent-list

你可能感兴趣的:(虚拟机,云计算,openstack,多节点部署)