CentOS 7.2 Mitaka云平台计算节点部署脚本(VLAN+VXLAN+DVR私有网络)

本文介绍如何通过一系列的shell命令来部署OpenStack计算节点,包括时间同步服务Chrony的安装配置、Nova计算服务的安装与配置、Neutron网络服务的安装与配置等步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

#!/bin/bash
#部署计算节点
#配置时间服务器
IP=192.168.101.1
GATE=192.168.101.0
yum install chrony -y
cat <<EOF> /etc/chrony.conf
server controller iburst
stratumweight 0
driftfile /var/lib/chrony/drift
rtcsync
makestep 10 3
allow $GATE/24
bindcmdaddress 127.0.0.1
bindcmdaddress ::1
keyfile /etc/chrony.keys
commandkey 1
generatecommandkey
noclientlog
logchange 0.5
logdir /var/log/chrony
EOF
systemctl enable chronyd.service
systemctl start chronyd.service
#安装openstack环境包
yum install centos-release-openstack-mitaka -y
yum upgrade -y
yum install python-openstackclient openstack-selinux -y
#安装计算服务
yum install openstack-nova-compute -y
cat <<EOF> /etc/nova/nova.conf
[DEFAULT]
rpc_backend = rabbit
auth_strategy = keystone
my_ip = $IP
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver

[oslo_messaging_rabbit]
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = RABBIT_PASS
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = 123456
[vnc]
enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = \$my_ip
novncproxy_base_url = http://controller:6080/vnc_auto.html
[glance]
api_servers = http://controller:9292
[oslo_concurrency]
lock_path = /var/lib/nova/tmp
[neutron]
url = http://controller:9696
auth_url = http://controller:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = 123456
EOF
systemctl enable libvirtd.service openstack-nova-compute.service
systemctl start libvirtd.service openstack-nova-compute.service
#安装网络服务
yum install openstack-neutron openstack-neutron-openvswitch ebtables ipset -y
cat <<EOF> /etc/neutron/plugins/ml2/openvswitch_agent.ini
[ovs]
local_ip = $IP
bridge_mappings = provider:br-provider

[agent]
tunnel_types = vxlan
enable_distributed_routing = True
l2_population = True
arp_responder = True

[securitygroup]
firewall_driver = iptables_hybrid
EOF
cat <<EOF> /etc/neutron/l3_agent.ini
[DEFAULT]
interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
external_network_bridge =
agent_mode = dvr
EOF
cat <<EOF> /etc/neutron/metadata_agent.ini
[DEFAULT]
nova_metadata_ip = controller
metadata_proxy_shared_secret = METADATA_SECRET
EOF
systemctl enable neutron-l3-agent.service
systemctl start neutron-l3-agent.service
systemctl enable neutron-metadata-agent.service
systemctl start neutron-metadata-agent.service
systemctl enable openvswitch.service 
systemctl start openvswitch.service 
ovs-vsctl add-br br-provider
ovs-vsctl add-port br-provider bond1
systemctl restart openstack-nova-compute.service
systemctl enable neutron-openvswitch-agent.service
systemctl start neutron-openvswitch-agent.service

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值