蠻復雜的樣子
根據官方文檔指導,一步一步走起:https://book.open-falcon.org/zh_0_2/quick_install/prepare.html
單機安裝的過程:單擊安裝會把所有的應用都(server、agent、api、alarm、graph)安裝到一個設備上
1、redis、mysql安裝無問題:service start redisd/service mysqld start;配置自啟動:chkconifg redisd on/chkconfig mysqld on
2、源碼編譯出現問題,不管,直接用編譯好的二機制版本
3、后端安裝啟動,沒有問題 ./open-falcon start/stop/restart [agent/api]
重新加載配置:./open-falcon reload [agent/api]
查看全部或單個應用啟動情況:./open-falcon check [agent/api]
監控某個應用:./open-falcon monitor agent
4、前端安裝啟動,注意下面創建的虛擬環境env,必須在dashboard目錄下
virtualenv ./env
啟動等命令:sh control start|stop|restart|status|tail|kill9|version|pack
日志查看:sh control tail
注意事項:
1、需要python2.7.x環境,不然安裝python依賴包的時候會報錯
./env/bin/pip install -r pip_requirements.txt -i https://pypi.douban.com/simple
2、可以yum安裝的,就使用yum安裝,比如go、mysql、redis
3、中文化:直接修改/home/admin/open-falcon/dashboard/rrd/templates里的內容就可以,比如直接修改navbar.html里的字段,效果

4、配置文件路徑:前端dashboard的配置文件 /home/admin/open-falcon/dashboard/rrd/config.py 配置了調用api的端口信息
api的配置文件:api/config/cfg.json。里面配置了api的端口信息
5、log路徑,在各個應用下的logs目錄,dashboard在其目錄下的var目錄下
6、開啟dashboard的調試模式:dashboard/rrd/config.py

6、有個坑:當api的默認端口8080被其他應用占用的時候,./open-falcon check的時候,falcon-api狀態依然是up的狀態,但是從api/logs/api.log里可以看到錯誤信息
7、agent進行分布式安裝:
畢竟單機安裝只能監控單機的情況,當需要其他機器時,就需要安裝agent。
open-falcon的agent用於采集機器負載監控指標,比如cpu.idle、load.1min、disk.io.util等等,每隔60秒push給Transfer。agent與Transfer建立了長連接,數據發送速度比較快,agent提供了一個http接口/v1/push用於接收用戶手工push的一些數據,然后通過長連接迅速轉發給Transfer。agent項目之前是一個獨立項目名字叫falcon-eye ,其自帶有web頁面來自於linux-dash項目。參考:https://book.open-falcon.org/zh/quick_install/graph_components.html
方法簡單:
1、需要把二進制解壓后的agent目錄和open-falcon執行腳本放入到被監控機器的某個目錄。我是把整個目錄拷貝過去的,只通過命令行 ./open-falcon start agent 啟動agent就可以了
2、修改agent的配置,使其ip信息指向server端:vim agent/config/cfg.json
總共兩個IP地址:一個是心跳;一個是transfer應用的。n多個機器上的agent主動把信息發送給server的transfer

配置涵義:
{ "debug": true, "hostname": "", "ip": "", "plugin": { "enabled": false, #默認不開啟插件機制 "dir": "./plugin", "git": "https://github.com/open-falcon/plugin.git", "logs": "./logs" }, "heartbeat": { "enabled": true, #此處enabled要設置為true "addr": "0.0.0.0:6030", #server上hbs的地址,端口是hbs的rpc端口 "interval": 60, "timeout": 1000 }, "transfer": { "enabled": true, #此處enabled要設置為true "addrs": [ "0.0.0.0:8433" #transfer的地址,這里寫服務端的IP地址,因為transfer部署在服務端,端口是transfer的rpc端口,這個寫多個IP:Port的話,會發給多個Server嗎? ], "interval": 60, "timeout": 1000 }, "http": { "enabled": true, "listen": ":1988", "backdoor": false }, "collector": { "ifacePrefix": ["eth", "em"], #默認配置只會采集網卡名稱前綴是bond、em的網卡流量,配置為空就會采集所有的,lo的也會采集。 "mountPoint": [] }, "default_tags": { }, "ignore": { #默認采集了200多個metric,可以通過ignore設置為不采集 "cpu.busy": true, "df.bytes.free": true, "df.bytes.total": true, "df.bytes.used": true, "df.bytes.used.percent": true, "df.inodes.total": true, "df.inodes.free": true, "df.inodes.used": true, "df.inodes.used.percent": true, "mem.memtotal": true, "mem.memused": true, "mem.memused.percent": true, "mem.memfree": true, "mem.swaptotal": true, "mem.swapused": true, "mem.swapfree": true } }
3、agnet啟動后,可以訪問ip:1988來訪問agent的web界面

4、agent提供了一個http接口/v1/push用於接收用戶手工push的一些數據
所以,你可以本地使用python等語言采集其他信息,然后發送給agent的接口/v1/push
https://github.com/open-falcon可以查看相關的項目和插件腳本
參考:
1、http://open-falcon.org/
2、https://book.open-falcon.org/zh_0_2/
3、https://blog.csdn.net/u012724150/article/details/53309522
4、http://futeng.iteye.com/blog/2071867
5、https://itbilu.com/database/redis/4kB2ninp.html
6、https://blog.csdn.net/dbanote/article/details/12911851
7、http://www.cnblogs.com/kevingrace/p/7361963.html
