Inception的可视化--Yearning(更新中)

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/leonpenn/article/details/82991806

一、前言

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使用手册

展开阅读全文

没有更多推荐了,返回首页