• 日志分析 第七章 安装grafana


    grafana依赖mysql存储数据,首先需要安装mysql

    安装mysql

    解压

    # groupadd mysql
    # useradd -s /sbin/nologin -g mysql mysql
    # tar xf mysql-5.6.14.tar.gz -C /usr/local/src/

    编译参数

    # cmake 
    -DCMAKE_INSTALL_PREFIX=/usr/local/app/mysql-5.6.14 
    -DMYSQL_DATADIR=/data/mysql 
    -DMYSQL_UNIX_ADDR=/tmp/mysql.sock 
    -DENABLED_LOCAL_INFILE=1 
    -DWITH_INNOBASE_STORAGE_ENGINE=1 
    -DWITH_ARCHIVE_STORAGE_ENGINE=1 
    -DWITH_BLACKHOLE_STORAGE_ENGINE=1 
    -DWITH_FEDERATED_STORAGE_ENGINE=1 
    -DWITH_EXAMPLE_STORAGE_ENGINE=1 
    -DWITH_PARTITION_STORAGE_ENGINE=1 
    -DWITH_MYISAM_STORAGE_ENGINE=1 
    -DWITH_PERFSCHEMA_STORAGE_ENGINE=1 
    -DMYSQL_TCP_PORT=3306 
    -DEXTRA_CHARSETS=all 
    -DDEFAULT_CHARSET=utf8 
    -DDEFAULT_COLLATION=utf8_general_ci 
    -DMYSQL_USER=mysql -DWITH_DEBUG=0 
    编译参数

    编译

    # make –j 8
    # make install
    # mkdir /data/mysql

    初始化

    # cp support-files/mysql.server /etc/init.d/mysqld
    # chmod +x /etc/init.d/mysqld
    # chkconfig --add mysqld

    启动脚本

    # chown -R root.mysql /usr/local/mysql
    # chown -R mysql.mysql /data/mysql
    # yum install wget ncurses-devel
    #./scripts/mysql_install_db --user=mysql  --basedir=/usr/local/app/mysql-5.6.14 --datadir=/data/mysql

    PATH、头文件、库文件及man帮助文档配置

    # echo "export PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile
    # echo "/usr/local/mysql/lib/" >> /etc/ld.so.conf
    # ln -sv /usr/local/mysql/include/ /usr/include/mysql
    # echo "MANPATH /usr/local/mysql/man" >> /etc/man.config

    设置密码

    # mysqladmin -uroot password '81-ES-BJVM'

    安全设置

    mysql> drop database test;
    mysql> drop user ''@'BJVM-ES-81';
    mysql> drop user ''@'localhost';
    mysql> drop user 'root'@'::1';
    mysql> drop user ''@'BJVM-ES-81';

    安装grafana

    [root@elk ~]# tar xf grafana-3.1.1-1470047149.linux-x64.tar.gz 
    [root@elk ~]# tar xf grafana-3.1.1-1470047149.linux-x64.tar.gz -C /usr/local/app/
    [root@elk ~]# ln -sv /usr/local/app/grafana-3.1.1-1470047149 /usr/local/grafana
    [root@elk ~]# cd /usr/local/grafana

     修改配置文件custom.ini

    # cp conf/defaults.ini conf/custom.ini

    data = /data/grafana/data
    logs =/data/grafana/log
    plugins = /data/grafana/plugins
    http_addr = 10.80.2.156
    type = mysql
    host = 10.80.2.81:3306
    name = grafana
    user = grafana
    password =

    授权

    # mkdir –pv /data/grafana/{data,log,plugins}

    # mysql> create database grafana;

    # mysql> grant all privileges on grafana.* to grafana@’10.80.2.81’ identified by “”;

  • 相关阅读:
    基于html2canvas实现网页保存为图片及图片清晰度优化
    玩转 React(四)- 创造一个新的 HTML 标签
    浅谈前后端分离与实践(一)
    javascript新手实例1-DOM基本操作
    一个看一次就永远不会忘的windows环境开发小技巧
    细说Web API中的Blob
    所见即所得,实现一个有趣的动画效果
    带你玩转prefetch, preload, dns-prefetch,defer和async
    Hologres+Flink流批一体首次落地4982亿背后的营销分析大屏
    浏览器报错:ERR_PROXY_CONNECTION_FAILED的解决方法
  • 原文地址:https://www.cnblogs.com/xiaoming279/p/6113020.html
Copyright © 2020-2023  润新知