安装docker

Docker 要求 Ubuntu 系统的内核版本高于 3.10

  1. uname -r
  2. wget -qO- https://get.docker.com/ | sh #获取最新版本的 Docker 安装包

2、启动docker 后台服务
sudo service docker start
#3、测试运行hello-world
docker run hello-world

  1. root@ubuntu:~# docker ps -a
  2. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
  3. 29c3416ab731 hello-world "/hello" About a minute ago Exited (0) About a minute ago angry_wright

安装open-falcon

  1. docker search open-falcon
  1. NAME DESCRIPTION STARS OFFICIAL AUTOMATED
  2. mysql MySQL is a widely used, open-source relation 7142 [OK]
  3. redis Redis is an open source key-value store that 5897 [OK]
  4. python Python is an interpreted, interactive, objec 3424 [OK]
  5. elasticsearch Elasticsearch is a powerful open source sear 3111 [OK]
  6. debian Debian is a Linux distribution that's compos… 2819 [OK]
  7. rabbitmq RabbitMQ is an open source multi-protocol me… 2219 [OK]
  8. tomcat Apache Tomcat is an open source implementati… 2086 [OK]
  9. ruby Ruby is a dynamic, reflective, object-orient… 1522 [OK]
  10. openjdk OpenJDK is an open-source implementation of … 1264 [OK]
  11. memcached Free & open source, high-performance, distri… 1157 [OK]
  12. sonarqube SonarQube is an open source platform for con… 947 [OK]
  13. cassandra Apache Cassandra is an open-source distribut… 876 [OK]
  14. ghost Ghost is a free and open source blogging pla… 855 [OK]
  15. kylemanna/openvpn ? OpenVPN server in a Docker container comp… 800 [OK]
  16. solr Solr is the popular, blazing-fast, open sour… 593 [OK]
  17. influxdb InfluxDB is an open source time series datab… 584 [OK]
  18. drupal Drupal is an open source content management … 579 [OK]
  19. rocket.chat The Complete Open Source Chat Solution 353 [OK]
  20. opensuse This project contains the stable releases of… 250 [OK]
  21. joomla Joomla! is an open source content management… 208 [OK]
  22. openshift/hello-openshift Simple Example for Running a Container on Op… 30
  23. openfalcon/falcon-plus 10
  24. frostynova/open-falcon-docker 9 [OK]
  25. open-liberty Official Open Liberty image. 6 [OK]
  26. dooma/falconcms The Falcon Conference management system 0

拉取镜像

  1. docker pull openfalcon/falcon-plus:0.2.0

启动容器

  1. docker run -h "ubuntu-xx.0.0.yy-docker-plus" --name="open-falcon-plus-10.yy-00" -p 8081:8081 -p 8433:8433 -v /open_falcon:/open_falcon -it openfalcon/falcon-plus:0.2.0 /bin/bash

修改配置文件

  1. vi /home/work/open-falcon/transfer/config/cfg.json
  2. {
  3. "debug": true,
  4. "minStep": 30,
  5. "http": {
  6. "enabled": true,
  7. "listen": "0.0.0.0:6060"
  8. },
  9. "rpc": {
  10. "enabled": true,
  11. "listen": "0.0.0.0:8433" #改成0.0.0.0 若是127.0.0.1 则不能接收外面传进来的信息
  12. },
  13. "socket": {
  14. "enabled": true,
  15. "listen": "0.0.0.0:4444",
  16. "timeout": 3600

启动服务

  1. cd /
  2. bash run.sh

配置agent指向docker。访问

docker安装-open-falcon - 图1

MySQL

这个容器内的 数据在里面,

  1. # 进入容器
  2. docker exec -it open-falcon-plus-docker-yun /bin/bash
# 直接mysql 就进入了(没密码)
  1. [root@a406e91c0624 /]# mysql
  2. Welcome to the MySQL monitor. Commands end with ; or \g.
  3. Your MySQL connection id is 16
  4. Server version: 5.1.73 Source distribution
  5. Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
  6. Oracle is a registered trademark of Oracle Corporation and/or its
  7. affiliates. Other names may be trademarks of their respective
  8. owners.
  9. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  10. mysql> show databases;
  11. +--------------------+
  12. | Database |
  13. +--------------------+
  14. | information_schema |
  15. | alarms |
  16. | dashboard |
  17. | falcon_portal |
  18. | graph |
  19. | mysql |
  20. | test |
  21. | uic |
  22. +--------------------+
  23. 8 rows in set (0.00 sec)
  24. mysql>