Docker Yearning + Inception SQL audit platform to build

[A] mounting
[1.1 System Environment
System Environment: CentOS Linux release 7.6.1708 (Core)
System Memory: 4G
kernel:. 1
the Python: 3.6.4
Close iptables and selinux
this installation uses an external MySQL 5.7

[1.2] Close iptables
[root @ localhost ~] # systemctl STOP firewalld.service // close iptables
[root @ localhost ~] # systemctl // disable firewalld.service start Inhibit start iptables

【1.3】禁用 selinux 以及安装 Python
[root@localhost ~]# vim /etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled // 改成 disabled
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted


[1.3.1] Python mounting
[the root @ localhost ~] # CD / the root / Software
[the root @ localhost Software] # yum the install zlib- -Y *
[the root @ localhost Software] # wget https://www.python.org /ftp/python/3.6.4/Python-3.6.4.tgz
[the root @ localhost Software] # -zxvf the Python the tar-3.6.4.tgz
[the root @ localhost Software] # mkdir -p / usr / local / to python3
[ Software @ localhost the root] # the Python CD-3.6.4 /
[the root @ localhost the Python-3.6.4] # ./configure --prefix = / usr / local / to python3
[the root @ localhost the Python-3.6.4] # the make
[ Python-3.6.4 @ localhost root] # the make install
[root @ localhost Python-3.6.4] # mv / usr / bin / Python / usr / bin / python_bak // modify the old version
[root @ localhost Python-3.6.4 ] # ln -s / usr / local / python3 / bin / python3 / usr / bin / python // create a new soft link  
[root @ localhost Python-3.6.4] # python -V // check python version of
Python 3.6.4
after [root @ localhost Python-3.6.4] # vim ~ / .bash_profile // configuration is successful, pip3 impossible, further configuration is necessary to / usr / local / python3 / bin join the PATH
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/usr/local/python3/bin

export PATH

[Root @ localhost Python-3.6.4] # source ~ / .bash_profile // make the environment variables to take effect

[1.3.2] Configuration yum yum source otherwise unavailable
[root @ localhost Python-3.6.4] # yum -y update // apparently above except that python2 wording, of course, can not be performed using the default Python3. ! So the first line of this file 1 # / usr / bin / python replaced # / usr / bin / python2.7!
File "/ usr / bin / yum", Line 30
the except the KeyboardInterrupt, E: ^
SyntaxError: invalid syntax

[root @ localhost Python-3.6.4] # vim / usr / bin / yum
so the first row of this file 1 #! / usr / bin / python replaced #! / usr / bin / python2.7

【1.4】安装 MySQL
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# vim mysql.repos
[mysql5.7-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/
enabled=1
gpgcheck=0

[Root @ localhost yum.repos.d] # yum -y install mysql- * // Wait for the installation to complete execution

[1.5] to start the service and set the startup MySQL
[root @ localhost yum.repos.d] # systemctl Start mysqld
[root @ localhost yum.repos.d] # systemctl enable mysqld
[root @ localhost yum.repos.d] # systemctl daemon-reload

[1.6] See the initial password mysql
[yum.repos.d the root @ localhost] # grep 'Temporary password' /var/log/mysqld.log
2019-06-25T03: 27: 20.334210Z. 1 [Note] A Temporary password IS generated for root @ localhost: GIutnKkR% 7fe

【1.7】登录 mysql 环境做配置以及修改参数
[root@localhost yum.repos.d]# mysql -uroot -pGIutnKkR%7fe //回车进入数据库
mysql> set global validate_password_policy=0;
mysql> set global validate_password_length=1;
mysql> set global validate_password_mixed_case_count=2;
mysql> show variables like 'validate_password%';
+--------------------------------------+-------+
| Variable_name | Value |
+--------------------------------------+-------+
| validate_password_check_user_name | OFF |
| validate_password_dictionary_file | |
| validate_password_length | 6 |
| validate_password_mixed_case_count | 2 |
| validate_password_number_count | 1 |
| validate_password_policy | LOW |
| validate_password_special_char_count | 1 |
+--------------------------------------+-------+
7 rows in set (0.02 sec)

mysql> alter user 'root'@'localhost' identified by '123456';
mysql> flush privileges;
mysql> quit;

[1.8] Yearning to create a database with the user and password and authorization
[root @ localhost yum.repos.d] # MySQL-uroot--p123456
MySQL> the Create Database Yearning charset utf8; // create Yearning library
mysql> create user 'Yearning' @ ' % 'identified by' Yearning '; // create Yearning user
mysql> grant all on * * to .' Yearning '@'% 'identified by' Yearning '; // Yearning authorized user privileges
MySQL> flush privileges;
MySQL> quit;

[1.9] mounted docker
[the root @ localhost ~] # yum the install yum-utils -Y-persistent-Device-Mapper Data // LVM2 installation dependencies docker

[1.9.1] source disposed yum
[root @ localhost ~] # yum -config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

[1.9.2] can view all versions of all warehouse docker, and select a specific version is installed
[root @ localhost ~] # yum list docker-ce --showduplicates | sort -r
Loaded plugins: fastestmirror, langpacks
installed packages
installable packages
* Updates: ap.stykers.moe
Loading Mirror SPEEDS cached from the hostfile
* Extras: ftp.sjtu.edu.cn
Docker-ce.x86_64. 3: Docker-CE-18.09.6-3.el7 the stable
docker- 3 ce.x86_64: 18.09.6-3.el7 @-ce-stable Docker
Docker-ce.x86_64 3: 18.09.5-3.el7-ce-stable Docker
Docker-ce.x86_64 3: 18.09.4-3. the stable Docker-CE-EL7
Docker-ce.x86_64. 3: 18.09.3-3.el7 the stable-CE-Docker
Docker-ce.x86_64. 3: 18.09.2-3.el7 the stable-CE-Docker
Docker. 3-ce.x86_64 : 18.09.1-3.el7 the stable-CE-Docker
Docker-ce.x86_64. 3: 18.09.0-3.el7 the stable-CE-Docker
docker-ce.x86_64 18.06.3.ce-3.el7 docker this steady-
docker-ce.x86_64 18.06.2.ce-3.el7 docker this steady-
docker-ce.x86_64 18.06.1.ce-3 .el7 docker this steady-
docker-ce.x86_64 18.06.0.ce-3.el7 docker this steady-
docker-ce.x86_64 18.03.1.ce-1.el7.centos docker this steady-
docker this .x86_64 18.03.0.ce-1.el7.centos docker this steady-
docker-ce.x86_64 17.12.1.ce-1.el7.centos docker this steady-
docker-ce.x86_64 17.12.0.ce- 1.el7.centos docker this steady-
docker-ce.x86_64 17.09.1.ce-1.el7.centos docker this steady-
docker-ce.x86_64 17.09.0.ce-1.el7.centos docker this -stable
docker-ce.x86_64 17.06.2.ce-1.el7.centos docker this steady-
docker-ce.x86_64 17.06.1.ce-1.el7.centos docker this steady-
docker-ce.x86_64 17.06.0.ce-1.el7.centos docker this steady-
docker-ce.x86_64 17.03.3.ce-1.el7 docker this steady-
docker-ce.x86_64 17.03.2.ce -1.el7.centos docker this steady-
docker-ce.x86_64 17.03.1.ce-1.el7.centos docker this steady-
docker-ce.x86_64 17.03.0.ce-1.el7.centos docker- this steady-
* base: ap.stykers.moe

[1.9.3] installation docker select the corresponding version
[root @ localhost ~] # yum install docker-ce # default because the repo open only stable warehouse, so here to install the latest stable version 18.03.1.ce
[root @ localhost ~] # yum install <FQPN> # example: the install yum Docker-CE-18.03.1.ce
[the root @ localhost ~] # yum the install Docker -Y-CE-18.03.1.ce // wait for installation

[1.9.4] and start adding the boot
[root @ localhost ~] # systemctl Start Docker
[root @ localhost ~] # systemctl enable Docker

[1.9.5] verify that the installation was successful (there are two parts, client service and installation start indicate docker are successful)
[root @ localhost ~] # docker Version
Client:
Version: 18.09.6
API Version: 1.39
Go Version: go1.10.8
the commit git: 481bc77156
Built: Sat On May 2019 02:34:58. 4
the OS / Arch: Linux / AMD64
Experimental: to false

Server: Docker Engine - Community
Engine:
Version: 18.09.6
API version: 1.39 (minimum version 1.12)
Go version: go1.10.8
Git commit: 481bc77
Built: Sat May 4 02:02:43 2019
OS/Arch: linux/amd64
Experimental: false

[Two] Inception installation and Yearning
[2.1] Download Yearning source
[the root @ localhost ~] # mkdir -p / the root / Software
[the root @ localhost ~] # CD / the root / Software
[the root @ localhost Software] Git clone # HTTPS: //github.com/cookieY/Yearning.git // get git Yearning source
[root @ localhost software] # cd Yearning / install / yearning-docker-compose / init-sql // below to enter the environment variables
[root @ localhost init -sql] # mysql -uYearning -pYearning Yearning < install.sql // introduced inside the environment variable to the database

[root @ localhost ~] # cd / root / software / Yearning / install / // cd package to ambient unzipped inception.tar
[the install the root @ localhost] # the tar -xvf inception.tar
[the install the root @ localhost] # CD Inception / bin /
[root @ localhost bin] # mkdir -p / var / log / inception / inception // create a log directory
[root @ localhost bin] # mkdir -p / var / run / inception / // create a directory inception.socket
[root @ localhost bin] # vim inc.cnf // modify inception profile
[inception]
general_log. 1 =
general_log_file = / var / log / inception / inception inception.log // log directory
port = 6669

socket=/var/run/inception/inc.socket // inception.socket 存储目录
character-set-client-handshake=0
character-set-server=utf8
inception_support_charset=utf8mb4
inception_enable_nullable=0
inception_check_primary_key=1
inception_check_column_comment=1
inception_check_table_comment=1
inception_enable_blob_type=1
inception_check_column_default_value=1
inception_support_charset=utf8
inception_osc_on=OFF
inception_check_column_default_value=OFF
inception_check_column_comment=OFF
inception_check_table_comment=OFF
inception_enable_identifer_keyword=ON
inception_remote_backup_host = 192.168.1.150 // 备份数据库的 IP
inception_remote_backup_port = 3306 // database default port
inception_remote_system_user = privileged user root // database _ according to their own definition of
inception_remote_system_password = 123456 // database user password

【2.2】启动 inception 服务
[root@localhost bin]# pwd
/root/software/Yearning/install/inception/bin

[Root @ localhost bin] # nohup bin / Inception --defaults-file = inc.cnf & // Background Scheduler enabled

[2.3] [Note run Yearning: HOST = IP of the machine according to the present MYSQL_ADDR = IP parameters just behind the machine can not operate as described herein is selected. According to my default on the line]
[root @ localhost bin] # docker run -d -e HOST = 192.168.1.150 -e MYSQL_ADDR = 192.168.1.150 -e MYSQL_USER = Yearning -e MYSQL_PASSWORD = Yearning -p8080: 80 -p8000: 8000 registry.cn-hangzhou.aliyuncs.com/cookie/yearning:v1.3.0


[Three] configuration
[3.1] access Yearning
access Yearning (access address for you to start the IP address of the docker)
login administrator Default value: admin / Yearning_admin

Guess you like

Origin www.cnblogs.com/hankyoon/p/11138706.html