Inception的可視化--Yearning 1.X

一、前言

Yearning是Inception的web端實現。其他類型工具包括archer等。

 

二、docker安裝(安裝yearning1.3以上版本需要)

新版本docker僅支持CentOS7系統,以下分別記錄新老版本docker安裝方法。

1、對於CentOS 6,安裝docker-io(Docker Engine of version up to 1.7.1)

# 安裝EPEL源
[root@237_30 ~]# yum -y install http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

# 安裝docker-io
[root@237_30 ~]# yum -y install docker-io

Dependencies Resolved
====================================================================================
 Package            Arch       Version                               Repository
                                                                               Size
====================================================================================
Installing:
 docker-io          x86_64     1.7.1-2.el6                           epel     4.6 M
Installing for dependencies:
 libcgroup          x86_64     0.40.rc1-26.el6                       base     131 k
 lua-alt-getopt     noarch     0.7.0-1.el6                           epel     6.9 k
 lua-filesystem     x86_64     1.4.2-1.el6                           epel      24 k
 lua-lxc            x86_64     1.0.11-1.el6                          epel      16 k
 lxc                x86_64     1.0.11-1.el6                          epel     124 k
 lxc-libs           x86_64     1.0.11-1.el6                          epel     257 k
 xz                 x86_64     4.999.9-0.5.beta.20091007git.el6      base     137 k

Transaction Summary
====================================================================================
Install       8 Package(s)

# 啓動Docker
[root@237_30 ~]# service docker start
Starting cgconfig service:                                 [  OK  ]
Starting docker:	                                   [  OK  ]

#查看Docker版本信息
[root@237_30 ~]# docker version
Client version: 1.7.1
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 786b29d/1.7.1
OS/Arch (client): linux/amd64
Server version: 1.7.1
Server API version: 1.19
Go version (server): go1.4.2
Git commit (server): 786b29d/1.7.1
OS/Arch (server): linux/amd64

 

2、對於CentOS 7,可以安裝docker-ce

# 卸載舊版本Docker(如果有的話)
[root@237_37 tmp]# yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine
Loaded plugins: fastestmirror
No Match for argument: docker
No Match for argument: docker-client
No Match for argument: docker-client-latest
No Match for argument: docker-common
No Match for argument: docker-latest
No Match for argument: docker-latest-logrotate
No Match for argument: docker-logrotate
No Match for argument: docker-selinux
No Match for argument: docker-engine-selinux
No Match for argument: docker-engine
No Packages marked for removal

# 配置yum源
[root@237_37 tmp]# yum -y install yum-utils device-mapper-persistent-data lvm2
Dependencies Resolved
====================================================================================
 Package               Arch          Version                   Repository      Size
====================================================================================
Installing:
 yum-utils             noarch        1.1.31-46.el7_5           updates        120 k
Installing for dependencies:
 libxml2-python        x86_64        2.9.1-6.el7_2.3           base           247 k
 python-chardet        noarch        2.2.1-1.el7_1             base           227 k
 python-kitchen        noarch        1.1.1-5.el7               base           267 k

Transaction Summary
====================================================================================
Install  1 Package (+3 Dependent packages)

[root@237_37 tmp]# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Loaded plugins: fastestmirror
adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo

# 安裝Docker CE
[root@237_37 tmp]# yum -y install docker-ce
Dependencies Resolved
====================================================================================
 Package                   Arch      Version              Repository           Size
====================================================================================
Installing:
 docker-ce                 x86_64    18.06.1.ce-3.el7     docker-ce-stable     41 M
Installing for dependencies:
 audit-libs-python         x86_64    2.8.1-3.el7_5.1      updates              75 k
 checkpolicy               x86_64    2.5-6.el7            base                294 k
 container-selinux         noarch    2:2.68-1.el7         extras               36 k
 libcgroup                 x86_64    0.41-15.el7          base                 65 k
 libseccomp                x86_64    2.3.1-3.el7          base                 56 k
 libsemanage-python        x86_64    2.5-11.el7           base                112 k
 libtool-ltdl              x86_64    2.4.2-22.el7_3       base                 49 k
 policycoreutils-python    x86_64    2.5-22.el7           base                454 k
 python-IPy                noarch    0.75-6.el7           base                 32 k
 setools-libs              x86_64    3.3.8-2.el7          base                619 k
Updating for dependencies:
 audit                     x86_64    2.8.1-3.el7_5.1      updates             247 k
 audit-libs                x86_64    2.8.1-3.el7_5.1      updates              99 k

Transaction Summary
====================================================================================
Install  1 Package  (+10 Dependent packages)
Upgrade             (  2 Dependent packages)

注:
1、指紋信息爲:060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35
2、該步驟將直接安裝最新版本Docker,如需安裝特定版本,可以如下操作:
[root@237_37 ~]# yum list docker-ce --showduplicates | sort -r
docker-ce.x86_64            18.06.1.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 
......
......
yum install docker-ce-<VERSION STRING>:<VERSION STRING>爲“-”之前的版本信息
例如:yum install docker-ce-17.12.1.ce


# 啓動Docker
[root@237_37 tmp]# systemctl start docker
[root@237_37 tmp]# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
d1725b59e92d: Pull complete 
Digest: sha256:0add3ace90ecb4adbf7777e9aacf18357296e799f81cabc9fde470971e499788
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.
......
......

 

3、安裝docker-compose

# 安裝docker-compose
[root@237_30 tmp]# curl -L "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 11.2M  100 11.2M    0     0   725k      0  0:00:15  0:00:15 --:--:-- 1844k

[root@237_30 tmp]# chmod +x /usr/local/bin/docker-compose

# CentOS6一般會如下報錯
[root@237_30 tmp]# docker-compose --version
[785] Error loading Python lib '/tmp/_MEIeCge8u/libpython3.6m.so.1.0': dlopen: /lib64/libc.so.6: version `GLIBC_2.17' not found (required by /tmp/_MEIeCge8u/libpython3.6m.so.1.0)

# 升級glibc
[root@237_30 tmp]# wget http://ftp.gnu.org/gnu/glibc/glibc-2.17.tar.gz
[root@237_30 tmp]# tar zxvf glibc-2.17.tar.gz
[root@237_30 tmp]# cd glibc-2.17
[root@237_30 glibc-2.17]# mkdir build
[root@237_30 glibc-2.17]# cd build
[root@237_30 build]# ../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
[root@237_30 build]# make && make install
......
......
Your new glibc installation seems to be ok.
make[1]: Leaving directory `/tmp/glibc-2.17'

[root@237_30 build]# strings /lib64/libc.so.6 | grep GLIBC
GLIBC_2.2.5
GLIBC_2.2.6
GLIBC_2.3
GLIBC_2.3.2
GLIBC_2.3.3
GLIBC_2.3.4
GLIBC_2.4
GLIBC_2.5
GLIBC_2.6
GLIBC_2.7
GLIBC_2.8
GLIBC_2.9
GLIBC_2.10
GLIBC_2.11
GLIBC_2.12
GLIBC_2.13
GLIBC_2.14
GLIBC_2.15
GLIBC_2.16
GLIBC_2.17
GLIBC_PRIVATE

[root@237_30 build]# docker-compose version
docker-compose version 1.22.0, build f46880fe
docker-py version: 3.4.1
CPython version: 3.6.6
OpenSSL version: OpenSSL 1.1.0f  25 May 2017

 

注:雖然可以在CentOS6上安裝舊版本docker,但實際yearning需要1.10.0版本以上的docker engine。

[root@237_30 yearning-docker-compose]# docker-compose up -d
ERROR: The Docker Engine version is less than the minimum required by Compose. Your current project requires a Docker Engine of version 1.10.0 or greater.

所以,還是推薦在CentOS7上安裝docker和yearning1.3

 

三、yearning安裝

安裝步驟如下:

# 下載Yearning
[root@237_37 tmp]# git clone https://github.com/cookieY/Yearning.git
[root@237_37 tmp]# cd Yearning/install/yearning-docker-compose/
[root@237_37 yearning-docker-compose]# docker-compose up -d
Creating network "yearning-docker-compose_default" with the default driver
Pulling db (mysql:5.7)...
5.7: Pulling from library/mysql
802b00ed6f79: Pull complete
30f19a05b898: Pull complete
3e43303be5e9: Pull complete
94b281824ae2: Pull complete
51eb397095b1: Pull complete
54567da6fdf0: Pull complete
bc57ddb85cce: Pull complete
c7c0a9c25d8a: Pull complete
cce6c47ac3fc: Pull complete
499b9c7376c8: Pull complete
6c5e08e005ea: Pull complete
Digest: sha256:1d8f471c7e2929ee1e2bfbc1d16fc8afccd2e070afed24805487e726ce601a6d
Status: Downloaded newer image for mysql:5.7
Pulling yearning (registry.cn-hangzhou.aliyuncs.com/cookie/yearning:v1.3.1)...
v1.3.1: Pulling from cookie/yearning
8e3ba11ec2a2: Pull complete
a9c7c48bf841: Pull complete
38586f84d0ca: Pull complete
14bb62d2e2cc: Pull complete
Digest: sha256:2f02ad2b33e2c0e41f11ea868dd0b2248df314099f0ae10512f3fa687a4def53
Status: Downloaded newer image for registry.cn-hangzhou.aliyuncs.com/cookie/yearning:v1.3.1
Creating yearning-docker-compose_db_1 ... done
Creating yearning-docker-compose_yearning_1 ... done

打開8080端口

[root@237_37 yearning-docker-compose]# firewall-cmd --zone=public --add-port=8080/tcp --permanent
success
[root@237_37 yearning-docker-compose]# firewall-cmd --reload
success
[root@237_37 yearning-docker-compose]# firewall-cmd --zone=public --list-ports
8080/tcp

瀏覽器輸入:IP:8080 進入WEB頁面

默認用戶:admin,密碼:Yearning_admin

管理-設置-基礎設置裏面填寫Inception信息

同時,添加對象數據庫信息

並配置admin用戶的郵件推送信息

 

四、簡單體驗

1、用戶創建

(1)創建權限組

管理-權限組-添加權限組,按需配置

(2)創建用戶

 

2、SQL提交與審覈

填寫SQL並點擊檢測,檢測無誤後提交按鈕被點亮

提交後,將會轉交審覈人審覈

 

 

參考文檔

docker docs:Get Docker CE for CentOS

docker docs:Install Docker Compose

Docker 中文指南

Stack Overflow:What is docker.io in relation to docker-ce and docker-ee?

Yearning使用手冊

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章