天天看点

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