天天看點

OpenStack Icehouse neutron-networking 架構 新增計算節點操作詳解

新增計算節點

官方教程中隻包含三個節點,是以根據實際需求我們需要增加計算節點,以建立更多的虛拟機。

1.配置網絡 需要配置兩個網卡

網卡配置

  【eth0】

 IP:10.0.0.41

 netmask:255.255.255.0

 gateway:10.0.0.2

  【eth1】

 IP:10.0.1.41

 (2)設定主機名為compute2

  (3) 确認網絡可用

  計算節點2

  #

ping -c 4 openstack.org 【ping通外網】

ping -c 4 controller 【ping通控制節點的管理網絡】

ping -c 4 network 【ping通網絡節點的管理網絡】

下面開始安裝操作

一.基礎安裝

1.安裝NTP(Network Time

Protocol)

  為做到每個節點的時間同步,需要在每個節點上安裝ntp服務,并在crontab中添加以下計劃任務

1 */5 * * * * /usr/sbin/ntpdate 3.cn.pool.ntp.org >/dev/null 2>&1

2.安裝mysql-python

 #

yum install -y MySQL-python

 3.OpenStack包

  注意:在移除和禁用任何更新服務,都将可能影響你的openstack環境,請在所有節點上執行這些過程

  (1)安裝yum-plugin-priorities

 # yum install -y yum-plugin-priorities

  (2)為了使用RDO源庫,要下載下傳和安裝rdo-release-icehouse包

yum install

-y

https://repos.fedorapeople.org/repos/openstack/EOL/openstack-icehouse/rdo-release-icehouse-4.noarch.rpm

報錯修改yum.repo.d

https://repos.fedorapeople.org/repos/openstack/EOL/openstack-icehouse/epel-6/

  (3)安裝epel源

 #  yum install -y http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

  (4)安裝openstack-utils包

 # yum install -y openstack-utils

  (5)安裝selinux包自動管理openstack

 # yum install -y openstack-selinux

  (6)更新系統包

 # yum -y upgrade

 注意:在更新過程中會包含一個新的核心,請重新啟動你的系統将其激活

二.

1.安裝計算服務包

yum install -y openstack-nova-compute

2.配置核心參數,編輯/etc/sysctl.conf檔案,包含以下選項

  net.ipv4.conf.all.rp_filter=0

  net.ipv4.conf.default.rp_filter=0

  net.bridge.bridge-nf-call-arptables=1

  net.bridge.bridge-nf-call-iptables=1

  net.bridge.bridge-nf-call-ip6tables=1

 B.立即生效核心參數

  # sysctl -p

  (2)安裝Networking元件

 # yum install -y openstack-neutron-ml2 openstack-neutron-openvswitch

3.拷貝compute1 的/etc/nova 及        /etc/neutron 配置檔案至compute2 覆寫即可

注意修改原local_ip

/etc/nova/nova.conf DEFAULT  my_ip 10.0.0.41

/etc/nova/nova.conf DEFAULT  vncserver_proxyclient_address

10.0.0.41

/etc/neutron/plugins/ml2/ml2_conf.ini

ovs  local_ip 10.0.1.41

啟動服務并配置開機啟動

service libvirtd start

service messagebus start

service openstack-nova-compute start

chkconfig libvirtd on

chkconfig messagebus on

chkconfig openstack-nova-compute on

配置OVS服務

 A.啟動OVS服務并配置随機啟動

  # service openvswitch start

  # chkconfig openvswitch on

 B.添加內建橋

  # ovs-vsctl add-br br-int

這裡着重需要注意

建立檔案連結

  # ln -s plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini

  # cp /etc/init.d/neutron-openvswitch-agent

/etc/init.d/neutronopenvswitch-agent.orig

  # sed -i 's,plugins/openvswitch/ovs_neutron_plugin.ini,plugin.ini,g'

   /etc/init.d/neutron-openvswitch-agent

 B.重新開機計算服務

  # service openstack-nova-compute restart

 C.啟動OVS agent和配置開機啟動

  # service neutron-openvswitch-agent start

  # chkconfig neutron-openvswitch-agent on