centos_x64min
1.yum install net-tools
2.yum install git
后面可选-后面需要安装distro======================
yum install wget
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
pip install distro
============================================
3.https://github.com/openstack/devstack 下载devstack 或者直接
git clone https://github.com/openstack-dev/devstack.git ,将devstack放再/home/下
4../create-stack-user.sh 创建用户,提示缺少lsb_release
yum install -y redhat-lsb
./create-stack-user.sh
5.chow -R stack:stack /home/devstack
6.cd /home/devstack
su - stack
./stack.sh
直接创建该文件:
mkdir -p /opt/stack/logs
touch /opt/stack/logs/error.log
然后继续执行stack.sh报错:
stack.sh:227,查看里面代码再这块出错,发现我的本地版本比较低,代码判断认为不支持,然后修改shell,再判断条件里将自己打印出来的DISTRO版本放进去
# Warn users who aren't on an explicitly supported distro, but allow them to
# override check and attempt installation with ``FORCE=yes ./stack``
继续执行仍然报错:
./stack.sh:482:check_path_perm_sanity
/home/devstack/functions:640:die
[ERROR] /home/devstack/functions:640 Invalid path permissions
分析应该是权限不对,修改shell脚本增加打印:echo DEST======================================/opt/stack
切root用户修改路径的权限属性
这里还是修改为777,后面会说的原因:
chmod -R 777 /opt/stack
chown -R stack:stack /opt/stack
切回stack用户
可选================================================
如果上面640的话,可能遇到这样的错误:
再执行./stack.sh 然后仍然有报错:
stack.sh failed
Error on exit
/usr/bin/env: python3: Permission denied
看来得升级python3,但是上面有一个/home/devstack/tools/outfilter.py 没有权限的提示,干脆直接将/opt/stack改为777得了,改完重新执行PASS了
================================================
后面遇到提示输入密码直接输入密码即可
可惜到这以为后面没有什么问题了,其实大错特错
0.升级python3:https://www.jianshu.com/p/6b52eb4960e4
注意编译的时候需要修改ssl配置(否则后面会提示ssl链接失败):
vi /usr/local/Python-3.8.0/Modules/Setup:
SSL=/opt/openssl1.0.2r
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto
1.本地创建localrc文件(/home/devstack/)
localrc
ADMIN_PASSWORD=Admin123
DATABASE_PASSWORD=Admin123
RABBIT_PASSWORD=Admin123
SERVICE_PASSWORD=$ADMIN_PASSWORD
# use TryStack git mirror
GIT_BASE=http://git.trystack.cn
NOVNC_REPO=http://git.trystack.cn/kanaka/noVNC.git
SPICE_REPO=http://git.trystack.cn/git/spice/spice-html5.git
# only support IP v4
SERVICE_IP_VERSION=4
# Branches
KEYSTONE_BRANCH=stable/rocky
NOVA_BRANCH=stable/rocky
NEUTRON_BRANCH=stable/rocky
SWIFT_BRANCH=stable/rocky
GLANCE_BRANCH=stable/rocky
CINDER_BRANCH=stable/rocky
#这里发现遇到再后面下载devstack因为重复下载会报错
rm -rf /home/devstack/devstack
git clone http://git.trystack.cn/openstack-dev/devstack -b stable/rocky
LOGFILE=$DEST/logs/stack.sh.log
#若禁用tempest服务,则加disabled
disable_service tempest
# Enabling Neutron (network) Service
disable_service n-net
enable_service q-svc
enable_service q-agt
enable_service q-dhcp
enable_service q-l3
enable_service q-meta
enable_service q-metering
enable_service neutron
LOGDAYS=2
SWIFT_HASH=66a3d6b56c1f479c8b4e70ab5c2000f5
SWIFT_REPLICAS=1
SWIFT_DATA_DIR=$DEST/data
注释shell脚本里这2步骤
再后面安装会遇到下载python扩展组件总会有些超时下载失败的,直接去 https://pypi.org/project/pbr/#files 上下载安装,下载whl包时,直接 pip3 install x.whl即可安装
再之后提示:Error: Command '['/opt/stack/bindep-venv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-p
搜索网上解决办法:https://www.solves.com.cn/it/rj/czxt/linux/2019-12-19/10280.html,我用的解决办法2:
su - 切root用户
cd /usr/lib64/python3.6/ensurepip/
mkdir _bundled
cd _bundled
wget https://files.pythonhosted.org/packages/e7/16/da8cb8046149d50940c6110310983abb359bbb8cbc3539e6bef95c29428a/setuptools-40.6.2-py2.py3-none-any.whl
wget https://files.pythonhosted.org/packages/ac/95/a05b56bb975efa78d3557efa36acaf9cf5d2fd0ee0062060493687432e03/pip-9.0.3-py2.py3-none-any.whl
python3 -m ensurepip --upgrade
然后验证:python3 -m venv pdf_env不再报错
接着报错:Error: Unable to find a match: rabbitmq-server
1.安装依赖-socat
wget –no-cache http://www.convirture.com/repos/definitions/rhel/6.x/convirt.repo -O /etc/yum.repos.d/convirt.repo
yum makecache
yum install socat
2.安装依赖erlang
yum install -y autoconf
yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel unixODBC-devel
wget http://erlang.org/download/otp_src_21.3.tar.gz
tar -xvzf otp_src_21.3.tar.gz
cd otp_src_21.3
./otp_build autoconf
echo 'export PATH=$PATH:/usr/local/lib/erlang/bin'>> /etc/profile
source /etc/profile
然后下载rabbitmq-server进行安装:https://www.rabbitmq.com/install-rpm.html#running-rpm
rpm -ivh --nodeps rabbitmq-server-3.7.10-1.noarch.rpm
安装openvswitch:参考 https://www.cnblogs.com/bethal/p/6043899.html
yum install-y qemu-kvm libvirt virt-install bridge-utils
yum -y install openssl-devel wget kernel-devel
yum groupinstall "Development Tools"
mkdir -p ~/rpmbuild/SOURCES
cd ~/rpmbuild/SOURCES
wget http://openvswitch.org/releases/openvswitch-2.3.1.tar.gz
tar xfz openvswitch-2.3.1.tar.gz
sed 's/openvswitch-kmod, //g' openvswitch-2.3.1/rhel/openvswitch.spec > openvswitch-2.3.1/rhel/openvswitch_no_kmod.spec
rpmbuild -bb --without=check ~/openvswitch-2.3.1/rhel/openvswitch_no_kmod.spec
yum localinstall /root/rpmbuild/RPMS/x86_64/openvswitch-2.3.1-1.x86_64.rpm
systemctl start openvswitch.service (可能第一次卡住,stop后再执行一次start)
之后提示:git clone http://git.trystack.cn/openstack-dev/devstack -b stable/rocky 连接不上,之前是ok的,很奇c怪,只能注释此行,然后将:
cd /home/devstack
cp -R backup/devstack ./
修改localrc文件:
之后提示:/home/devstack/files/etcd-v3.3.12-linux-amd64.tar.gz: FAILED
再:https://github.com/etcd-io/etcd/releases/download/v3.3.12/etcd-v3.3.12-linux-amd64.tar.gz上面下载后放到/home/devstack/files/下,重试又提示新的错误:
+functions-common:restart_service:2185 sudo /bin/systemctl restart httpd
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
通过命令journalctl -xe查看
查看配置文件内容:LoadModule proxy_uwsgi_module modules/mod_proxy_uwsgi.so
应该是没有安装uwsgi模块,解决办法:
yum install epel-release
yum install mod_proxy_uwsgi uwsgi-plugin-python
验证成功开启httpd服务:
systemctl enable uwsgi.service
systemctl enable httpd.service
systemctl start uwsgi.service
systemctl start httpd.service