ubuntu 安装 open-falcon falcon-plus
1,系统版本
# cat /etc/issue
Ubuntu 18.04.4 LTS \n \l
2,下载open-falcon-v0.3.tar.gz
wget https://github.com/open-falcon/falcon-plus/releases/download/v0.3/open-falcon-v0.3.tar.gz
open-falcon-v0.3.tar.gz
# mkdir open-falcon
# tar -zxvf open-falcon-v0.3.tar.gz -C open-falcon/
3,安装依赖
go
# go version
go version go1.14.2 linux/amd64
redis
# apt-get install redis-server -y
# redis-server
# redis-cli
127.0.0.1:6379> exit
mysql
# apt-get install mysql-server -y
# systemctl status mysql.service
# mysql -u root
mysql> show databases;
mysql> use mysql;
mysql> show tables;
mysql> select User,Host,plugin from user;
+------------------+-----------+-----------------------+
| User | Host | plugin |
+------------------+-----------+-----------------------+
| root | localhost | auth_socket |
| mysql.session | localhost | mysql_native_password |
| mysql.sys | localhost | mysql_native_password |
| debian-sys-maint | localhost | mysql_native_password |
+------------------+-----------+-----------------------+
mysql> update user set plugin='mysql_native_password' where User='root';
mysql> FLUSH PRIVILEGES;
mysql> select Host,User,authentication_string,plugin from user;
+-----------+------------------+-------------------------------------------+-----------------------+
| Host | User | authentication_string | plugin |
+-----------+------------------+-------------------------------------------+-----------------------+
| localhost | root | | mysql_native_password |
| localhost | mysql.session | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | mysql_native_password |
| localhost | mysql.sys | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | mysql_native_password |
| localhost | debian-sys-maint | *28B8AF6C578D817A9A3B2B57AF6217A014A65AF4 | mysql_native_password |
+-----------+------------------+-------------------------------------------+-----------------------+
4 rows in set (0.00 sec)
mysql> update user set Host='%' where User='root';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select Host,User,authentication_string,plugin from user;
+-----------+------------------+-------------------------------------------+-----------------------+
| Host | User | authentication_string | plugin |
+-----------+------------------+-------------------------------------------+-----------------------+
| % | root | | mysql_native_password |
| localhost | mysql.session | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | mysql_native_password |
| localhost | mysql.sys | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | mysql_native_password |
| localhost | debian-sys-maint | *28B8AF6C578D817A9A3B2B57AF6217A014A65AF4 | mysql_native_password |
+-----------+------------------+-------------------------------------------+-----------------------+
4 rows in set (0.00 sec)
mysql> grant all on *.* to 'root'@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
- mysql配置文件注释
bind-address
# vim /etc/mysql/mysql.conf.d/mysqld.cnf
#bind-address = 127.0.0.1
systemctl restart mysql.service
4,运行
# pwd
/root/open-falcon
# ./open-falcon start
# ./open-falcon check
- 报错
# pwd
/root/open-falcon/graph/logs
# cat graph.log
g.ParseConfig ok, file /root/open-falcon/graph/config/cfg.json
g.InitDB, get db conn fail Error 1049: Unknown database 'graph'
- 下载
scripts/mysql/db_schema
# pwd
/root/db_schema
# ls
1_uic-db-schema.sql 2_portal-db-schema.sql 3_dashboard-db-schema.sql 4_graph-db-schema.sql 5_alarms-db-schema.sql
- 初始化数据库,密码回车
# mysql -h 127.0.0.1 -u root -p < 1_uic-db-schema.sql
# mysql -h 127.0.0.1 -u root -p < 2_portal-db-schema.sql
# mysql -h 127.0.0.1 -u root -p < 3_dashboard-db-schema.sql
# mysql -h 127.0.0.1 -u root -p < 4_graph-db-schema.sql
# mysql -h 127.0.0.1 -u root -p < 5_alarms-db-schema.sql
- 运行成功
# ./open-falcon start
[falcon-graph] 11003
[falcon-hbs] 11021
[falcon-judge] 11034
[falcon-transfer] 11043
[falcon-nodata] 11054
[falcon-aggregator] 11064
[falcon-agent] 11077
[falcon-gateway] 11089
[falcon-api] 11099
[falcon-alarm] 11115
# ./open-falcon check
falcon-graph UP 11003
falcon-hbs UP 11021
falcon-judge UP 11034
falcon-transfer UP 11043
falcon-nodata UP 11054
falcon-aggregator UP 11064
falcon-agent UP 11077
falcon-gateway UP 11089
falcon-api UP 11099
falcon-alarm UP 11115
5,安装前端web
git clone https://github.com/open-falcon/dashboard.git
- 安装依赖
apt install -y python-virtualenv slapd ldap-utils libmysqld-dev build-essential python-dev libldap2-dev libsasl2-dev libssl-dev
# pwd
/root/open-falcon/dashboard
# virtualenv ./env
Running virtualenv with interpreter /usr/bin/python2
New python executable in /root/open-falcon/dashboard/env/bin/python2
Also creating executable in /root/open-falcon/dashboard/env/bin/python
# virtualenv ./env
Running virtualenv with interpreter /usr/bin/python2
New python executable in /root/open-falcon/dashboard/env/bin/python2
Not overwriting existing python script /root/open-falcon/dashboard/env/bin/python (you must use /root/open-falcon/dashboard/env/bin/python2)
Installing setuptools, pkg_resources, pip, wheel...
Complete output from command /root/open-falcon/dashboard/env/bin/python2 - setuptools pkg_resources pip wheel:
Collecting setuptools
Downloading https://files.pythonhosted.org/packages/ab/b5/3679d7c98be5b65fa5522671ef437b792d909cf3908ba54fe9eca5d2a766/setuptools-44.1.0-py2.py3-none-any.whl (583kB)
Exception:
Traceback (most recent call last):
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/basecommand.py", line 215, in main
status = self.run(options, args)
apt install python-pip -y
virtualenv ./env
运行成功
# virtualenv ./env
Running virtualenv with interpreter /usr/bin/python2
New python executable in /root/open-falcon/dashboard/env/bin/python2
Not overwriting existing python script /root/open-falcon/dashboard/env/bin/python (you must use /root/open-falcon/dashboard/env/bin/python2)
Installing setuptools, pkg_resources, pip, wheel...++++done.
# ./env/bin/pip install -r pip_requirements.txt -i https://pypi.douban.com/simple
# ./env/bin/pip install -r pip_requirements.txt
- 运行前端
# bash control start
falcon-dashboard started..., pid=21240
- 查看日志
# bash control tail
[2020-04-26 14:34:02 +0000] [21240] [INFO] Starting gunicorn 19.9.0
[2020-04-26 14:34:02 +0000] [21240] [INFO] Listening at: http://0.0.0.0:8081 (21240)
[2020-04-26 14:34:02 +0000] [21240] [INFO] Using worker: sync
[2020-04-26 14:34:02 +0000] [21245] [INFO] Booting worker with pid: 21245
[2020-04-26 14:34:02 +0000] [21247] [INFO] Booting worker with pid: 21247
[2020-04-26 14:34:02 +0000] [21249] [INFO] Booting worker with pid: 21249
[2020-04-26 14:34:02 +0000] [21250] [INFO] Booting worker with pid: 21250
参考: