zoukankan      html  css  js  c++  java
  • sql审核工具调研安装-sqlAdvisor和soar

    sql审核工具调研

     基于soar的sql审核查询平台:
    https://github.com/beiketianzhuang/data-platform-soar
    

      

    1.美团工具sqlAdvisor工具

    采用docker去跑centos镜像

     

    1.获取centos镜像

     
    1. docker pull centos
     

    2.运行docker镜像

     
    1. docker run <IMAGE ID >
     

    3.进入docker容器

     
    1. docker attach <容器id>

    进入容器后就可以通过官方提供的安装方法安装了(因为直接通过官方的安装出错了,所以后面安装时自己做了一些调整)

     

    4.克隆代码

     
    1. cd /usr/local/src/
    2. git clone https://github.com/Meituan-Dianping/SQLAdvisor.git
     

    5.安装依赖包

     
    1. yum install -y make cmake libaio-devel libffi-devel glib2
    2. glib2-devel bison gcc gcc-c++
     

    6.编译sqladvisor时依赖perconaserverclient_r

     
    1. cd /usr/lib64/
    2. ln -s libperconaserverclient_r.so.18 libperconaserverclient_r.so
     

    7.安装percona56 yum源及安装:

     
    1. #注意:若不带wget,请先安装
    2. wget http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm
    3. yum install percona-release-0.1-3.noarch.rpm -y
    4. yum install Percona-Server-shared-56 -y
     

    8.编译sqladvisor的依赖项sqlparser

     
    1. cd /usr/local/src/SQLAdvisor/
    2. cmake -DBUILD_CONFIG=mysql_release -DCMAKE_BUILD_TYPE=debug -DCMAKE_INSTALL_PREFIX=/usr/local/sqlparser -DIGNORE_AIO_CHECK=/usr/share/doc/libaio-0.3.109 ./
    3. make && make install
     

    9.编译sqladvisor

     
    1. cd ./sqladvisor/
    2. cmake -DCMAKE_BUILD_TYPE=debug ./
    3. make
     

    10.测试

     
    1. cp /usr/local/src/SQLAdvisor/sqladvisor/sqladvisor /usr/bin/sqladvisor
    2. sqladvisor -h 127.0.0.1 -P 3306 -u root -p '123456' -d test -q "sql语句" -v 1
     

    2.小米工具soar

     
    1. 小米的soar安装简单方便,唯一注意的地方是:当时我安装的go的版本是1.9,导致编译的时候报错,后来改为了1.10的版本
    2. 具体请参考:https://github.com/XiaoMi/soar/blob/master/doc/install.md
     

  • 相关阅读:
    zoj1589Professor John
    zoj1082Stockbroker Grapevine
    zoj1311Network
    zoj1060Sorting It All Out
    zoj1119SPF
    zju1085Alien Security
    zoj 2474Benny's Compiler
    zoj1068P,MTHBGWB
    what's next?
    ski for the first time~
  • 原文地址:https://www.cnblogs.com/clovejava/p/9899224.html
Copyright © 2011-2022 走看看