open-falcon 搭建

  • 1,open-falcon 搭建
  • 2,安装依赖
  • 3,编译
  • 3,运行
  • 4,安装前端
  • 5,数据库连接报错
  • 6,设置环境变量
  • 7,安装问题,不要安装编译版本,要安装二进制版本
  • 8,设置环境变量

1,open-falcon 搭建

  • 系统
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:    18.04
Codename:   bionic
  • git 安装
# apt install -y git
# git --version
git version 2.17.1
  • go 安装
# wget https://dl.google.com/go/go1.13.4.linux-amd64.tar.gz
# tar -zxvf go1.13.4.linux-amd64.tar.gz -C /usr/local/
# ln -s /usr/local/go/bin/* /usr/bin/
# go version
go version go1.13.4 linux/amd64
  • go环境变量
# go env | grep GOROOT
GOROOT="/usr/local/go"
# go env | grep GOPATH
GOPATH="/root/go"# pwd
/root
# mkdir mygo
# cd mygo/
# mkdir src pkg bin# vim /root/.bashr
# tail /root/.bashrc
export GOROOT=/usr/local/go
export GOPATH=/root/mygo
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin# source /root/.bashr
# go env | grep GOPATH
GOPATH="/root/mygo"

2,安装依赖

  • redis安装
# apt-get install redis-server -y
  • redis-server运行redis
# redis-server
18635:C 27 Nov 22:56:46.506 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
18635:C 27 Nov 22:56:46.506 # Redis version=4.0.9, bits=64, commit=00000000, modified=0, pid=18635, just started
18635:C 27 Nov 22:56:46.506 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
18635:M 27 Nov 22:56:46.508 * Increased maximum number of open files to 10032 (it was originally set to 1024).
18635:M 27 Nov 22:56:46.509 # Creating Server TCP listening socket *:6379: bind: Address already in use
  • redis成功启动
# redis-cli
127.0.0.1:6379> ping
PONG
  • mysql安装
# apt-get install mysql-server -y
  • mysql服务运行
# 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> exit
# mkdir -p $GOPATH/src/github.com/open-falcon
# cd $GOPATH/src/github.com/open-falcon
# git clone git@github.com:open-falcon/falcon-plus.git# git clone https://github.com/open-falcon/falcon-plus.git# cd falcon-plus/scripts/mysql/db_schema/
  • 不用设置密码回车就行
# mysql -h 127.0.0.1 -u root -p < 1_uic-db-schema.sql
Enter password:
# mysql -h 127.0.0.1 -u root -p < 2_portal-db-schema.sql
Enter password:mysql -h 127.0.0.1 -u root -p < 3_dashboard-db-schema.sql
Enter password:
# mysql -h 127.0.0.1 -u root -p < 4_graph-db-schema.sql
Enter password:mysql -h 127.0.0.1 -u root -p < 5_alarms-db-schema.sql
Enter password:

3,编译

# cd $GOPATH/src/github.com/open-falcon/falcon-plus/
# apt install make -y
# apt install gcc -y
# make all
# make agent
go build -ldflags "-X main.BinaryName=agent -X main.GitCommit=`git rev-parse --short HEAD` -X main.Version=0.3.x" -o bin/agent/falcon-agent ./modules/agentmake pack
go build -ldflags "-X main.BinaryName=Open-Falcon -X main.GitCommit=`git rev-parse --short HEAD` -X main.Version=0.3.x" -o open-falcon
tar -C out -zcf open-falcon-v0.3.x.tar.gz .
# mkdir /root/open-falcon
# tar -zxvf open-falcon-v0.3.x.tar.gz -C /root/open-falcon/

3,运行

  • 启动所有的后端组件./open-falcon start
# ./open-falcon start
[falcon-graph] 9065
[falcon-hbs] 9081
[falcon-judge] 9095
[falcon-transfer] 9105
[falcon-nodata] 9116
[falcon-aggregator] 9127
[falcon-agent] 9140
[falcon-gateway] 9155
[falcon-api] 9165
[falcon-alarm] 9181
  • 检查模块启动情况
# ./open-falcon checkfalcon-graph         UP            9065falcon-hbs         UP            9081falcon-judge         UP            9095falcon-transfer         UP            9105falcon-nodata         UP            9116falcon-aggregator         UP            9127falcon-agent         UP            9140falcon-gateway         UP            9155falcon-api         UP            9165falcon-alarm         UP            9181

4,安装前端

# pwd
/root/open-falcon
# git clone git@github.com:open-falcon/dashboard.git# 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# ./env/bin/pip install -r pip_requirements.txt -i https://pypi.douban.com/simple
# ./env/bin/pip install -r pip_requirements.txt
  • 配置文件
# cat rrd/config.py
  • 生产环境启动bash control start
# bash control start
falcon-dashboard started..., pid=15164
# bash control stop
  • 查看日志bash control tail
# bash control tail
[2019-11-28 17:21:25 +0000] [15164] [INFO] Starting gunicorn 19.9.0
[2019-11-28 17:21:25 +0000] [15164] [INFO] Listening at: http://0.0.0.0:8081 (15164)
[2019-11-28 17:21:25 +0000] [15164] [INFO] Using worker: sync
[2019-11-28 17:21:25 +0000] [15169] [INFO] Booting worker with pid: 15169
[2019-11-28 17:21:25 +0000] [15170] [INFO] Booting worker with pid: 15170
[2019-11-28 17:21:25 +0000] [15171] [INFO] Booting worker with pid: 15171
[2019-11-28 17:21:25 +0000] [15172] [INFO] Booting worker with pid: 15172

5,数据库连接报错

  • 查看日志
# tail /root/open-falcon/nodata/logs/nodata.log
db.go:38: config.InitDB error Error 1045: Access denied for user 'real_user'@'localhost' (using password: YES)
  • real_user:real_password替换为root:
  • 服务器登陆用户名为root,密码为空
grep -ilr real_user:real_password | xargs -n1 -- sed -i 's/real_user:real_password/root:/g'

6,设置环境变量

# echo 'export PATH=$PATH:/root/open-falcon' >> .bashrc
# source .bashrc
# which open-falcon
/root/open-falcon/open-falcon
# open-falcon checkfalcon-graph         UP            3769falcon-hbs         UP            3784falcon-judge         UP            3797falcon-transfer         UP            3807falcon-nodata         UP            3818falcon-aggregator         UP            3828falcon-agent         UP            3840falcon-gateway         UP            3855falcon-api         UP            3866falcon-alarm         UP            3883

7,安装问题,不要安装编译版本,要安装二进制版本

# ./open-falcon checkfalcon-graph       DOWN               -falcon-hbs       DOWN               -falcon-judge       DOWN               -falcon-transfer       DOWN               -falcon-nodata       DOWN               -falcon-aggregator       DOWN               -falcon-agent       DOWN               -falcon-gateway       DOWN               -falcon-api       DOWN               -falcon-alarm       DOWN               -
  • ERROR
# ./open-falcon start
expect config file: graph/config/cfg.json
# pwd
/root/go/src/github.com/open-falcon/falcon-plus/modules/graph
# cp cfg.example.json cfg.json
  • cfg.example.json 配置文件都改为 cfg.json
pwd
/root/go/src/github.com/open-falcon/falcon-plus/modules
# ls
agent  aggregator  alarm  api  gateway  graph  hbs  judge  nodata  transfer

8,设置环境变量

# echo 'export PATH=$PATH:/root/go/src/github.com/open-falcon/falcon-plus' >> /root/.bashrc
# source /root/.bashrc
# which open-falcon
/root/go/src/github.com/open-falcon/falcon-plus/open-falcon

参考:

  1. open-falcon github
  2. open-falcon 中文指导文档
  3. go Downloads
  4. Linux下Go的安装、配置 、升级和卸载
  5. Redis 安装
  6. macOS git 连接 github
  7. centos7 部署 open-falcon 0.2.1

open-falcon 搭建相关推荐

  1. U-Boot 之零 源码文件、启动阶段(TPL、SPL)、FALCON、设备树

      最近,工作重心要从裸机开发转移到嵌入式 Linux 系统开发,在之前的博文 Linux 之八 完整嵌入式 Linux 环境.(交叉)编译工具链.CPU 体系架构.嵌入式系统构建工具 中详细介绍了嵌 ...

  2. Linux监控平台搭建Zabbix(资源)

    2019独角兽企业重金招聘Python工程师标准>>> 自动化监控: 1.cobbler实现自动装机 2.saltstack实现工程自动化配置 3.kubernetes实现容器自动化 ...

  3. HaaS UI小程序解决方案基础教学之二: 搭建第一个UI页面

    名词解释 AliOS Things: 阿里云智能IoT团队自研的物联网操作系统,目前已获得国家 HaaS:全称是Hardware as a Service,阿里云智能IoT团队基于AliOS Thin ...

  4. 视频教程-Prometheus+Grafana搭建全方位的监控告警系统-Linux

    Prometheus+Grafana搭建全方位的监控告警系统 高级运维工程师.资深DevOps工程师,精通kubernetes容器编排工具,熟练使用linux操作系统,多年线上线下教学经验 韩先超 ¥ ...

  5. 开源运维监控工具open falcon

    小米发布的运维监控工具:open falcon 项目地址:http://open-falcon.org/ Introduction 监控系统是整个运维环节,乃至整个产品生命周期中最重要的一环,事前及时 ...

  6. Ambari——大数据平台的搭建利器之进阶篇

    Ambari--大数据平台的搭建利器之进阶篇 [日期:2015-07-14] 来源:IBM  作者: [字体:大 中 小] Ambari 的现状 目前 Apache Ambari 的最高版本是 2.0 ...

  7. 正式压力测试:locust进阶,超简单搭建生产级locust集群

    locust进阶,搭建生产级locust集群 本教程基于k8s集群搭建,使用helm作为包管理工具 通过helm安装locust

  8. 使用Docker搭建svn服务器教程

    使用Docker搭建svn服务器教程 svn简介 SVN是Subversion的简称,是一个开放源代码的版本控制系统,相较于RCS.CVS,它采用了分支管理系统,它的设计目标就是取代CVS.互联网上很 ...

  9. hexo-github-博客搭建指南

    经过一天的折腾,总算是把博客搭建好了,在这里记录下搭建博客过程中参考的资料.搭建这个博客的主要目的是记录自己的学习.成长过程,而是否有人看,又有多少人看对我来说不是重点. 搭建博客过程重要参考以下几个 ...

  10. Anaconda3+python3.7.10+TensorFlow2.3.0+PyQt5环境搭建

    Anaconda3+python3.7.10+TensorFlow2.3.0+PyQt5环境搭建 一.Anaconda 创建 python3.7环境 1.进入 C:\Users\用户名 目录下,找到 ...

最新文章

  1. JS实现全选、反选、不选
  2. 图解Ubuntu中pidgin登陆IRC
  3. 互联网广告系统综述一生态圈
  4. 蝴蝶优化算法_腾讯机智团队分享--AllReduce算法的前世今生
  5. mongodb、mysql、redis的性能对比
  6. sed替换html标签,sed多次替换
  7. 微电子学前沿讲座三-国产EDA的困境-刘伟民博士
  8. GIF是什么格式的文件
  9. Android简单的编写一个txt阅读器(没有处理字符编码),适用于新手学习
  10. 王者荣耀android换ios,2021王者荣耀安卓账号可以转苹果吗 2021年安卓账号转移到ios方法...
  11. 汇编语言学习笔记06——加减乘除和其他一些指令
  12. [wayfarer]PetShop之表示层设计
  13. python英汉字典,Python基于有道实现英汉字典功能,python英汉字典
  14. Android自定义Drawable第十五式之啡常OK
  15. android2019开源框架
  16. 递归求 n 阶勒让德多项式
  17. 分子生物学 第三章 基因、基因组及基因组学
  18. 从零开始使用webpack 搭建vue项目
  19. 计算机应用教学对象分析,编辑演示文稿计算机应用基础教材分析学情分析教学目标重点难点 .ppt...
  20. 预测赢家_云的赢家和输家?

热门文章

  1. 20种赛博朋克摄影调色luts预设
  2. 8种新年烟花摄影调色luts预设
  3. 燕秀计算机打印区域文字高度,CAD 让文字显示在指定区域,自动根据文字内容调整文字高度...
  4. 象棋30种绝杀秘籍大全,GIF图解灵活运用可百战百胜,绝无敌手
  5. 怎么锻炼出顶尖程序员的编码套路(转)
  6. 无人机飞行控制实验平台
  7. 怎么彻底删除光速搜索
  8. 阿里云dos木马及xmrig矿毒
  9. 个人喜欢的学习SAP的书
  10. linux截图工具下载,Ubuntu 安装 Linux Deepin 截图工具(.deb)