久久精品人人爽,华人av在线,亚洲性视频网站,欧美专区一二三

怎么實現docker Yearning+Inception SQL審核平臺

136次閱讀
沒有評論

共計 9020 個字符,預計需要花費 23 分鐘才能閱讀完成。

本篇內容介紹了“怎么實現 docker Yearning+Inception SQL 審核平臺”的有關知識,在實際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓丸趣 TV 小編帶領大家學習一下如何處理這些情況吧!希望大家仔細閱讀,能夠學有所成!

【一】安裝

【1.1】系統環境

系統環境:CentOS Linux release 7.6.1708 (Core)

系統內存:4G

系統內核:1

Python:3.6.4

關閉 iptables and selinux

本次安裝采用的是外部 MySQL 5.7

【1.2】關閉 iptables

[root@localhost ~]# systemctl stop firewalld.service// 關閉 iptables

[root@localhost ~]# systemctl disable firewalld.service// 開機   禁止啟動 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 安裝

[root@localhost ~]# cd /root/software

[root@localhost software]# yum -y install zlib-*

[root@localhost software]# wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz

[root@localhost software]# tar -zxvf Python-3.6.4.tgz

[root@localhost software]# mkdir -p /usr/local/python3

[root@localhost software]# cd Python-3.6.4/

[root@localhost Python-3.6.4]# ./configure –prefix=/usr/local/python3

[root@localhost Python-3.6.4]# make

[root@localhost Python-3.6.4]# make install

[root@localhost Python-3.6.4]# mv /usr/bin/python /usr/bin/python_bak// 修改舊版本

[root@localhost Python-3.6.4]# ln -s /usr/local/python3/bin/python3 /usr/bin/python// 創建新的軟連接

[root@localhost Python-3.6.4]# python -V// 檢查 python 的版本

Python 3.6.4

[root@localhost Python-3.6.4]# vim ~/.bash_profile// 配置成功后,pip3 用不了,需要進一步配置將 /usr/local/python3/bin 加入 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// 讓環境變量生效

【1.3.2】配置 yum 源     否則  yum 不可用

[root@localhost Python-3.6.4]# yum -y update// 顯然上面的 except 是 python2 的寫法,當然不能使用默認的 Python3 來執行了。于是把這個文件第 1 行的 #!/usr/bin/python 替換成 #!/usr/bin/python2.7

File /usr/bin/yum , line 30

 except KeyboardInterrupt, e:       ^

SyntaxError: invalid syntax

[root@localhost Python-3.6.4]# vim /usr/bin/yum

于是把這個文件第 1 行的 #!/usr/bin/python 替換成 #!/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-*// 等待 安裝   執行完成

【1.5】啟動 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】查看 mysql 的初始密碼

[root@localhost yum.repos.d]# 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 數據庫 與 用戶 和 密碼 并且授權

[root@localhost yum.repos.d]# mysql -uroot -p123456

mysql create database Yearning charset utf8;// 創建 Yearning 庫

mysql create user Yearning @ % identified by Yearning // 創建 Yearning 用戶

mysql grant all on *.* to Yearning @ % identified by Yearning // 授權 Yearning 用戶權限

mysql flush privileges;

mysql quit;

【1.9】安裝 docker

[root@localhost ~]# yum install -y yum-utils device-mapper-persistent-data lvm2// 安裝 docker 的依賴包

【1.9.1】設置 yum 源

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

【1.9.2】可以查看所有倉庫中所有 docker 版本,并選擇特定版本安裝

[root@localhost ~]# yum list docker-ce –showduplicates | sort -r

已加載插件:fastestmirror, langpacks

已安裝的軟件包

可安裝的軟件包

 * updates: ap.stykers.moe

Loading mirror speeds from cached hostfile

 * extras: ftp.sjtu.edu.cn

docker-ce.x86_64            3:18.09.6-3.el7                    docker-ce-stable 

docker-ce.x86_64            3:18.09.6-3.el7                    @docker-ce-stable

docker-ce.x86_64            3:18.09.5-3.el7                    docker-ce-stable 

docker-ce.x86_64            3:18.09.4-3.el7                    docker-ce-stable 

docker-ce.x86_64            3:18.09.3-3.el7                    docker-ce-stable 

docker-ce.x86_64            3:18.09.2-3.el7                    docker-ce-stable 

docker-ce.x86_64            3:18.09.1-3.el7                    docker-ce-stable 

docker-ce.x86_64            3:18.09.0-3.el7                    docker-ce-stable 

docker-ce.x86_64            18.06.3.ce-3.el7                   docker-ce-stable 

docker-ce.x86_64            18.06.2.ce-3.el7                   docker-ce-stable 

docker-ce.x86_64            18.06.1.ce-3.el7                   docker-ce-stable 

docker-ce.x86_64            18.06.0.ce-3.el7                   docker-ce-stable 

docker-ce.x86_64            18.03.1.ce-1.el7.centos            docker-ce-stable 

docker-ce.x86_64            18.03.0.ce-1.el7.centos            docker-ce-stable 

docker-ce.x86_64            17.12.1.ce-1.el7.centos            docker-ce-stable 

docker-ce.x86_64            17.12.0.ce-1.el7.centos            docker-ce-stable 

docker-ce.x86_64            17.09.1.ce-1.el7.centos            docker-ce-stable 

docker-ce.x86_64            17.09.0.ce-1.el7.centos            docker-ce-stable 

docker-ce.x86_64            17.06.2.ce-1.el7.centos            docker-ce-stable 

docker-ce.x86_64            17.06.1.ce-1.el7.centos            docker-ce-stable 

docker-ce.x86_64            17.06.0.ce-1.el7.centos            docker-ce-stable 

docker-ce.x86_64            17.03.3.ce-1.el7                   docker-ce-stable 

docker-ce.x86_64            17.03.2.ce-1.el7.centos            docker-ce-stable 

docker-ce.x86_64            17.03.1.ce-1.el7.centos            docker-ce-stable 

docker-ce.x86_64            17.03.0.ce-1.el7.centos            docker-ce-stable 

 * base: ap.stykers.moe

【1.9.3】安裝 docker 選擇對應的版本

[root@localhost ~]# yum install docker-ce  # 由于 repo 中默認只開啟 stable 倉庫,故這里安裝的是最新穩定版 18.03.1.ce

[root@localhost ~]# yum install FQPN  # 例如:yum install docker-ce-18.03.1.ce

[root@localhost ~]# yum install -y docker-ce-18.03.1.ce// 等待安裝完成

【1.9.4】啟動并加入開機啟動

[root@localhost ~]# systemctl start docker

[root@localhost ~]# systemctl enable docker

【1.9.5】驗證安裝是否成功 (有 client 和 service 兩部分表示 docker 安裝啟動都成功了)

[root@localhost ~]# docker version

Client:

 Version:           18.09.6

 API version:       1.39

 Go version:        go1.10.8

 Git commit:        481bc77156

 Built:             Sat May  4 02:34:58 2019

 OS/Arch:           linux/amd64

 Experimental:      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

【二】Inception 及 Yearning 安裝

【2.1】下載 Yearning 源碼

[root@localhost ~]# mkdir -p /root/software

[root@localhost ~]# cd /root/software

[root@localhost software]# git clone https://github.com/cookieY/Yearning.git// 獲取 git Yearning 源碼

[root@localhost software]# cd Yearning/install/yearning-docker-compose/init-sql// 進入 環境 變量下邊去

[root@localhost init-sql]# mysql -uYearning -pYearning Yearning install.sql// 導入 環境變量到數據庫里面去

[root@localhost ~]# cd /root/software/Yearning/install/// cd 到環境目錄 解壓 inception.tar 包

[root@localhost install]# tar -xvf inception.tar

[root@localhost install]# cd inception/bin/

[root@localhost bin]# mkdir -p /var/log/inception/// 創建 inception 日志目錄

[root@localhost bin]# mkdir -p /var/run/inception/// 創建 inception.socket 目錄

[root@localhost bin]# vim inc.cnf// 修改 inception 配置文件

[inception]

general_log=1

general_log_file=/var/log/inception/inception.log// inception 日志目錄

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// 數據庫默認端口

inception_remote_system_user = root// 數據庫的權限用戶_可根據自己定義

inception_remote_system_password = 123456// 數據庫的用戶密碼

【2.2】啟動 inception 服務

[root@localhost bin]# pwd

/root/software/Yearning/install/inception/bin

[root@localhost bin]# nohup bin/Inception –defaults-file=inc.cnf // 后臺調度啟用

【2.3】運行 Yearning  【備注:HOST= 本機 IP 與 MYSQL_ADDR= 本機 IP 后面的參數只要是按照本文操作可以不用選擇。默認按照我的就行了】

[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

【三】相關配置

【3.1】訪問 Yearning

訪問 Yearning(訪問地址為你啟動 docker 的 IP 地址)

登錄管理員缺省值:admin  /  Yearning_admin

“怎么實現 docker Yearning+Inception SQL 審核平臺”的內容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業相關的知識可以關注丸趣 TV 網站,丸趣 TV 小編將為大家輸出更多高質量的實用文章!

正文完
 
丸趣
版權聲明:本站原創文章,由 丸趣 2023-07-26發表,共計9020字。
轉載說明:除特殊說明外本站除技術相關以外文章皆由網絡搜集發布,轉載請注明出處。
評論(沒有評論)
主站蜘蛛池模板: 枝江市| 象山县| 利津县| 正镶白旗| 古丈县| 瑞安市| 右玉县| 交口县| 阳城县| 盐边县| 息烽县| 池州市| 涿州市| 越西县| 方城县| 邢台市| 丁青县| 东丰县| 灵武市| 松滋市| 邯郸县| 龙南县| 简阳市| 汉阴县| 西乌珠穆沁旗| 洛川县| 塔城市| 法库县| 舒兰市| 铜山县| 乌兰浩特市| 新宁县| 城口县| 乃东县| 沂源县| 乌兰察布市| 神农架林区| 旌德县| 陕西省| 齐河县| 安平县|