【監控】open-falcon v0.2 部署、小米開源監控部署

Carson發表於2017-09-06

所依賴其他服務

  • memcached

  • redis

yum安裝即可

go環境配置

  • 下載go

cd /usr/local/src
wget https://golang.org/doc/install?download=go1.5.2.linux-amd64.tar.gz
  • 解包

cd /usr/local/src
tar -C /usr/local -xzf go1.5.2.linux-amd64.tar.gz
  • 新建gopath

mkdir /usr/local/gopkg
  • 配置go環境變數

vim /etc/profile
  • 新增如下資訊

export GOROOT=/usr/local/go
export GOPATH=/usr/local/gopkg
export PATH=$GOROOT/bin:$PATH
  • 重新整理配置檔案:

source /etc/profile
  • 檢視go版本:

[root@codis01 ~]#go version
go version go1.5.2 linux/amd64

編譯open-falcon

cd $GOPATH/src/github.com/open-falcon/
git clone https://github.com/open-falcon/falcon-plus.git

make all

make pack

這時候,你會在當前目錄下面,得到open-falcon-v0.2.0.tar.gz的壓縮包,就表示已經編譯和打包成功了。

安裝open-falcon

cp $GOPATH/src/github.com/open-falcon/falcon-plus/open-falcon-v0.2.0.tar.gz /usr/local/src

cd /usr/local/src/
tar zxvf open-falcon-v0.2.0.tar.gz -C /usr/local/open-falcon

修改配置檔案

open-falcon每個元件的配置檔案都存放在該目錄下的config下,修改相應地址與資料庫資訊即可

匯入資料庫

cd /usr/local/src/ && git clone https://github.com/open-falcon/falcon-plus.git 
cd /usr/local/src/falcon-plus/scripts/mysql/db_schema/

mysql -h 127.0.0.1 -uroot -p < 1_uic-db-schema.sql
mysql -h 127.0.0.1 -uroot -p < 2_portal-db-schema.sql
mysql -h 127.0.0.1 -uroot -p < 3_dashboard-db-schema.sql
mysql -h 127.0.0.1 -uroot -p < 4_graph-db-schema.sql
mysql -h 127.0.0.1 -uroot -p < 5_alarms-db-schema.sql

啟動open-falcon後端服務

  • 啟動

cd /usr/local/open-falcon
./open-falcon start
  • 檢查服務狀態

./open-falcon check
  • 更多的命令列工具用法

# ./open-falcon [start|stop|restart|check|monitor|reload] module
./open-falcon start agent

./open-falcon check
        falcon-graph         UP           53007
          falcon-hbs         UP           53014
        falcon-judge         UP           53020
     falcon-transfer         UP           53026
       falcon-nodata         UP           53032
   falcon-aggregator         UP           53038
        falcon-agent         UP           53044
      falcon-gateway         UP           53050
          falcon-api         UP           53056
        falcon-alarm         UP           53063

For debugging , You can check $WorkDir/$moduleName/log/logs/xxx.log

安裝dashboard

  • 克隆程式碼

cd /usr/local/open-falcon
git clone https://github.com/open-falcon/dashboard.git
  • 安裝依賴

yum install -y python-virtualenv
yum install -y python-devel
yum install -y openldap-devel
yum install -y mysql-devel
yum groupinstall "Development tools"


cd /usr/local/open-falcon/dashboard/
virtualenv ./env

./env/bin/pip install -r pip_requirements.txt -i http://pypi.douban.com/simple
  • 修改配置

dashboard的配置檔案為: 'rrd/config.py',請根據實際情況修改

## API_ADDR 表示後端api元件的地址
API_ADDR = "http://127.0.0.1:8080/api/v1" 

## 根據實際情況,修改PORTAL_DB_*, 預設使用者名稱為root,預設密碼為""
## 根據實際情況,修改ALARM_DB_*, 預設使用者名稱為root,預設密碼為""
  • 啟動dashboard

cd /usr/local/open-falcon/dashboard
bash control start

相關文章