美文网首页
collectd+influxdb+grafana组建监控系统

collectd+influxdb+grafana组建监控系统

作者: puroc | 来源:发表于2016-12-21 11:47 被阅读0次

    collectd

    安装

    yum -y install epel-release
    yum -y install collectd
    

    配置

    vi /etc/collectd.conf

    Hostname    "docker-1"
    FQDNLookup   true
    Interval     10
    Timeout         4
    LoadPlugin network
    <Plugin network>
        Server "172.16.114.201" "25826"
    </Plugin>
    

    启动

    systemctl start collectd.service
    systemctl enable collectd.service
    

    influxdb

    配置yum

    cat <<EOF | sudo tee /etc/yum.repos.d/influxdb.repo

    [influxdb]
    name = InfluxDB Repository - RHEL \$releasever
    baseurl = https://repos.influxdata.com/rhel/\$releasever/\$basearch/stable
    enabled = 1
    gpgcheck = 1
    gpgkey = https://repos.influxdata.com/influxdb.key
    EOF
    

    安装

    yum install influxdb
    

    启动

    systemctl start influxdb
    systemctl enable influxdb
    

    创建库

    influx
    CREATE DATABASE collectd
    use collectd
    CREATE USER "root" WITH PASSWORD 'root' WITH ALL PRIVILEGES
    

    配置

    vi /etc/influxdb/influxdb.conf

    hostname = "172.16.114.201"
     [[collectd]]
        enabled = true
        bind-address = "172.16.114.201:25826"
        database = "collectd"
        #retention-policy = ""
        #/usr/share/collectd/types.db这个文件,安装collectd之后才会有,没有这个文件时,打开了这个配置,influx是启动不了的
        typesdb = "/usr/share/collectd/types.db"
    

    重启

    systemctl restart influxdb
    

    查看25826这个端口是否已经监听,如果有,则代表启动正常

    [root@localhost influxdb]# netstat -anp| grep 25826
    udp        0      0 172.16.114.201:25826    0.0.0.0:*   125967/influxd
    

    Grafana

    下载

    需要FQ,地址为https://grafanarel.s3.amazonaws.com/builds/grafana-2.6.0-1.x86_64.rpm

    安装

    rpm -ivh grafana-2.6.0-1.x86_64.rpm
    

    启动

    systemctl enable grafana-server
    systemctl start grafana-server
    

    访问

    http://172.16.114.201:3000/
    用户名:root
    密码:root
    

    配置数据源

    3CC39BC7-661D-4EE3-B719-7BEEE0A130BA.png

    相关文章

      网友评论

          本文标题:collectd+influxdb+grafana组建监控系统

          本文链接:https://www.haomeiwen.com/subject/kgvtvttx.html