#!/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
CentOS 7.2 Mitaka云平台计算节点部署脚本(VLAN+VXLAN+DVR私有网络)
最新推荐文章于 2024-02-21 19:33:38 发布