#VM虚拟机8G内存,安装完毕,半个小时左右
#在线安装
#环境 centos 7.4.1708 x86_64
#在线安装openstack pike
curl http://elven.vip/ks/openstack/pike.install.sh>pike.install.sh && sh pike.install.sh
更新日期 2017-11-21
新增内容:
安装完成后,自动创建秘钥、主机类型、cirros测试镜像、网络、虚拟机kvm01
也就是安装完成后,就自动创建启动了虚拟机kvm01
# 有兴趣的小伙伴,可以测试反馈
已安装的VMware虚拟机镜像下载地址:https://www.jb51.net/softs/60337.html
#shell代码分享( 最新代码以在线安装为准,以下shell无错误,不在更新)
#!/bin/sh
# openstack pike 单机 一键安装
# 环境 centos 7.4.1708 x86_64
# 更多内容 http://dwz.cn/openstack
# Myde by Elven
[[ `uname -r` = *el7* ]] && { echo '开启安装openstack pike'; } || { echo '请在CentOS7.4 环境运行';exit; }
##########################################
#参数
#获取第一块网卡名、ip地址
Net=`ip add|egrep global|awk '{ print $NF }'|head -n 1`
IP=`ip add|grep global|awk -F'[ /]+' '{ print $3 }'|head -n 1`
echo "网卡名称:$Net"
echo "IP地址: $IP"
#参数
DBPass=elven2017 #SQL root密码
Node=controller #节点名(controller不要改动)
Netname=$Net #网卡名称
MyIP=$IP #IP地址
VncProxy=$IP #VNC代理外网IP地址
Imgdir=/date/glance #自定义glance镜像目录
VHD=/date/nova #自定义Nova实例路径
Kvm=qemu #QEMU或KVM ,KVM需要硬件支持
##########################################
#1、设置
echo '关闭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
echo '时间同步'
/usr/sbin/ntpdate ntp6.aliyun.com
echo "*/3 * * * * /usr/sbin/ntpdate ntp6.aliyun.com &> /dev/null" > /tmp/crontab
crontab /tmp/crontab
echo '设置hostname'
hostnamectl set-hostname $Node
echo "$MyIP $Node">>/etc/hosts
#使用阿里源
rm -f /etc/yum.repos.d#&/' $Setfiles
sed -i 's#UTC#Asia/Shanghai#g' $Setfiles
sed -i 's#%s:5000/v2.0#%s:5000/v3#' $Setfiles
sed -i '/ULTIDOMAIN_SUPPORT/cOPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True' $Setfiles
sed -i "s@^#OPENSTACK_KEYSTONE_DEFAULT@OPENSTACK_KEYSTONE_DEFAULT@" $Setfiles
echo '
#set
OPENSTACK_API_VERSIONS = {
"identity": 3,
"image": 2,
"volume": 2,
}
#'>>$Setfiles
systemctl restart httpd
sleep 5
##########################################
echo '启动服务'
#Apache
systemctl enable httpd.service
#systemctl restart httpd haproxy
#netstat -antp|egrep 'httpd'
#glance服务
systemctl enable openstack-glance-api openstack-glance-registry
systemctl restart openstack-glance-api openstack-glance-registry
#nova服务
systemctl enable openstack-nova-api.service
openstack-nova-consoleauth.service openstack-nova-scheduler.service
openstack-nova-conductor.service openstack-nova-novncproxy.service
libvirtd.service openstack-nova-compute.service
#启动
systemctl start openstack-nova-api.service
openstack-nova-consoleauth.service openstack-nova-scheduler.service
openstack-nova-conductor.service openstack-nova-novncproxy.service
libvirtd.service openstack-nova-compute.service
#neutron服务
systemctl enable neutron-server.service
neutron-linuxbridge-agent.service neutron-dhcp-agent.service
neutron-metadata-agent.service neutron-l3-agent.service
systemctl start neutron-server.service
neutron-linuxbridge-agent.service neutron-dhcp-agent.service
neutron-metadata-agent.service neutron-l3-agent.service
##########################################
#cheack
echo "查看节点"
source ./admin-openstack.sh
openstack compute service list
openstack network agent list
##########################################
#end
echo '
安装完毕!
数据库root密码 '$DBPass'
登录Web管理 http://'$MyIP'/dashboard
域 default
用户 admin
密码 admin
推荐 火狐浏览器
'
##########################################
# #在线安装
# yum install -y wget && wget -O pike.install.sh
http://elven.vip/ks/openstack/pike.install.sh && sh pike.install.sh
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持考高分网。



