OpenStack Watcher 安装

OpenStack Watcher 安装

最近在准备Watcher环境,现在就安装进行记录。

前言

环境:
1、控制节点
2、Centos7
3、Rocky版本

安装分为三部分:
1、watcher
2、python-watcherclient
3、watcher-dashboard

watcher

参考官方文档即可:https://docs.openstack.org/watcher/rocky/install/install-rdo.html

python-watcherclient

yum源中没有包,需要使用pip安装

pip install python-watherclient

在安装中发生PyYAML版本不符问题且不能uninstall原版本;

解决方式:
先手动移除原版本(删除或备份)

/usr/lib64/python2.7/site-packages/PyYAML-3.10-py2.7.egg-info
/usr/share/doc/PyYAML-3.10

再进行安装即可

watcher-dashboard

执行

git clone -b stable/rocky https://opendev.org/openstack/watcher-dashboard.git
cd watcher-dashboard
pip install .
cp watcher_dashboard/local/enabled/_310* /usr/share/openstack-dashboard/openstack_dashboard/local/enabled

放置json文件:
本人使用rdo安装,在dashboard配置文件中POLICY_FILES={***} 被POLICY_FILES_PATH = '/etc/openstack-dashboard’替代,所以将json拷贝到此目录下即可;

cp ./watcher_dashboard/conf/watcher_policy.json /etc/openstack-dashboard/

如果不同环境,请更改dashboard配置文件中的POLICY_FILES指向正确文件路径

执行:

./manage.py compilemessages
DJANGO_SETTINGS_MODULE=openstack_dashboard.settings python manage.py collectstatic --noinput
DJANGO_SETTINGS_MODULE=openstack_dashboard.settings python manage.py compress --force

执行的命令有报错:
ImportError: No module named openstack_dashboard.utils

解决方法:需要下载openstack_dashboard代码放在/usr/lib/python2.7/site-packages目录下;

代码下载git项目:
https://github.com/openstack/horizon/tree/stable/rocky
其中openstack_dashboard即所需代码包

重启http服务

systemctl restart httpd
发布了11 篇原创文章 · 获赞 0 · 访问量 725

猜你喜欢

转载自blog.csdn.net/mr1jie/article/details/103405632