[部署篇8]VMWare搭建Openstack——计算节点的Neutron安装

本例是按照部署两台物理机来搭建的Openstack,如果需要三台物理机,一台控制节点,一台网络+计算节点,另外一台计算节点的话,那么部署单独的计算节点,就不需要参考【部署7】的部分了,直接在计算节点进行部署了,但是如果要部署一个计算+网络的节点,就需要参考【部署7+8】了,因为虽然你看到大部分都是相同的配置信息,但是还是有相关的差别的。


而且还有一个就是单独的计算节点部署,也要参考【部署7】为机器设置双网卡和IP信息。


一、预备工作
1. 编辑/etc/sysctl.conf文件,
     [ sudo vi /etc/sysctl.conf ]


     更新设置如下:
net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.default.rp_filter=0

2. 执行命令
     sudo sysctl -p

sm@computer:~$ sudo sysctl -p
net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.all.rp_filter = 0


由于我是计算和网络一个节点,所以看到的信息包括原来网络节点更新的内容。



二、安装网络服务neutron
1. 安装网络服务包
     sudo apt-get install neutron-common neutron-plugin-ml2 neutron-plugin-openvswitch-agent openvswitch-datapath-dkms



2. 编辑/etc/neutron/neutron.conf文件,设置数据库、消息服务及IP相关参数,
     [ sudo vi /etc/neutron/neutron.conf ]


     更新设置如下:

core_plugin = neutron.plugins.ml2.plugin.Ml2Plugin
service_plugins = neutron.services.l3_router.l3_router_plugin.L3RouterPlugin
auth_strategy = keystone
dhcp_agent_notification = True
rpc_backend = neutron.openstack.common.rpc.impl_kombu
control_exchange = neutron
rabbit_host = 192.168.3.180
rabbit_password = mq4smtest
rabbit_port = 5672
rabbit_userid = guest
auth_host = 192.168.3.180
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = neutron
admin_password = neutron4smtest
signing_dir = $state_path/keystone-signing
service_provider=VPN:openswan:neutron.services.vpn.service_drivers.ipsec.IPsecVPNDriver:default
sm@computer:~$ sudo grep ^[a-z] /etc/neutron/neutron.conf
state_path = /var/lib/neutron
lock_path = $state_path/lock
core_plugin = neutron.plugins.ml2.plugin.Ml2Plugin
service_plugins = neutron.services.l3_router.l3_router_plugin.L3RouterPlugin
auth_strategy = keystone
dhcp_agent_notification = True
rpc_backend = neutron.openstack.common.rpc.impl_kombu
control_exchange = neutron
rabbit_host = 192.168.3.180
rabbit_password = mq4smtest
rabbit_port = 5672
rabbit_userid = guest
notification_driver = neutron.openstack.common.notifier.rpc_notifier
root_helper = sudo /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf
auth_host = 192.168.3.180
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = neutron
admin_password = neutron4smtest
signing_dir = $state_path/keystone-signing
service_provider=VPN:openswan:neutron.services.vpn.service_drivers.ipsec.IPsecVPNDriver:default


3. 编辑/etc/neutron/plugins/ml2/ml2_conf.ini文件,
     [ sudo vi /etc/neutron/plugins/ml2/ml2_conf.ini ]


     更新设置如下:
type_drivers = flat,vlan,gre
tenant_network_types = vlan,gre
mechanism_drivers = openvswitch

enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
sm@computer:~$ sudo grep ^[a-z] /etc/neutron/plugins/ml2/ml2_conf.ini
type_drivers = flat,vlan,gre
tenant_network_types = vlan,gre
mechanism_drivers = openvswitch
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver

3. 编辑 /etc/nova/nova.conf文件,
     [ sudo vi  /etc/nova/nova.conf ]


     更新设置如下:
# add follows in the [DEFAULT] section
linuxnet_interface_driver=nova.network.linux_net.LinuxOVSInterfaceDriver
firewall_driver=nova.virt.firewall.NoopFirewallDriver
network_api_class=nova.network.neutronv2.api.API
security_group_api=neutron
neutron_url=http://192.168.3.180:9696
neutron_auth_strategy=keystone
neutron_admin_tenant_name=service
neutron_admin_username=neutron
neutron_admin_password=neutron4smtest
neutron_admin_auth_url=http://192.168.3.180:35357/v2.0
metadata_listen=0.0.0.0
metadata_host=192.168.3.180
service_neutron_metadata_proxy=True
neutron_metadata_proxy_shared_secret=neutron4smtest
vif_plugging_timeout = 10
vif_plugging_is_fatal = False
sm@computer:~$ sudo more /etc/nova/nova.conf
[DEFAULT]
dhcpbridge_flagfile=/etc/nova/nova.conf
dhcpbridge=/usr/bin/nova-dhcpbridge
logdir=/var/log/nova
state_path=/var/lib/nova
lock_path=/var/lock/nova
force_dhcp_release=True
iscsi_helper=tgtadm
libvirt_use_virtio_for_bridges=True
connection_type=libvirt
root_helper=sudo nova-rootwrap /etc/nova/rootwrap.conf
verbose=True
ec2_private_dns_show_ip=True
api_paste_config=/etc/nova/api-paste.ini
volumes_path=/var/lib/nova/volumes
enabled_apis=ec2,osapi_compute,metadata

rpc_backend = rabbit
rabbit_host = 192.168.3.180
rabbit_userid = guest
rabbit_password = mq4smtest
rabbit_port = 5672

my_ip = 192.168.3.181
vnc_enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = 192.168.3.181
vnc_enabled = True
novncproxy_base_url = http://192.168.3.180:6080/vnc_auto.html
auth_strategy = keystone
glance_host = 192.168.3.180

vif_plugging_timeout = 10
vif_plugging_is_fatal = False

linuxnet_interface_driver=nova.network.linux_net.LinuxOVSInterfaceDriver
firewall_driver=nova.virt.firewall.NoopFirewallDriver
network_api_class=nova.network.neutronv2.api.API
security_group_api=neutron

# specify Neutron endpoint
neutron_url=http://192.168.3.180:9696

# specify auth info for keystone
neutron_auth_strategy=keystone
neutron_admin_tenant_name=service
neutron_admin_username=neutron
neutron_admin_password=neutron4smtest
neutron_admin_auth_url=http://192.168.3.180:35357/v2.0
metadata_listen=0.0.0.0

# specify Control node
metadata_host=192.168.3.180
service_neutron_metadata_proxy=True

# specify metadata secret key (it is just the value you set in the Network node)
neutron_metadata_proxy_shared_secret=neutron4smtest



[keystone_authtoken]
auth_uri = http://192.168.3.180:5000
auth_host = 192.168.3.180
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = nova
admin_password = nova4smtest

[database]
connection = mysql://novadbadmin:nova4smtest@192.168.3.180/nova


4. 配置Open vSwitch服务
     sudo service openvswitch-switch restart


6. 重启服务
    sudo service nova-compute restart 
    sudo service neutron-plugin-openvswitch-agent restart
sm@computer:~$  sudo service openvswitch-switch restart
openvswitch-switch stop/waiting
openvswitch-switch start/running
sm@computer:~$ sudo service nova-compute restart
nova-compute stop/waiting
nova-compute start/running, process 34064
sm@computer:~$     sudo service neutron-plugin-openvswitch-agent restart
neutron-plugin-openvswitch-agent stop/waiting
neutron-plugin-openvswitch-agent start/running, process 34126



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值