详解监控open-falcon部署,避免踩坑

详解open-falcon部署,避免踩坑

环境是centos系统

1.配置gopath环境变量

1.配置go环境变量
	1.1.vim /etc/profile 将下面的配置添加进去
	    export GOROOT=/usr/local/go         
        export GOPATH=/usr/local/gocode 
        export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
    
    1.2.并激活环境变量 source /etc/profile


注意:
  由于open-falcon当前版本还是用go vendor包管理
  但是现在的很多环境基本都用go mod包管理工具替换了
  先查看当前环境go env, 如果使用的是go mod格式,就先将其关闭
  go env -w GO111MODULE="off"  也可以  export GO111MODULE=off

2.安装redis

1.wget下载 (指定版本可以去redis官网看下有哪些版本)
	wget https://download.redis.io/releases/redis-6.2.6.tar.gz

2.解压
	mv redis-6.2.6.tar.gz /opt
	tar -xzvf redis-6.2.6.tar.gz

3.安装
	3.1 建立软链接
	    ln -s redis-6.2.6.tar.gz redis (测试环境不需要这一步)
	    建立一个redis目录的软链接 指向redis-6.2.6.tar.gz,不把redis目录固定指定的版本上 有利于redis未来的升级

	3.2 编译
	    1. cd redis-6.2.6/
	    2. make (编译 编译之前确保操作系统已经安装gcc)

    3.3 安装执行文件
        1.make install 
	    解释:安装redis相关运行文件到/usr/local/bin下 这样可以保证在任何文件下都可以执行redis-cli 
        否则只能在/opt/redis-6.2.6/src目录下执行
      
    3.4 redis后台启动
      1. cd /opt/redis-6.2.6/
      2. vim redis.conf
         更改daemonize yes
      3.redis-server /opt/redis-6.2.6/redis.conf 进入后台运行

open-falcon提供的安装语句yum install -y redis

3.安装mysql

1.强制卸载mariadb
  rpm -e --nodeps mariadb-libs-5.5.65-1.el7.x86_64

2.查询
  pm -qa|grep mariadb 没结果就是删除成功


3.官网下载页面 https://dev.mysql.com/downloads/repo/yum/
    找到centos对应的版本
    Red Hat Enterprise Linux 7 / Oracle Linux 7 (Architecture Independent), RPM Package		6.9K	Download
	(mysql80-community-release-el7-4.noarch.rpm)	MD5: 8b55d5fc443660fab90f9dc328a4d9ad
	
4.下载对应的版本
    wget -i -c http://dev.mysql.com/get/mysql80-community-release-el7-4.noarch.rpm
	

5.安装刚下载的rpm包
	yum localinstall mysql80-community-release-el7-4.noarch.rpm
   (网上好像还有这个安装方式 rpm -ivh mysql80-community-release-el7-4.noarch.rpm)
   
	安装这个包后,会获得两个mysql的yum-repo源:
	/etc/yum.repos.d/mysql-community.repo
	/etc/yum.repos.d/mysql-community-source.repo

6.安装mysql服务并启动
	yum install mysql-community-server
	systemctl status mysqld.service
	systemctl start mysqld.service

7.查询MySQL的临时密码
	grep 'temporary password' /var/log/mysqld.log (将临时密码复制下来)
	mysql -uroot -p 输入刚才复制的临时密码
	
	更改数据库密码
	ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';  (新密码要数字字母,否则会报错)
	
	如果需要简单的密码设置
	如果5.6版本也就是旧版本执行下面的操作
	mysql> set global validate_password_policy=0;
		   Query OK, 0 rows affected (0.00 sec)
	mysql> set global validate_password_length=1;
			Query OK, 0 rows affected (0.00 sec)

    ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
    
    
    如果是8.0版本 新版本
    需先设置一个符合的密码
	ALTER USER 'root'@'localhost' IDENTIFIED BY 'Root_root123*';
	在执行下面的操作设置新的简单的密码
	mysql> set global validate_password.policy=0;
		   Query OK, 0 rows affected (0.00 sec)
    mysql>  set global validate_password.length=1;
			Query OK, 0 rows affected (0.00 sec)
		   
	ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
	
open-falcon提供的安装语句yum install -y mysql-server 

4.下载open-falcon

1.下载open-falcon
  mkdir -p $GOPATH/src/github.com/open-falcon
  cd $GOPATH/src/github.com/open-falcon
  git clone https://github.com/open-falcon/falcon-plus.git
  
2.导入初始化mysql数据库/表的sql语句
	cd $GOPATH/src/github.com/open-falcon/falcon-plus/scripts/mysql/db_schema/
	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

5.部署open-falcon

第一种部署方式:
1.切换目录
cd $GOPATH/src/github.com/open-falcon/falcon-plus/

2.vi config/confgen.sh

confs=(
    '%%AGENT_HTTP%%=0.0.0.0:1988'
    '%%AGGREGATOR_HTTP%%=0.0.0.0:6055'
    '%%GRAPH_HTTP%%=0.0.0.0:6071'
    '%%GRAPH_RPC%%=0.0.0.0:6070'
    '%%HBS_HTTP%%=0.0.0.0:6031'
    '%%HBS_RPC%%=0.0.0.0:6030'
    '%%JUDGE_HTTP%%=0.0.0.0:6081'
    '%%JUDGE_RPC%%=0.0.0.0:6080'
    '%%NODATA_HTTP%%=0.0.0.0:6090'
    '%%TRANSFER_HTTP%%=0.0.0.0:6060'
    '%%TRANSFER_RPC%%=0.0.0.0:8433'
    '%%REDIS%%=127.0.0.1:6379'
    '%%MYSQL%%=user:password@tcp(127.0.0.1:3306)'   //将这里的数据库账户密码更换成自己机器数据库的配置 这样就会更新所有配置
    '%%PLUS_API_DEFAULT_TOKEN%%=default-token-used-in-server-side'
    '%%PLUS_API_HTTP%%=0.0.0.0:8080'
 )
 
3.打包
	注: 由于涉及数据库驱动 需要cd $GOPATH/src/ 然后go get -u github.com/go-sql-driver/mysql
	下载mysql驱动

    cd $GOPATH/src/github.com/open-falcon/falcon-plus/
	# make all modules
  	make all

	# make specified module
  	make agent

	# pack all modules
  	make pack

    生成安装包
    open-falcon-v0.3.x.tar.gz
第二种部署方式:
1.可以直接取官网安装包
  https://github.com/open-falcon/falcon-plus/releases
  
  解压
  mkdir -p /opt/open-falcon
  tar -xzvf open-falcon-v0.3.x.tar.gz -C /opt/open-falcon
  
  切换目录
  cd /opt/open-falcon
  
  当前目录将配置文件的数据库密码更新
  grep -Ilr 3306  ./ | xargs -n1 -- sed -i 's/root:/real_user:real_password/g'   
  

2.启动open-falcon
 ./open-falcon start

 # check modules status
 ./open-falcon check

6.open-falcon前端环境创建

1.进入刚建立的falcon目录
    cd /opt/open-falcon

2.克隆项目
    git clone https://github.com/open-falcon/dashboard.git

3.进入目录 cd dashboard;

    yum install -y python-virtualenv
	yum install -y python-devel
	yum install -y openldap-devel
	yum install -y mysql-devel
	yum groupinstall "Development tools"
  
4. python安装需要区分环境
    4.1. 官方给的创建流程是下面这样的
	    virtualenv ./env                              //创建一个单独的虚拟环境 
	    ./env/bin/pip install -r pip_requirements.txt

	
    4.2.我的机器有两个python环境 安装dashboard用python2.7虚拟环境
 		1.1.如果要创建python2的环境的话,命令为
		virtualenv -p /usr/bin/python2.7 ./env      
	    ./env/bin/pip install -r pip_requirements.txt
	
		1.2.如果要创建python3的环境话,命令为
		virtualenv -p /usr/bin/python3.6 ./env
        ./env/bin/pip install -r pip_requirements.txt
	 
	   在单独的虚拟环境执行pip命令(./env/bin/pip -V可以查看自己版本)
   
    4.3 如果安装mysql-python的时候一直报错
        没找到mysql.h文件,可以按照下面的方式解决
    

注意:安装mysql-python的问题

sudo vim /usr/include/my_config.h
/* Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License, version 2.0,
  as published by the Free Software Foundation.
 
  This program is also distributed with certain software (including
  but not limited to OpenSSL) that is licensed under separate terms,
  as designated in a particular file or component or in included license
  documentation.  The authors of MySQL hereby grant you an additional
  permission to link the program and your derivative works with the
  separately licensed software that they have included with MySQL.
 
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License, version 2.0, for more details.
 
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA */
 
 #ifndef MY_CONFIG_H
 #define MY_CONFIG_H
 
 /*
  * From configure.cmake, in order of appearance 
  */
 /* #undef HAVE_LLVM_LIBCPP */
 
 /* Libraries */
 #define HAVE_LIBM 1
 /* #undef HAVE_LIBNSL */
 #define HAVE_LIBCRYPT 1
 /* #undef HAVE_LIBSOCKET */
 #define HAVE_LIBDL 1
 #define HAVE_LIBRT 1
 /* #undef HAVE_LIBWRAP */
 /* #undef HAVE_LIBWRAP_PROTOTYPES */
 
 /* Header files */
 #define HAVE_ALLOCA_H 1
 #define HAVE_ARPA_INET_H 1
 #define HAVE_DLFCN_H 1
 #define HAVE_EXECINFO_H 1
 #define HAVE_FPU_CONTROL_H 1
 #define HAVE_GRP_H 1
 /* #undef HAVE_IEEEFP_H */
 #define HAVE_LANGINFO_H 1
 /* #undef HAVE_LSAN_INTERFACE_H */
 #define HAVE_MALLOC_H 1
 #define HAVE_NETINET_IN_H 1
 #define HAVE_POLL_H 1
 #define HAVE_PWD_H 1
 #define HAVE_STRINGS_H 1
 #define HAVE_SYS_CDEFS_H 1
 #define HAVE_SYS_IOCTL_H 1
 #define HAVE_SYS_MMAN_H 1
 #define HAVE_SYS_RESOURCE_H 1
 #define HAVE_SYS_SELECT_H 1
 #define HAVE_SYS_SOCKET_H 1
 #define HAVE_TERM_H 1
 #define HAVE_TERMIOS_H 1
 #define HAVE_TERMIO_H 1
 #define HAVE_UNISTD_H 1
 #define HAVE_SYS_WAIT_H 1
 #define HAVE_SYS_PARAM_H 1
 #define HAVE_FNMATCH_H 1
 #define HAVE_SYS_UN_H 1
 /* #undef HAVE_VIS_H */
 #define HAVE_SASL_SASL_H 1
 
 /* Libevent */
 /* #undef HAVE_DEVPOLL */
 /* #undef HAVE_SYS_DEVPOLL_H */
 #define HAVE_SYS_EPOLL_H 1
 #define HAVE_TAILQFOREACH 1
 
 /* Functions */
 /* #undef HAVE_ALIGNED_MALLOC */
 #define HAVE_BACKTRACE 1
 /* #undef HAVE_PRINTSTACK */
 #define HAVE_INDEX 1
 #define HAVE_CHOWN 1
 #define HAVE_CUSERID 1
 /* #undef HAVE_DIRECTIO */
 #define HAVE_FTRUNCATE 1
 #define HAVE_FCHMOD 1
 #define HAVE_FCNTL 1
 #define HAVE_FDATASYNC 1
 #define HAVE_DECL_FDATASYNC 1 
 #define HAVE_FEDISABLEEXCEPT 1
 #define HAVE_FSEEKO 1
 #define HAVE_FSYNC 1
 /* #undef HAVE_GETHRTIME */
 #define HAVE_GETNAMEINFO 1
 #define HAVE_GETPASS 1
 /* #undef HAVE_GETPASSPHRASE */
 #define HAVE_GETPWNAM 1
 #define HAVE_GETPWUID 1
 #define HAVE_GETRLIMIT 1
 #define HAVE_GETRUSAGE 1
 #define HAVE_INITGROUPS 1
 /* #undef HAVE_ISSETUGID */
 #define HAVE_GETUID 1
 #define HAVE_GETEUID 1
 #define HAVE_GETGID 1
 #define HAVE_GETEGID 1
 /* #undef HAVE_LSAN_DO_RECOVERABLE_LEAK_CHECK */
 #define HAVE_MADVISE 1
 #define HAVE_MALLOC_INFO 1
 #define HAVE_MEMRCHR 1
 #define HAVE_MLOCK 1
 #define HAVE_MLOCKALL 1
 #define HAVE_MMAP64 1
 #define HAVE_POLL 1
 #define HAVE_POSIX_FALLOCATE 1
 #define HAVE_POSIX_MEMALIGN 1
 #define HAVE_PREAD 1
 #define HAVE_PTHREAD_CONDATTR_SETCLOCK 1
 #define HAVE_PTHREAD_SIGMASK 1
 /* #undef HAVE_SETFD */
 #define HAVE_SIGACTION 1
 #define HAVE_SLEEP 1
 #define HAVE_STPCPY 1
 #define HAVE_STPNCPY 1
 /* #undef HAVE_STRLCPY */
 /* #undef HAVE_STRLCAT */
 #define HAVE_STRSIGNAL 1
 /* #undef HAVE_FGETLN */
 #define HAVE_STRSEP 1
 /* #undef HAVE_TELL */
 #define HAVE_VASPRINTF 1
 #define HAVE_MEMALIGN 1
 #define HAVE_NL_LANGINFO 1
 /* #undef HAVE_HTONLL */
 #define HAVE_EPOLL 1
 /* #undef HAVE_EVENT_PORTS */
 #define HAVE_INET_NTOP 1
 /* #undef HAVE_WORKING_KQUEUE */
 #define HAVE_TIMERADD 1
 #define HAVE_TIMERCLEAR 1
 #define HAVE_TIMERCMP 1
 #define HAVE_TIMERISSET 1
 
 /* WL2373 */
 #define HAVE_SYS_TIME_H 1
 #define HAVE_SYS_TIMES_H 1
 #define HAVE_TIMES 1
 #define HAVE_GETTIMEOFDAY 1
 
 /* Symbols */
 #define HAVE_LRAND48 1
 #define GWINSZ_IN_SYS_IOCTL 1
 #define FIONREAD_IN_SYS_IOCTL 1
 /* #undef FIONREAD_IN_SYS_FILIO */
 
 #define HAVE_ISINF 1
 
 /* #undef HAVE_KQUEUE */
 /* #undef HAVE_KQUEUE_TIMERS */
 #define HAVE_POSIX_TIMERS 1
 
 /* Endianess */
 /* #undef WORDS_BIGENDIAN */
 
 /* Type sizes */
 #define SIZEOF_VOIDP     8
 #define SIZEOF_CHARP     8
 #define SIZEOF_LONG      8
 #define SIZEOF_SHORT     2
 #define SIZEOF_INT       4
 #define SIZEOF_LONG_LONG 8
 #define SIZEOF_OFF_T     8
 #define SIZEOF_TIME_T    8
 #define HAVE_ULONG 1
 #define HAVE_U_INT32_T 1
 
 /* Support for tagging symbols with __attribute__((visibility("hidden"))) */
 #define HAVE_VISIBILITY_HIDDEN 1
 
 /* Code tests*/
 #define HAVE_CLOCK_GETTIME 1
 #define HAVE_CLOCK_REALTIME 1
 #define DNS_USE_CPU_CLOCK_FOR_ID 1
 #define STACK_DIRECTION -1
 #define TIME_WITH_SYS_TIME 1
 /* #undef NO_FCNTL_NONBLOCK */
 #define HAVE_PAUSE_INSTRUCTION 1
 /* #undef HAVE_FAKE_PAUSE_INSTRUCTION */
 /* #undef HAVE_HMT_PRIORITY_INSTRUCTION */
 #define HAVE_ABI_CXA_DEMANGLE 1
 #define HAVE_BUILTIN_UNREACHABLE 1
 #define HAVE_BUILTIN_EXPECT 1
 #define HAVE_BUILTIN_STPCPY 1
 #define HAVE_GCC_ATOMIC_BUILTINS 1
 #define HAVE_GCC_SYNC_BUILTINS 1
 /* #undef HAVE_VALGRIND */
 #define HAVE_SYS_GETTID 1
 /* #undef HAVE_PTHREAD_GETTHREADID_NP */
 /* #undef HAVE_PTHREAD_THREADID_NP */
 #define HAVE_INTEGER_PTHREAD_SELF 1
 #define HAVE_PTHREAD_SETNAME_NP 1
 /*
   This macro defines whether the compiler in use needs a 'typename' keyword
   to access the types defined inside a class template, such types are called
   dependent types. Some compilers require it, some others forbid it, and some
   others may work with or without it. For example, GCC requires the 'typename'
   keyword whenever needing to access a type inside a template, but msvc
   forbids it.
  */
 /* #undef HAVE_IMPLICIT_DEPENDENT_NAME_TYPING */
 
 /* IPV6 */
 /* #undef HAVE_NETINET_IN6_H */
 /* #undef HAVE_STRUCT_IN6_ADDR */
 
 /*
  * Platform specific CMake files
  */
 #define MACHINE_TYPE "x86_64"
 /* #undef LINUX_ALPINE */
 #define HAVE_LINUX_LARGE_PAGES 1
 /* #undef HAVE_SOLARIS_LARGE_PAGES */
 /* #undef HAVE_SOLARIS_ATOMIC */
 #define SYSTEM_TYPE "Linux"
 /* This should mean case insensitive file system */
 /* #undef FN_NO_CASE_SENSE */
 
 /*
  * From main CMakeLists.txt
  */
 #define MAX_INDEXES 64U
 /* #undef WITH_INNODB_MEMCACHED */
 /* #undef ENABLE_MEMCACHED_SASL */
 /* #undef ENABLE_MEMCACHED_SASL_PWDB */
 #define ENABLED_PROFILING 1
 /* #undef HAVE_ASAN */
 /* #undef HAVE_UBSAN */
 /* #undef ENABLED_LOCAL_INFILE */
 #define DEFAULT_MYSQL_HOME "/usr/local/mysql"
 #define SHAREDIR "/usr/local/mysql/share"
 #define DEFAULT_BASEDIR "/usr/local/mysql"
 #define MYSQL_DATADIR "/usr/local/mysql/data"
 #define MYSQL_KEYRINGDIR "/usr/local/mysql/keyring"
 #define DEFAULT_CHARSET_HOME "/usr/local/mysql"
 #define PLUGINDIR "/usr/local/mysql/lib/plugin"
 #define DEFAULT_SYSCONFDIR "/usr/local/mysql/etc"
 #define DEFAULT_TMPDIR P_tmpdir
 #define INSTALL_SBINDIR "/usr/local/mysql/bin"
 #define INSTALL_BINDIR "/usr/local/mysql/bin"
 #define INSTALL_MYSQLSHAREDIR "/usr/local/mysql/share"
 #define INSTALL_SHAREDIR "/usr/local/mysql/share"
 #define INSTALL_PLUGINDIR "/usr/local/mysql/lib/plugin"
 #define INSTALL_INCLUDEDIR "/usr/local/mysql/include"
 #define INSTALL_MYSQLDATADIR "/usr/local/mysql/data"
 #define INSTALL_MYSQLKEYRINGDIR "/usr/local/mysql/keyring"
 #define INSTALL_PLUGINTESTDIR "/export/home/pb2/build/sb_0-28300276-1524216144.25/source/plugin/x//tests"
 #define INSTALL_INFODIR "/usr/local/mysql/docs"
 #define INSTALL_MYSQLTESTDIR "/usr/local/mysql/mysql-test"
 #define INSTALL_DOCREADMEDIR "/usr/local/mysql/."
 #define INSTALL_DOCDIR "/usr/local/mysql/docs"
 #define INSTALL_MANDIR "/usr/local/mysql/man"
 #define INSTALL_SUPPORTFILESDIR "/usr/local/mysql/support-files"
 #define INSTALL_LIBDIR "/usr/local/mysql/lib"
 
 /*
  * Readline
  */
 #define HAVE_MBSTATE_T
 #define HAVE_LANGINFO_CODESET 
 #define HAVE_WCSDUP
 #define HAVE_WCHAR_T 1
 #define HAVE_WINT_T 1
 #define HAVE_CURSES_H 1
 /* #undef HAVE_NCURSES_H */
 #define USE_LIBEDIT_INTERFACE 1
 #define HAVE_HIST_ENTRY 1
 /* #undef USE_NEW_EDITLINE_INTERFACE */
 
 /*
  * Libedit
  */
 #define HAVE_DECL_TGOTO 1
 
 /*
  * Character sets
  */
 #define MYSQL_DEFAULT_CHARSET_NAME "utf8mb4"
 #define MYSQL_DEFAULT_COLLATION_NAME "utf8mb4_0900_ai_ci"
 
 /*
  * Performance schema
  */
 #define WITH_PERFSCHEMA_STORAGE_ENGINE 1
 /* #undef DISABLE_PSI_THREAD */
 /* #undef DISABLE_PSI_MUTEX */
 /* #undef DISABLE_PSI_RWLOCK */
 /* #undef DISABLE_PSI_COND */
 /* #undef DISABLE_PSI_FILE */
 /* #undef DISABLE_PSI_TABLE */
 /* #undef DISABLE_PSI_SOCKET */
 /* #undef DISABLE_PSI_STAGE */
 /* #undef DISABLE_PSI_STATEMENT */
 /* #undef DISABLE_PSI_SP */
 /* #undef DISABLE_PSI_PS */
 /* #undef DISABLE_PSI_IDLE */
 /* #undef DISABLE_PSI_ERROR */
 /* #undef DISABLE_PSI_STATEMENT_DIGEST */
 /* #undef DISABLE_PSI_METADATA */
 /* #undef DISABLE_PSI_MEMORY */
 /* #undef DISABLE_PSI_TRANSACTION */
 
 /*
  * MySQL version
  */
 #define MYSQL_VERSION_MAJOR 8
 #define MYSQL_VERSION_MINOR 0
 #define MYSQL_VERSION_PATCH 11
 #define MYSQL_VERSION_EXTRA ""
 #define PACKAGE "mysql"
 #define PACKAGE_BUGREPORT ""
 #define PACKAGE_NAME "MySQL Server"
 #define PACKAGE_STRING "MySQL Server 8.0.11"
 #define PACKAGE_TARNAME "mysql"
 #define PACKAGE_VERSION "8.0.11"
 #define VERSION "8.0.11"
 #define PROTOCOL_VERSION 10
 
 /*
  * CPU info
  */
 #define CPU_LEVEL1_DCACHE_LINESIZE 64
 
 
 /*
  * NDB
  */
 /* #undef WITH_NDBCLUSTER_STORAGE_ENGINE */
 /* #undef HAVE_PTHREAD_SETSCHEDPARAM */
 
 /*
  * Other
  */
 /* #undef EXTRA_DEBUG */
 
 /*
  * Hardcoded values needed by libevent/NDB/memcached
  */
 #define HAVE_FCNTL_H 1
 #define HAVE_GETADDRINFO 1
 #define HAVE_INTTYPES_H 1
 /* libevent's select.c is not Windows compatible */
 #ifndef _WIN32
 #define HAVE_SELECT 1
 #endif
 #define HAVE_SIGNAL_H 1
 #define HAVE_STDARG_H 1
 #define HAVE_STDINT_H 1
 #define HAVE_STDLIB_H 1
 #define HAVE_STRDUP 1
 #define HAVE_STRTOK_R 1
 #define HAVE_STRTOLL 1
 #define HAVE_SYS_STAT_H 1
 #define HAVE_SYS_TYPES_H 1
 #define SIZEOF_CHAR 1
 
 /*
  * Needed by libevent
  */
 #define HAVE_SOCKLEN_T 1
 
 /* For --secure-file-priv */
 #define DEFAULT_SECURE_FILE_PRIV_DIR "NULL"
 #define HAVE_LIBNUMA 1
 
 /* For default value of --early_plugin_load */
 /* #undef DEFAULT_EARLY_PLUGIN_LOAD */
 
 #define SO_EXT ".so"
 
 #endif



5.启动前端

1.还是在dashboard这个目录,更改相应的配置文件
	vi wsgi.py
	
	if __name__ == "__main__":
    app.run(host="0.0.0.0", port=8088, debug=False) //找一个空闲的端口 我选择的机器的8088端口

2.vi gunicorn.conf
	workers = 4
	bind = ':8088' //和刚才配置的wsgi.py配置相同
	proc_name = 'falcon-dashboard-opensource'
	pidfile = '/tmp/falcon-dashboard-opensource.pid'
	limit_request_field_size = 0
	limit_request_line = 0
	
	
3.vi rrd/config.py
# Falcon+ API

API_ADDR = os.environ.get("API_ADDR","http://127.0.0.1:8080/api/v1") 
//这里的8080要和 WorkDir下的api/config/cfg.json下的 "web_port": "0.0.0.0:8080"端口一致 也就是open-falcon的后端接口相同

API_USER = os.environ.get("API_USER","admin")
API_PASS = os.environ.get("API_PASS","password")

# portal database
# TODO: read from api instead of db
PORTAL_DB_HOST = os.environ.get("PORTAL_DB_HOST","127.0.0.1")
PORTAL_DB_PORT = int(os.environ.get("PORTAL_DB_PORT",3306))
PORTAL_DB_USER = os.environ.get("PORTAL_DB_USER","root")
PORTAL_DB_PASS = os.environ.get("PORTAL_DB_PASS","password") //数据库密码配置好
PORTAL_DB_NAME = os.environ.get("PORTAL_DB_NAME","falcon_portal")

# alarm database
# TODO: read from api instead of db
ALARM_DB_HOST = os.environ.get("ALARM_DB_HOST","127.0.0.1")
ALARM_DB_PORT = int(os.environ.get("ALARM_DB_PORT",3306))
ALARM_DB_USER = os.environ.get("ALARM_DB_USER","root")
ALARM_DB_PASS = os.environ.get("ALARM_DB_PASS","password")   //数据库密码配置好
ALARM_DB_NAME = os.environ.get("ALARM_DB_NAME","alarms")

bash control start

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

打开注册即可使用

特别鸣谢

1.https://github.com/open-falcon/falcon-plus
2.https://github.com/open-falcon/dashboard
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值