Monasca安装配置指导(3/3) - 安装thresh、UI

本文详细介绍如何在CentOS7上安装Monasca-thresh及UI组件,包括编译Java工程、配置Apache Storm平台、安装Horizon等步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Monasca安装配置指导(3/3) - 安装thresh、UI


作者:张航东
OpenStack版本:Newton
Linux:CentOS 7
本文主要用于个人学习、总结,欢迎转载,但请务必注明作者和出处,感谢!


7 monasca-thresh

PS:monasca-thresh是JAVA工程,所以需要maven工具进行先进行编译

7.1 安装 apache-maven

下载(apache-maven-3.5.0-bin.tar.gz):
http://maven.apache.org/download.cgi

解压:

#tar -xvf apache-maven-3.5.0-bin.tar.gz

**目录内的bin/mvn就是编译monasca-thresh工程需要的工具,
直接使用,或添加到环境变量,修改 /etc/profile中,添加如下内容:**

MAVEN_HOME=/usr/local/apache-maven-3.5.0
export MAVEN_HOME
export PATH=${PATH}:${MAVEN_HOME}/bin

使配置生效:

#source /etc/profile

7.2 编译monasca-thresh工程

PS:monasca-thresh需要依赖monasca-common(基本所有monasca的组件都依赖common),common同时支持java和python,但是thresh目前只有java版本,所以我们需要先将common编译thresh可以引用的java包。

7.2.1 编译monasca-common

进入monasca-common目录,执行mvn命令编译:

#mvn clean install

7.2.2 编译monasca-thresh

下载:

#git clone https://github.com/openstack/monasca-thresh.git
#cd monasca-thresh

执行mvn命令编译:

#mvn package

执行完后, ./target/monasca-thresh-x.x.x-SNAPSHOT-shaded.jar 便是我们需要的thresh运行程序。
不过,这个程序并不能直接运行,需要运行在apache storm平台上。

7.3 安装apache storm

下载(apache-storm-1.1.1.tar.gz):
http://storm.apache.org/downloads.html

解压:

#tar xvf apache-storm-1.1.1.tar.gz
#cd apache-storm-1.1.1

修改配置文件 /conf/storm.yaml,添加如下内容:

########### These MUST be filled in for a storm configuration
storm.zookeeper.servers:
- “127.0.0.1”
nimbus.seeds: [“127.0.0.1”]

启动:

#bin/storm nimbus
#bin/storm supervisor

7.4 启动monasca-thresh

在7.2中,我们已经成功编译除了monasca-thresh运行的jar包(…/monasca-thresh/thresh/target/ monasca-thresh-x.x.x-SNAPSHOT-shaded.jar)
这一步,我们要基于apache storm平台,来启动monasca-thresh。

7.4.1 配置

**进去monasca-thresh工程目录
拷贝配置文件模板到 etc/monasca/目录下**

#cp thresh/src/main/config/thresh-sample-config.yml /etc/monasca/thresh.conf

修改配置文件/etc/monasca/thresh.conf,修改一下几项:


zookeeperConnect: 127.0.0.1:2181 (多处)

metadataBrokerList: 127.0.0.1:9092

database:
driverClass: “com.mysql.jdbc.jdbc2.optional.MysqlDataSource”
url: “jdbc:mysql://10.127.2.121/monasca?useSSL=true”
user: “monasca”
password: “monasca”

statsdConfig:
host: 127.0.0.1
port: 8125

7.4.2 启动

#…/apache-storm-1.1.1/bin/storm jar …/monasca-thresh/thresh/target/ monasca-thresh-x.x.x-SNAPSHOT-shaded.jar monasca.thresh.ThresholdingEngine /etc/monasca/thresh.conf thresh-cluster


8 monasca-ui

8.1 安装 horizon (源码方式)

(参考:https://docs.openstack.org/horizon/latest/install/from-source.html

下载安装(PS:由于权限问题,尽量避免下载到/root目录,建议下载到/opt目录)

#git clone https://github.com/openstack/horizon.git
#cd horizon
#pip install -r requirements.txt

生成local_settings.py

#cp openstack_dashboard/local/local_settings.py.example openstack_dashboard/local/local_settings.py

修改local_settings.py,配置内容如下:

COMPRESS_OFFLINE = True

ALLOWED_HOSTS = [‘*’, ]

OPENSTACK_API_VERSIONS = {
“identity”: 3,
“image”: 2,
“volume”: 2,
}

OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True
OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = ‘Default’

OPENSTACK_HOST = “10.127.2.121
OPENSTACK_KEYSTONE_URL = “http://10.127.2.121:5000/v3”
OPENSTACK_KEYSTONE_DEFAULT_ROLE = “_member_”

安装语言包

#apt-get install gettext
#./manage.py compilemessages

静态文件压缩

#./manage.py collectstatic
#./manage.py compress

生成wsgi配置文件horizon.conf

#./manage.py make_web_conf –apache > /etc/httpd/conf.d/horizon.conf

修改horizon.conf,配置内容如下:

<VirtualHost *:80>

    ServerAdmin webmaster@openstack.org
    ServerName  openstack_dashboard

    DocumentRoot /opt/horizon/

    LogLevel warn
    ErrorLog /var/log/httpd/openstack_dashboard-error.log
    CustomLog /var/log/httpd/openstack_dashboard-access.log combined

    WSGIScriptReloading On
    WSGIDaemonProcess openstack_dashboard_website
    WSGIProcessGroup openstack_dashboard_website
    WSGIApplicationGroup openstack_dashboard_website
    WSGIPassAuthorization On

    WSGIScriptAlias / /opt/horizon/openstack_dashboard/wsgi/horizon.wsgi

    <Location "/">
        Require all granted
    </Location>

    Alias /static /opt/horizon/static
    <Location "/static">
        SetHandler None
    </Location>
</Virtualhost>

重启httpd服务:

#systemctl restart httpd

8.2 安装 monasca-ui

(参考:https://github.com/openstack/monasca-ui

在horizon的requirements.txt中添加对monasca-ui的支持
进入已下载的horizon工程的目录,

#vi requirements.txt

在末尾添加如下内容:

… …
git+https://git.openstack.org/openstack/monasca-ui.git

再次执行命令(安装horzion时执行过一次)

#pip install -r requirements.txt

将monasca链接到horizon

#ln -sf $(pwd)/../monasca-ui/monitoring/enabled/_50_admin_add_monitoring_panel.py $(pwd)/openstack_dashboard/enabled/_50_admin_add_monitoring_panel.py

#ln -sf $(pwd)/../monasca-ui/monitoring/conf/monitoring_policy.json $(pwd)/openstack_dashboard/conf/monitoring_policy.json

#ln -sfF $(pwd)/../monasca-ui/monitoring $(pwd)/monitoring

重启httpd服务:

#systemctl restart httpd

Thresh of Legends的英雄联盟高清壁纸和适用于您浏览器的新标签页主题 我们为您提供Thresh扩展程序,该扩展程序带有来自《英雄联盟》游戏中该冠军的随机高清壁纸。 这将使您的浏览器超级有趣和令人兴奋,因为这些主题将在您每次打开新的标签页时显示。 您将可以选择最喜欢的一种,并在需要时进行更改。 此外,我们添加了其他一些功能,这些功能将使您的浏览体验更好,并且对您确实有用。 享受我们的应用程序,并随时与也喜欢玩这个令人上瘾的游戏的朋友分享它。 如何使用:-通过单击添加到Chrome按钮安装此扩展程序,它将自动添加。 加载扩展程序时,请等待几秒钟,然后执行最佳操作! -在左上角,“齿轮”。 这将加载设置面板,您可以在其中使用切换按钮来打开或关闭功能。 此扩展程序提供一些选项,让您仅具有高清背景(选择“收藏夹”或使其随机化)或使用一些出色的功能。 特点-居中,时钟(12h / 24h选项),带有个性化问候语供您选择(例如昵称)-出色的工作清单,以便您可以跟踪重要内容-快捷网站的快捷方式(单击左上角的“链接”图标) 。 -每日行情–每天都会为您和您的动机选择有力的报价来激发灵感。 -单击左上角的齿轮图标-选择仅包含墙纸,或选择所需的功能。 -在同一面板中,单击照片,然后选择您喜欢的照片,或单击齿轮旁边的“刷新”按钮以选择下一张壁纸。 使用此扩展程序,您将获得壁纸,艺术品,Thresh LoL冠军的图纸等等。 卸载要从浏览器中删除扩展名,请执行以下步骤:-在屏幕右上角找到三个垂直点图标-转到“设置”。 -在出现的菜单中,选择“扩展名”。 -从已安装的扩展程序列表中,找到要卸载的扩展程序的名称。 -单击“启用”右侧的垃圾桶图标(对于您要卸载的扩展名)。 -我们的扩展程序应从您的Chrome浏览器中删除。 更简单的方法–右键单击工具栏中的图标,然后单击“从Chrome删除...”。免责声明:此扩展程序由Thresh和League of Legends粉丝针对粉丝而制作。 我们和内容与任何公司都不隶属,赞助或批准,并且是非官方的。 如果您认为我们侵犯了您的版权,请与我们联系。 尽管此扩展程序是免费的,但某些部分可以包含广告。 支持语言:English
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值