Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deploy the Open-Falcon monitoring system

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article is about how to deploy Open-Falcon monitoring system. Xiaobian thinks it is very practical, so share it with everyone to learn. I hope you can gain something after reading this article. Let's not say much. Let's take a look at it together with Xiaobian.

This article doesn't analyze Open-Falcon's architecture or why it was chosen; the official documentation is here, albeit incomplete. But that's why I wrote this post. The official documentation doesn't tie the whole deployment together, and there are a few problems. In this article, I will not introduce the role and function of each component, but simply introduce how to deploy from zero.

install download wget https://github.com/XiaoMi/open-falcon/releases/download/0.0.5/open-falcon-0.0.5.tar.gz-O open-falcon.tar.gz unzip mkdir tmp tar -zxvf open-falcon.tar.gz -C ./ tmp base environment sudo apt-get install redis-server sudo apt-get install mysql-server pip install virtualenv #Database initialization code from official documentation git clone https://github.com/open-falcon/scripts.git cd scripts mysql -h localhost -u root -p < db_schema/graph-db-schema.sql mysql -h localhost -u root -p < db_schema/dashboard-db-schema.sql mysql -h localhost -u root -p < db_schema/portal-db-schema.sql mysql -h localhost -u root -p < db_schema/links-db-schema.sql mysql -h localhost -u root -p < db_schema/uic-db-schema.sql configuration

The configuration format for database connections is: username:password@tcp(path:port)/xxxx

agent

mv cfg.example.json cfg.json && ./ control start && ./ control tail

Start listening on port 1988, check log.

The default port is 1988, you can open http://127.0.0.1:1988 to view a relatively simple web dashboard. If you don't have any special needs, you can use the default configuration.

hbs

mv cfg.example.json cfg.json && ./ control start && ./ control tail

Heartbeat service default http port is 6030, rpc port 6031

transfer

mv cfg.example.json cfg.json && ./ control start && ./ control tail

The default http port is 6060, rpc port 8433

judge

mv cfg.example.json cfg.json && ./ control start && ./ control tail

http port 6081, rpc port 6080

Note the redis link of alarm and the server address of hbs in the configuration item. If modified, please remember the corresponding.

graph

mv cfg.example.json cfg.json && ./ control start && ./ control tail

rpc port 6070, http port 6071

The requested URL/home/work/data/6070 was not found on this server.

Note the modification of database connections.

The above service configuration is complete and the data collection begins.

dashboard virtualenv env source env/bin/activate ./ env/bin/pip install -r pip_requirements.txt #use./ env/bin/python wsgi.py #or deactivate && ./ control start && ./ control tail

Can be changed to custom port. Here you can view Endpoints data and plot them.

query

mv cfg.example.json cfg.json && ./ control start && ./ control tail

Just modify the cfg.json file, note the graph_backends.txt file

fe

mv cfg.example.json cfg.json && ./ control start && ./ control tail

Note that the database connection in the configuration project and the address that can be accessed from the external network need to be configured in the shortcut below. If it is not deployed on the server, it does not matter by default here.

portal

There's a pit to watch out for here. If you use.../ control start If you started the service and changed the default port, configure bind in gunicorn.conf. If you are using python wsgi.py to start, modify the port in wsgi.py.

At the same time, when configuring frame/config.py, pay attention to the configuration of the so-called UIC_ADDRESS option, which is actually to fill in the address of the fe module above.

UIC_ADDRESS = { 'internal': '127.0.0.1: port',#Your intranet address'external': ' http://your_fe_name',#Address accessed from external network, if it is deployed locally, this can be the same as the intranet address}

Here really want to spit on the operation of the web interface, quite inhuman. And when configuring alarms, it really didn't link the whole process together. Hey! The configuration here can create a template and then create a monitoring host, binding.

The callback() configuration in the template works great. You can write the push interface of the alarm message directly here, and use the third-party service is also ok.

alarm

mv cfg.example.json cfg.json && ./ control start && ./ control tail

You need to configure the custom port monitoring address, and the api below, the other parts can be kept default.

In its documentation, it says something like this:

{... "api": { "portal": "http://falcon.example.com", #address of portal accessible on intranet "uic": "http://uic.example.com", #address of uic(or fe) accessible on intranet "links": "http://link.example.com" #address of links accessible on extranet} }

But if it's configured like this, everything is only accessible on the intranet. This is obviously not in line with our expectations. So here to configure all the addresses that can be accessed outside the network to prevent stepping on pits.

sender

This component is used to invoke the SMS and email interfaces provided by itself, edit cfg.json Add

{... 'api': { 'sms': 'http://your_send_sms_api', 'mail': 'http://your_send_mail_api' }}

When called, the message is written to the redis queue first, and then the interface is invoked to send the message.

The worker parameter is the configuration of the queue.

links

mv cfg.example.json cfg.json && ./ control start && ./ control tail

Alarm merge component, python application, remember to modify the default port.

Other tasks

supervisory self-checking procedure

gateway

No cross-server problems can be ignored. (hhah

redis-monitor.py

scripts folder in a very simple script, redis info in the data read, write to the database, for monitoring use.

The last attached picture is a terminal when I started this service a few days ago.

The above is how to deploy Open-Falcon monitoring system. Xiaobian believes that some knowledge points may be seen or used in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report