部署Open-falcon-HQL

 部署Open-falcon

==================草稿==后续会排版更新====

虚拟化平台 vmware@Workstation 10.0.1 build-1379776

系统版本 CentOS-7-x86_64-DVD-1908.iso

网络方式 NET

1 在虚拟化平台安装 CentOS 7,通过nmtui来查看网卡信息,使用ip addr 查看网卡地址,

#关闭selinux

sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

setenforce 0

#关闭防火墙

systemctl stop firewalld.service

systemctl disable firewalld.service

#重启服务器

Reboot

# 检查网卡信息

Nmtui

#修改网卡onboot=yes

cd /etc/sysconfig/network-scripts/

2 搭建阿里云yum源,这里要注意 curl –O http://mirrors.aliyun.com/repo/Centos-7.repo ,要在目录下  yum.repos.d 下执行。
具体命令如下:
[root@Open-falcon ~]# hostname Open-falcon
 
[root@Open-falcon ~]# cd /etc/yum.repos.d/
 
[root@Open-falcon yum.repos.d]# mkdir bak && mv * ./bak
 
[root@Open-falcon yum.repos.d]# curl –O http://mirrors.aliyun.com/repo/Centos-7.repo    
 
[root@Open-falcon yum.repos.d]# yum clean all
 
[root@Open-falcon yum.repos.d]# yum makecache
 
[root@Open-falcon yum.repos.d]# yum -y update    //更新所有包
 
3 安装GO语言环境

/var/run/yum.pid已被锁定,PID 为 XXXXX 的另一个程序正在运行

 https://www.cnblogs.com/Lam7/p/5848267.html

解决方法:

直接在终端运行 rm –f  /var/run/yum.pid 将该文件删除,然后再次运行yum

 
 
[root@Open-falcon ~]# yum -y install epel-release     //因为官方yum和阿里yum都没有go的安装包,故只能通过fedora的epel仓库来安装
 
[root@Open-falcon ~]# yum -y install go
且确认 版本大于 1.6版本
[root@Open-falcon ~]# go version
 
go version go1.8.3 linux/amd64
4 安装Redis
由于部署go时已经安装了epel,故直接执行下面的安装命令。
 
yum -y install redis
 
 
 
systemctl start redis
systemctl enable redis  //开机启动
[root@localhost ~]# systemctl enable redis
Created symlink from /etc/systemd/system/multi-user.target.wants/redis.service to /usr/lib/systemd/system/redis.service.
systemctl status redis    //查看状态
 
5 安装wget , vim
yum install -y wget vim
 
 
6 安装MySQL

# 获取repo源

wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
 
 

# 安装该rpm包

rpm -ivh mysql-community-release-el7-5.noarch.rpm
 
 
包名:mysql-5.6.40-linux-glibc2.12-x86_64.tar.gz(331MB)
find  /  -name “mysql*” –print   //查找系统上的mysql文件
wget https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.45-linux-glibc2.12-x86_64.tar.gz  //上一个版本找不到 代用
https://cdn.mysql.com//archives/mysql-5.6/mysql-5.6.40-linux-glibc2.12-x86_64.tar.gz 
 
FATAL ERROR: please install the following Perl modules before executing ./scripts/mysql_install_db:
Data::Dumper 

解决方法 :安装autoconf库  命令:yum -y install autoconf

 
 
 
 
 
[root@Open-falcon ~]# cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf
 
[root@Open-falcon ~]# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
 
 
 
[root@Open-falcon ~]# chmod +x /etc/init.d/mysqld
 
[root@Open-falcon ~]# /etc/init.d/mysqld start
 
 
 

[root@localhost ~]# netstat

-bash: netstat: 未找到命令

解决办法:yum -y install net-tools

netstat -antup | grep :::3306

7. 初始化Mysql数据库

 

[root@Open-falcon ~]# mkdir falcon-plus
 
[root@Open-falcon ~]# cd falcon-plus
unzip falcon-plus-master.zip 

-bash: unzip: 未找到命令

解决办法 yum install -y unzip zip

 

# 拉取源码

git clone https://github.com/open-falcon/falcon-plus.git

yum groupinstall "Development tools" –y 报错

解决办法 :yum clean all 

在运行命令

https://blog.csdn.net/u010630659/article/details/82253001 此方法不行用下面链接

https://blog.csdn.net/fzumrwang/article/details/84929484

[root@open-falcon dashboard]# yum install pip

已加载插件:fastestmirror, langpacks

Loading mirror speeds from cached hostfile

 * base: mirror.lzu.edu.cn

 * epel: fedora.cs.nctu.edu.tw

 * extras: centos.ustc.edu.cn

 * updates: centos.ustc.edu.cn

没有可用软件包 pip。

错误:无须任何处理

[root@open-falcon dashboard]# wget https://bootstrap.pypa.io/get-pip.py --no-check-certificate

[root@open-falcon dashboard]# python get-pip.py

DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support

Collecting pip

  Downloading https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl (1.4MB)

     |████████████████████████████████| 1.4MB 160kB/s

Collecting wheel

  Downloading https://files.pythonhosted.org/packages/00/83/b4a77d044e78ad1a45610eb88f745be2fd2c6d658f9798a15e384b7d57c9/wheel-0.33.6-py2.py3-none-any.whl

Installing collected packages: pip, wheel

Successfully installed pip-19.3.1 wheel-0.33.6

[root@open-falcon dashboard]# ./env/bin/pip install -r pip_requirements.txt

Collecting Flask==1.0 (from -r pip_requirements.txt (line 1))

[root@open-falcon dashboard]# ./env/bin/python wsgi.py

[warning] no local config file

 * Serving Flask app "rrd" (lazy loading)

 * Environment: production

   WARNING: Do not use the development server in a production environment.

   Use a production WSGI server instead.

 * Debug mode: off

2019-11-01 14:32:15 INFO: * Running on http://0.0.0.0:8081/ (Press CTRL+C to quit)

cd $GOPATH/src/github.com/open-falcon/falcon-plus/

tar -xzvf open-falcon-v0.3.x.tar.gz -C $WORKSPACE

./env/bin/python wsgi.py

 

open http://127.0.0.1:8081 in your browser.

报端口被占用,修改wsgi.py文件 端口为其他端口,之后重启

./env/bin/python wsgi.py

每次重启服务器都要 这2个模式下逗要重新启动

cd  /home/front/open-falcon/dashboard/

在生产环境启动

bash control start

 

以开发者模式启动 

./env/bin/python wsgi.py

issu

如果遇到这个问题  首先确认是否是多开了访问页面;其次是查看fe模块默认端口是1234,是否是8080

url:/api/v1/user/login (caused by: [errno 111] connection refused)

首先使用该命令检查是否有服务未启动

[root@open-falcon work]# ./open-falcon check

        falcon-graph         UP            6682

          falcon-hbs         UP            6701

        falcon-judge         UP            6715

     falcon-transfer         UP            6728

       falcon-nodata         UP            6739

   falcon-aggregator         UP            6751

        falcon-agent         UP            6764

      falcon-gateway         UP            6779

          falcon-api         UP            6790

        falcon-alarm         UP            6808

./open-falcon restart

全部启动服务查看 访问页面是否可以启动

猜你喜欢

转载自www.cnblogs.com/robin415972/p/11888952.html
今日推荐