安装openstack服务

sudo git clone https://github.com/openstack-dev/devstack.git
cd devstack

或者

sudo git clone https://github.com/openstack/devstack.git
cd devstack
安装脚本
#!/bin/bash -v
set -v
./clean.sh

INSTALL_HOME=/opt/devstack
STACK_HOME=/opt/stack
GLOBAL="[global]\nindex-url = https://pypi.tuna.tsinghua.edu.cn/simple\ntrusted-host = pypi.tuna.tsinghua.edu.cn\n"
HOSTS="#github\n140.82.113.4 github.com\n199.232.5.194 github.global.ssl.fastly.net\n"
INSTALL_CONF="[[local|localrc]]\nADMIN_PASSWORD=yyqx9999\nDATABASE_PASSWORD=$ADMIN_PASSWORD\nRABBIT_PASSWORD=$ADMIN_PASSWORD\nSERVICE_PASSWORD=$ADMIN_PASSWORD\n#Use mirror\nGIT_BASE=http://git.trystack.cn\nNOVNC_REPO=http://git.trystack.cn/kanaka/noVNC.git\nSPICE_REPO=http://git.trystack.cn/git/spice/spice-html5.git\nauth_url=http://127.0.0.1:5000/v3\n"
sudo mkdir -p $INSTALL_HOME
sudo mkdir -p /root/.pip

if [ $PWD != $INSTALL_HOME ]; then
	sudo cp -rf ./* $INSTALL_HOME
fi
if !(cat /etc/hosts | grep "199.232.5.194" > /dev/null); then
	sudo echo -e $HOSTS >> /etc/hosts
fi
if !(cat /etc/passwd | cut -f1 -d':' | grep -w "stack" -c > /dev/null); then
	sudo useradd -s /bin/bash -d /opt/stack -m stack
fi

sudo rm -rf /usr/lib/python3/dist-packages/pyasn1_modules-0.2.1.egg-info
sudo rm -rf /usr/lib/python3/dist-packages/simplejson-3.16.0.egg-info
sudo rm -rf /opt/stack/horizon/openstack_dashboard/local/.secret_key_store

sudo echo -e $GLOBAL > /root/.pip/pip.conf
sudo echo "stack ALL=(ALL) NOPASSWD: NOPASSWD: ALL" > /etc/sudoers.d/stack
sudo echo -e $INSTALL_CONF > $INSTALL_HOME/local.conf
sudo apt install bridge-utils git python3-pip -y

find $STACK_HOME * -exec chmod -R 777 {} \;
find $STACK_HOME * -exec chown -R stack:stack {} \;
find $INSTALL_HOME * -exec chmod -R 777 {} \;
find $INSTALL_HOME * -exec chown -R stack:stack {} \;

su stack -c "cd $INSTALL_HOME && FORCE=yes ./stack.sh"

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值