openstack nova neutron cinder节点安装

#关闭selinux、防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
firewall-cmd --state
sed -i ‘/^SELINUX=.*/c SELINUX=disabled‘ /etc/selinux/config
sed -i ‘s/^SELINUXTYPE=.*/SELINUXTYPE=disabled/g‘ /etc/selinux/config
grep --color=auto ‘^SELINUX‘ /etc/selinux/config
setenforce 0

#时间同步 #设置hostname, 每个节点分别设置
#时间同步
####所有节点执行
yum install -y ntp
systemctl enable ntpd && systemctl restart ntpd
timedatectl set-timezone Asia/Shanghai

/usr/sbin/ntpdate ntp6.aliyun.com
echo "*/3 * * * * /usr/sbin/ntpdate ntp6.aliyun.com  &> /dev/null" > /tmp/crontab
crontab /tmp/crontab

hostnamectl --static set-hostname  node$(ip addr |grep brd |grep global |head -n1 |cut -d ‘/‘ -f1 |cut -d ‘.‘ -f4)

[ `grep -c ‘ controller$‘ /etc/hosts ` -eq 0 ] && echo ‘192.168.0.170 v.meilele.com controller‘ >>/etc/hosts
tail /etc/hosts 

echo ‘
[centos-openstack-liberty]
name=CentOS-7 - OpenStack liberty
baseurl=http://vault.centos.org/centos/7.3.1611/cloud/x86_64/openstack-liberty/
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Centos-7
‘ >/etc/yum.repos.d/CentOS-OpenStack-liberty.repo

tail  /etc/yum.repos.d/CentOS-OpenStack-liberty.repo

########################################
###############node

yum install -y qemu-kvm libvirt virt-install
systemctl enable libvirtd && systemctl restart libvirtd

##Nova linux-node2.openstack
yum install -y openstack-nova-compute sysfsutils

#compute1 Nova
\cp -f /etc/nova/nova.conf{,.bak}

echo "
[DEFAULT]
rpc_backend = rabbit
auth_strategy = keystone
my_ip = $(ip addr |grep global |grep $(route  |grep default |awk ‘{print $NF}‘) |head -n1 |awk ‘{print $2}‘ |cut -d ‘/‘ -f1)
network_api_class = nova.network.neutronv2.api.API
security_group_api = neutron
linuxnet_interface_driver = nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver
firewall_driver = nova.virt.firewall.NoopFirewallDriver
verbose = True
[glance]
host = v.meilelee.com
[keystone_authtoken]
auth_uri = http://v.meilelee.com:5000
auth_url = http://v.meilelee.com:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = nova
password = 123456
[libvirt]
virt_type = kvm
[neutron]
url = http://v.meilelee.com:9696
auth_url = http://v.meilelee.com:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
region_name = RegionOne
project_name = service
username = neutron
password = 123456
[oslo_concurrency]
lock_path = /var/lib/nova/tmp
[oslo_messaging_rabbit]
rabbit_host = v.meilelee.com
rabbit_userid = openstack
rabbit_password = 123456
[vnc]
enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = \$my_ip
novncproxy_base_url = http://v.meilele.com:6080/vnc_auto.html
" >/etc/nova/nova.conf

#[ $(egrep -c ‘(vmx|svm)‘ /proc/cpuinfo) -eq 0 ] && sed -i ‘s#virt_type.*#virt_type=qemu#g‘ /etc/nova/nova.conf || sed -i ‘s#virt_type.*#virt_type=kvm#g‘ /etc/nova/nova.conf

grep virt_type /etc/nova/nova.conf

systemctl enable libvirtd.service openstack-nova-compute.service
systemctl restart libvirtd.service openstack-nova-compute.service

########################网络模块 neutron

##Neutron linux-node2.openstack
yum install -y openstack-neutron openstack-neutron-linuxbridge ebtables ipset

\cp -f /etc/neutron/neutron.conf{,.bak}
echo ‘
[DEFAULT]
rpc_backend = rabbit
auth_strategy = keystone
verbose = True
[keystone_authtoken]
auth_uri = http://v.meilelee.com:5000
auth_url = http://v.meilelee.com:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = neutron
password = 123456
[oslo_concurrency]
lock_path = /var/lib/neutron/tmp
[oslo_messaging_rabbit]
rabbit_host = v.meilelee.com
rabbit_userid = openstack
rabbit_password = 123456
‘ >/etc/neutron/neutron.conf

\cp -f /etc/neutron/plugins/ml2/linuxbridge_agent.ini{,.bak}

echo "
[linux_bridge]
physical_interface_mappings = public:$(ip addr |grep global |grep $(route  |grep default |awk ‘{print $NF}‘) |head -n1 |awk ‘{print $NF}‘)
[vxlan]
enable_vxlan = True
local_ip = $(ip addr |grep global |grep $(route  |grep default |awk ‘{print $NF}‘) |head -n1 |awk ‘{print $2}‘ |cut -d ‘/‘ -f1)
l2_population = True
[agent]
prevent_arp_spoofing = True
[securitygroup]
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
" >/etc/neutron/plugins/ml2/linuxbridge_agent.ini

systemctl enable neutron-linuxbridge-agent.service

systemctl restart openstack-nova-compute.service neutron-linuxbridge-agent.service

###########################
##Cinder
yum install -y openstack-cinder targetcli python-oslo-policy 

systemctl enable openstack-cinder-volume.service target.service
systemctl restart openstack-cinder-volume.service target.service

echo "
[DEFAULT]
rpc_backend = rabbit
auth_strategy = keystone
my_ip = $(ip addr |grep global |grep $(route  |grep default |awk ‘{print $NF}‘) |head -n1 |awk ‘{print $2}‘ |cut -d ‘/‘ -f1)
glance_host = v.meilelee.com
[BRCD_FABRIC_EXAMPLE]
[CISCO_FABRIC_EXAMPLE]
[cors]
[cors.subdomain]
[database]
connection = mysql://cinder:[email protected]/cinder
[fc-zone-manager]
[keymgr]
[keystone_authtoken]
auth_uri = http://v.meilelee.com:5000
auth_url = http://v.meilelee.com:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = cinder
password = 123456
[matchmaker_redis]
[matchmaker_ring]
[oslo_concurrency]
lock_path = /var/lib/cinder/tmp
[oslo_messaging_amqp]
[oslo_messaging_qpid]
[oslo_messaging_rabbit]
rabbit_host = v.meilelee.com
rabbit_userid = openstack
rabbit_password = 123456
[oslo_middleware]
[oslo_policy]
[oslo_reports]
[profiler]
" >/etc/cinder/cinder.conf 

systemctl enable openstack-cinder-volume.service target.service
systemctl restart openstack-cinder-volume.service target.service

################cinder nfs

yum install -y nfs-utils rpcbind

systemctl enable rpcbind nfs
systemctl restart rpcbind nfs

mkdir -p /data/nfs

echo ‘
/data/nfs *(rw,no_root_squash)
‘ >>/etc/exports

#all_squash:将远程访问的所有普通用户及所属组都映射为匿名用户或用户组;
#no_all_squash:访问用户先与本机用户匹配,匹配失败后再映射为匿名用户或用户组;
#root_squash:将root用户及所属组都映射为匿名用户或用户组;
#no_root_squash:来访的root用户保持root帐号权限;

systemctl reload nfs

echo ‘
[nfs]
volume_driver = cinder.volume.drivers.nfs.NfsDriver
nfs_shares_config = /etc/cinder/nfs_shares
nfs_mount_point_base = $state_path/mnt
volume_backend_name=nfs_volumes
‘ >>/etc/cinder/cinder.conf
tail /etc/cinder/cinder.conf

[ $(grep -c ‘^enabled_backends‘ /etc/cinder/cinder.conf) -eq 0 ] && sed -i ‘s/\[DEFAULT\]/ a enabled_backends=nfs/g‘ /etc/cinder/cinder.conf || sed -i ‘s/^enabled_backends.*=/enabled_backends=nfs,/g‘ /etc/cinder/cinder.conf

#sed -i ‘s/^enabled_backends.*=/enabled_backends=nfs,/g‘ /etc/cinder/cinder.conf
grep enabled_backends /etc/cinder/cinder.conf

echo ‘localhost:/data/nfs‘ >/etc/cinder/nfs_shares

chown root.cinder /etc/cinder/nfs_shares
chmod 640 /etc/cinder/nfs_shares
#chgrp cinder /etc/cinder/nfs_shares
systemctl restart openstack-cinder-volume.service 

原文地址:https://www.cnblogs.com/blog-lhong/p/11765387.html

时间: 2024-10-28 21:23:00

openstack nova neutron cinder节点安装的相关文章

openstack Nova、Cinder、Neutron资源配额设置

Nova.Cinder.Neutron资源配额设置 Nova Quota:/etc/nova/nova.conf CPU核数:20 openstack-config --set /etc/nova/nova.conf DEFAULT quota_cores 20; 云主机个数:10 openstack-config --set /etc/nova/nova.conf DEFAULT quota_instances 10; 内存MB:51200 openstack-config --set /et

在Ubuntu上学习OpenStack之七:控制节点上安装Neutron

v 约定:neutron使用MySQL存储相关数据,库名:neutron,账户:neutronadmin,密码:neutronroot v 创建数据库.账户,并配置权限: sudo mysql -uroot -pmysqlroot -e 'CREATE DATABASE neutron;' sudo mysql -uroot -pmysqlroot -e 'CREATE USER neutronadmin;' sudo mysql -uroot -pmysqlroot -e "GRANT ALL

在Ubuntu上学习OpenStack之六:计算节点基础环境准备和安装Nova

v 安装鼠标驱动(可选):sudo apt-get install gpm v 安装(或更新)远程连接服务:sudo apt-get install openssh-server v 更改python默认字符集为utf8:sudo vi /usr/lib/python2.7/sitecustomize.py 添加如下内容: v 安装NTP服务包:sudo apt-get install ntp 编辑:sudo vi /etc/ntp.conf 在如下位置新增两行: (注意: 计算节点最好不要安装

Openstack实践(1)安装部署第一个实例及neutron网络

版权声明:本文为博主原创文章,欢迎转载,转载请注明作者.原文超链接 ,博主地址:http://www.cnblogs.com/SuperXJ/ 如何快速部署使用openstack,使用kolla吧,openstack技术结合容器分分钟部署(单点或者多节点,任选),分分钟升级,kolla项目是为了容器化openstack,目标是做到开箱即用,所有的组件的HA都具备.kolla是一个革命性的项目,我们以前积累的安装部署经验,全部都报废.使用kolla可以快速部署可扩展,可靠的生产就绪的opensta

OpenStack(i版)之Keystone,Glance,Nova,Neutron,Horizon

一.前期准备 1.1.linux-node1端: [[email protected]1 ~]# egrep '(vmx|svm)' /proc/cpuinfo ##有输出就支持虚拟化 [[email protected] ~]# cat /etc/redhat-release CentOS release 6.8 (Final) [[email protected] ~]# uname -r 2.6.32-642.el6.x86_64 [[email protected] ~]# getenf

##6.2 Neutron计算节点--openstack

##6.2 Neutron计算节点 ##6.2 Neutron计算节点 #6.2.Neutron.compute.sh #安装 yum install -y openstack-neutron-linuxbridge ebtables ipset #配置 cp /etc/neutron/neutron.conf{,.bak} echo '# [DEFAULT] auth_strategy = keystone transport_url = rabbit://openstack:[email p

##6.1 Neutron控制节点--openstack

##6.1 Neutron控制节点 ##6.1 Neutron控制节点 #6.1.Neutron.controller.sh #本实例网络配置方式是:公共网络 #官方参考 https://docs.openstack.org/neutron/pike/install/controller-install-rdo.html #创建Neutron数据库.用户认证,前面已设置 source ./admin-openstack.sh # 创建Neutron服务实体,API端点 openstack ser

Openstack 安装部署指南翻译系列 之 Cinder服务安装(Block Storage)

1.1.1.1. Cinder服务安装(Block Storage) 块存储服务(cinder)为访客实例提供块存储设备.存储设置方法由块存储驱动程序确定,或者在多后端配置的情况下确定驱动程序.有各种可用的驱动程序:NAS / SAN,NFS,iSCSI,Ceph等. 块存储API和调度器服务通常在控制器节点上运行.根据使用的驱动程序,卷服务可以在控制器节点,计算节点或独立存储节点上运行. 本节介绍如何为块存储服务安装和配置存储节点.为了简单起见,此配置引用一个具有空的本地块存储设备的存储节点.

##6.2 Neutron计算节点-- openstack pike

##6.2 Neutron计算节点 #6.2.Neutron.compute.sh #安装 yum install -y openstack-neutron-linuxbridge ebtables ipset #配置 cp /etc/neutron/neutron.conf{,.bak} echo '# [DEFAULT] auth_strategy = keystone transport_url = rabbit://openstack:[email protected] [keyston