前一篇博文中主要说了下,lxc容器在Linux上的简单管理,回顾请参考https://www.cnblogs.com/qiuhom-1874/p/12901493.html;今天我们来介绍下lxc的图像管理工具LXC WEB Panel;

  项目下载地址:https://github.com/lxc-webpanel/LXC-Web-Panel.git

  1、安装python-flask

[root@lxc ~]# yum install python-flask
Loaded plugins: fastestmirror
base | 3.6 kB 00:00:00
epel | 4.7 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/2): epel/x86_64/updateinfo | 1.0 MB 00:00:00
(2/2): epel/x86_64/primary_db | 6.8 MB 00:00:01
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package python-flask.noarch 1:0.10.1-5.el7_7 will be installed
--> Processing Dependency: python-werkzeug for package: 1:python-flask-0.10.1-5.el7_7.noarch
--> Processing Dependency: python-jinja2 for package: 1:python-flask-0.10.1-5.el7_7.noarch
--> Processing Dependency: python-itsdangerous for package: 1:python-flask-0.10.1-5.el7_7.noarch
--> Running transaction check
---> Package python-itsdangerous.noarch 0:0.23-2.el7 will be installed
---> Package python-jinja2.noarch 0:2.7.2-4.el7 will be installed
--> Processing Dependency: python-babel >= 0.8 for package: python-jinja2-2.7.2-4.el7.noarch
--> Processing Dependency: python-markupsafe for package: python-jinja2-2.7.2-4.el7.noarch
---> Package python-werkzeug.noarch 0:0.9.1-2.el7 will be installed
--> Running transaction check
---> Package python-babel.noarch 0:0.9.6-8.el7 will be installed
---> Package python-markupsafe.x86_64 0:0.11-10.el7 will be installed
--> Finished Dependency Resolution Dependencies Resolved ==========================================================================================
Package Arch Version Repository Size
==========================================================================================
Installing:
python-flask noarch 1:0.10.1-5.el7_7 extras 205 k
Installing for dependencies:
python-babel noarch 0.9.6-8.el7 base 1.4 M
python-itsdangerous noarch 0.23-2.el7 extras 24 k
python-jinja2 noarch 2.7.2-4.el7 base 519 k
python-markupsafe x86_64 0.11-10.el7 base 25 k
python-werkzeug noarch 0.9.1-2.el7 extras 562 k Transaction Summary
==========================================================================================
Install 1 Package (+5 Dependent packages) Total download size: 2.7 M
Installed size: 12 M
Is this ok [y/d/N]: y
Downloading packages:
(1/6): python-flask-0.10.1-5.el7_7.noarch.rpm | 205 kB 00:00:00
(2/6): python-itsdangerous-0.23-2.el7.noarch.rpm | 24 kB 00:00:00
(3/6): python-babel-0.9.6-8.el7.noarch.rpm | 1.4 MB 00:00:00
(4/6): python-markupsafe-0.11-10.el7.x86_64.rpm | 25 kB 00:00:00
(5/6): python-jinja2-2.7.2-4.el7.noarch.rpm | 519 kB 00:00:00
(6/6): python-werkzeug-0.9.1-2.el7.noarch.rpm | 562 kB 00:00:00
------------------------------------------------------------------------------------------
Total 3.0 MB/s | 2.7 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : python-werkzeug-0.9.1-2.el7.noarch 1/6
Installing : python-itsdangerous-0.23-2.el7.noarch 2/6
Installing : python-babel-0.9.6-8.el7.noarch 3/6
Installing : python-markupsafe-0.11-10.el7.x86_64 4/6
Installing : python-jinja2-2.7.2-4.el7.noarch 5/6
Installing : 1:python-flask-0.10.1-5.el7_7.noarch 6/6
Verifying : python-markupsafe-0.11-10.el7.x86_64 1/6
Verifying : python-babel-0.9.6-8.el7.noarch 2/6
Verifying : python-itsdangerous-0.23-2.el7.noarch 3/6
Verifying : python-jinja2-2.7.2-4.el7.noarch 4/6
Verifying : 1:python-flask-0.10.1-5.el7_7.noarch 5/6
Verifying : python-werkzeug-0.9.1-2.el7.noarch 6/6 Installed:
python-flask.noarch 1:0.10.1-5.el7_7 Dependency Installed:
python-babel.noarch 0:0.9.6-8.el7 python-itsdangerous.noarch 0:0.23-2.el7
python-jinja2.noarch 0:2.7.2-4.el7 python-markupsafe.x86_64 0:0.11-10.el7
python-werkzeug.noarch 0:0.9.1-2.el7 Complete!
[root@lxc ~]#

  提示:LXC WEB Panel是用flask框架研发,所以依赖python-flask这个包,当然也可以用pip去下载这个也是可以的

  pip安装flask,首先要安装python-pip

[root@docker_node1 ~]# yum install python-pip
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package python2-pip.noarch 0:8.1.2-12.el7 will be installed
--> Processing Dependency: python-setuptools for package: python2-pip-8.1.2-12.el7.noarch
--> Running transaction check
---> Package python-setuptools.noarch 0:0.9.8-7.el7 will be installed
--> Processing Dependency: python-backports-ssl_match_hostname for package: python-setuptools-0.9.8-7.el7.noarch
--> Running transaction check
---> Package python-backports-ssl_match_hostname.noarch 0:3.5.0.1-1.el7 will be installed
--> Processing Dependency: python-ipaddress for package: python-backports-ssl_match_hostname-3.5.0.1-1.el7.noarch
--> Processing Dependency: python-backports for package: python-backports-ssl_match_hostname-3.5.0.1-1.el7.noarch
--> Running transaction check
---> Package python-backports.x86_64 0:1.0-8.el7 will be installed
---> Package python-ipaddress.noarch 0:1.0.16-2.el7 will be installed
--> Finished Dependency Resolution Dependencies Resolved ========================================================================================
Package Arch Version Repository
Size
========================================================================================
Installing:
python2-pip noarch 8.1.2-12.el7 epel 1.7 M
Installing for dependencies:
python-backports x86_64 1.0-8.el7 base 5.8 k
python-backports-ssl_match_hostname noarch 3.5.0.1-1.el7 base 13 k
python-ipaddress noarch 1.0.16-2.el7 base 34 k
python-setuptools noarch 0.9.8-7.el7 base 397 k Transaction Summary
========================================================================================
Install 1 Package (+4 Dependent packages) Total download size: 2.1 M
Installed size: 9.4 M
Is this ok [y/d/N]: y
Downloading packages:
(1/5): python-backports-1.0-8.el7.x86_64.rpm | 5.8 kB 00:00:00
(2/5): python-ipaddress-1.0.16-2.el7.noarch.rpm | 34 kB 00:00:00
(3/5): python-backports-ssl_match_hostname-3.5.0.1-1.el7.noarch. | 13 kB 00:00:00
(4/5): python-setuptools-0.9.8-7.el7.noarch.rpm | 397 kB 00:00:00
(5/5): python2-pip-8.1.2-12.el7.noarch.rpm | 1.7 MB 00:00:00
----------------------------------------------------------------------------------------
Total 2.3 MB/s | 2.1 MB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : python-backports-1.0-8.el7.x86_64 1/5
Installing : python-ipaddress-1.0.16-2.el7.noarch 2/5
Installing : python-backports-ssl_match_hostname-3.5.0.1-1.el7.noarch 3/5
Installing : python-setuptools-0.9.8-7.el7.noarch 4/5
Installing : python2-pip-8.1.2-12.el7.noarch 5/5
Verifying : python-ipaddress-1.0.16-2.el7.noarch 1/5
Verifying : python-setuptools-0.9.8-7.el7.noarch 2/5
Verifying : python2-pip-8.1.2-12.el7.noarch 3/5
Verifying : python-backports-1.0-8.el7.x86_64 4/5
Verifying : python-backports-ssl_match_hostname-3.5.0.1-1.el7.noarch 5/5 Installed:
python2-pip.noarch 0:8.1.2-12.el7 Dependency Installed:
python-backports.x86_64 0:1.0-8.el7
python-backports-ssl_match_hostname.noarch 0:3.5.0.1-1.el7
python-ipaddress.noarch 0:1.0.16-2.el7
python-setuptools.noarch 0:0.9.8-7.el7 Complete!
[root@docker_node1 ~]# pip -V
pip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7)
[root@docker_node1 ~]#

  提示:默认yum安装的pip默认是python2.7的pip版本是8.1.2,我们使用pip安装flask会提示我们pip版本低,如果你不想看到提示我们版本pip版本过低可以选择pip install --upgrade pip命令对pip进行版本更新

  安装flask

[root@docker_node1 ~]# pip install flask
Collecting flask
Downloading https://files.pythonhosted.org/packages/f2/28/2a03252dfb9ebf377f40fba6a7841b47083260bf8bd8e737b0c6952df83f/Flask-1.1.2-py2.py3-none-any.whl (94kB)
100% |████████████████████████████████| 102kB 11kB/s
Collecting Jinja2>=2.10.1 (from flask)
Downloading https://files.pythonhosted.org/packages/30/9e/f663a2aa66a09d838042ae1a2c5659828bb9b41ea3a6efa20a20fd92b121/Jinja2-2.11.2-py2.py3-none-any.whl (125kB)
100% |████████████████████████████████| 133kB 10kB/s
Collecting itsdangerous>=0.24 (from flask)
Downloading https://files.pythonhosted.org/packages/76/ae/44b03b253d6fade317f32c24d100b3b35c2239807046a4c953c7b89fa49e/itsdangerous-1.1.0-py2.py3-none-any.whl
Collecting click>=5.1 (from flask)
Downloading https://files.pythonhosted.org/packages/d2/3d/fa76db83bf75c4f8d338c2fd15c8d33fdd7ad23a9b5e57eb6c5de26b430e/click-7.1.2-py2.py3-none-any.whl (82kB)
100% |████████████████████████████████| 92kB 10kB/s
Collecting Werkzeug>=0.15 (from flask)
Downloading https://files.pythonhosted.org/packages/cc/94/5f7079a0e00bd6863ef8f1da638721e9da21e5bacee597595b318f71d62e/Werkzeug-1.0.1-py2.py3-none-any.whl (298kB)
100% |████████████████████████████████| 307kB 9.8kB/s
Collecting MarkupSafe>=0.23 (from Jinja2>=2.10.1->flask)
Downloading https://files.pythonhosted.org/packages/fb/40/f3adb7cf24a8012813c5edb20329eb22d5d8e2a0ecf73d21d6b85865da11/MarkupSafe-1.1.1-cp27-cp27mu-manylinux1_x86_64.whl
Installing collected packages: MarkupSafe, Jinja2, itsdangerous, click, Werkzeug, flask
Successfully installed Jinja2-2.11.2 MarkupSafe-1.1.1 Werkzeug-1.0.1 click-7.1.2 flask-1.1.2 itsdangerous-1.1.0
You are using pip version 8.1.2, however version 20.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
[root@docker_node1 ~]# pip list|grep "Flask"
Flask (1.1.2)
You are using pip version 8.1.2, however version 20.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
[root@docker_node1 ~]#

  提示:可以看到flask已经安装,版本是1.1.2

  2、安装debootstrap

[root@docker_node1 ~]# yum install -y debootstrap
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package debootstrap.noarch 0:1.0.109-2.el7 will be installed
--> Processing Dependency: dpkg for package: debootstrap-1.0.109-2.el7.noarch
--> Running transaction check
---> Package dpkg.x86_64 0:1.18.25-9.el7 will be installed
--> Finished Dependency Resolution Dependencies Resolved ========================================================================================
Package Arch Version Repository Size
========================================================================================
Installing:
debootstrap noarch 1.0.109-2.el7 epel 84 k
Installing for dependencies:
dpkg x86_64 1.18.25-9.el7 epel 1.3 M Transaction Summary
========================================================================================
Install 1 Package (+1 Dependent package) Total download size: 1.4 M
Installed size: 6.2 M
Downloading packages:
(1/2): debootstrap-1.0.109-2.el7.noarch.rpm | 84 kB 00:00:00
(2/2): dpkg-1.18.25-9.el7.x86_64.rpm | 1.3 MB 00:00:00
----------------------------------------------------------------------------------------
Total 2.6 MB/s | 1.4 MB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : dpkg-1.18.25-9.el7.x86_64 1/2
Installing : debootstrap-1.0.109-2.el7.noarch 2/2
Verifying : debootstrap-1.0.109-2.el7.noarch 1/2
Verifying : dpkg-1.18.25-9.el7.x86_64 2/2 Installed:
debootstrap.noarch 0:1.0.109-2.el7 Dependency Installed:
dpkg.x86_64 0:1.18.25-9.el7 Complete!
[root@docker_node1 ~]#

  提示:在创建ubuntu容器时,需要依赖debootstrap;

  3、安装LXC组件

  请参考https://www.cnblogs.com/qiuhom-1874/p/12901493.html;如果你的主机已经安装这一步可以跳过

  4、克隆LXC WEB Panel项目到本地

[root@docker_node1 ~]# git clone https://github.com/lxc-webpanel/LXC-Web-Panel.git
Cloning into 'LXC-Web-Panel'...
remote: Enumerating objects: 243, done.
remote: Total 243 (delta 0), reused 0 (delta 0), pack-reused 243
Receiving objects: 100% (243/243), 198.33 KiB | 205.00 KiB/s, done.
Resolving deltas: 100% (108/108), done.
[root@docker_node1 ~]# ls
LXC-Web-Panel
[root@docker_node1 ~]# cd LXC-Web-Panel/
[root@docker_node1 LXC-Web-Panel]#

  5、启动LXC WEB Panel

  提示:成功启动LXC WEB Panel后,会像上图一样,提示我们访问本机的5000端口;

  到此LXC WEB Panel就搭建好了,接下来我们就可以访问5000端口,登录LXC WEB Panel来管理我们的LXC容器了;

  提示:默认用户名和密码是admin

  提示:登录LXC WEB Panel后,在没有容器的情况下会提示我们创建容器,这里需要注意的是,如果你的主机上没有虚拟的网桥,要创建网桥,在新建容器,否则新建的容器无法启动;

  新建网桥请参考https://www.cnblogs.com/qiuhom-1874/p/12901493.html;本人用图形界面去创建网络会报错,不知道哪里的原因;只好手动去Linux shell终端上创建好了;

  创建好网桥后,再来启动刚才创建好的容器,就可以正常启动了

  提示:可以看到我们创建了网桥后就可以正常启动容器了;如果你主机上有其他网桥也是可以的,我们可以编辑u1,把你主机上有的网桥和类型对应起来,给定一个ip地址,然后启动就没有问题;如下所示

  提示:link其他网络需要注意类型,上面docker0桥同virbr0都是虚拟网桥,所以类型是veth;这里还需要注意,如果类型填错了,会导致服务不可用,解决办法是删除/var/lib/lxc/对应容器的名的目录,然后重新启动 LXC WEB Penal;以上就是 LXC的图形管理工具LXC WEB Penal的简单管理,更多的管理可以自己搭建一个玩玩;

容器技术之LXC WEB管理工具LXC WEB Panel的更多相关文章

  1. redis cluster集群web管理工具 relumin

    redis cluster集群web管理工具 relumin 下载地址 https://github.com/be-hase/relumin 只支持redis cluster模式 java环境 tar ...

  2. KVM web管理工具——WebVirtMgr(一)

    WebVirtMgr 介绍     WebVirtMgr采用几乎纯Python开发,其前端是基于Python的Django,后端是基于Libvirt的Python接口,将日常kvm的管理操作变的更加的 ...

  3. Elasticasearch Web管理工具-Cerebro

    cerebro是一个使用Scala,Play Framework,AngularJS和Bootstrap构建的开源(MIT许可)elasticsearch web管理工具.需要Java 1.8或更高版 ...

  4. 虚拟化技术之kvm WEB管理工具kimchi

    在前面的博客中,我们介绍了kvm的各种工具,有基于图形管理的virt-manager.有基于命令行管理的virt-install .qemu-kvm.virsh等等:今天我们来介绍一款基于web界面的 ...

  5. SWAT—Samba WEB管理工具

    本文试验环境是RHEL5.2+samba-swat-3.0.28.Server的IP是192.168.120.241.   1. swat介绍 SWAT:The Samba WEB Administr ...

  6. Docker 的 Web 管理工具 DockerFly

    Dockerfly是基于 Docker1.12+ (Docker API 1.24+) 开发出Docker 管理工具,提供里最基本的基于 Docker 的管理功能,目的是能够方便广大Docker初学者 ...

  7. ZooKeeper可视化Web管理工具收集(待实践)

    原来ZooKeeper是有Web管理后台的.但是仅限于操作ZooKeeper的数据,如果要监控性能,估计要借助Nagios去配合. 这些工具应该ZK UI最好用,下面是收集的一些工具安装教程: htt ...

  8. 云计算管理平台之OpenStack Web管理工具dashboard

    在上一篇博客中,我们成功的基于两种网络启动虚拟机:这意味着openstack的核心服务都搭建完成,并正常运行着:有关启动虚拟机实例请参考上一篇博客:今天我们来了解下,基于一个web界面图形工具来管理o ...

  9. 快速搭建 kvm web 管理工具 WebVirtMgr

    作者:SRE运维博客 博客地址: https://www.cnsre.cn/ 文章地址:https://www.cnsre.cn/posts/211117937177/ 相关话题:https://ww ...

随机推荐

  1. pytorch中的前项计算和反向传播

    前项计算1 import torch # (3*(x+2)^2)/4 #grad_fn 保留计算的过程 x = torch.ones([2,2],requires_grad=True) print(x ...

  2. GoJS事件

    1.阻止键盘事件 myDiagram.commandHandler.doKeyDown = function () { var e = myDiagram.lastInput; // Meta(Com ...

  3. python之实现图像的手绘效果

    https://blog.csdn.net/riba2534/article/details/74152285 原图: b: c: d: 最终图:

  4. JavaScript type="text/template"的用法

    JavaScript type="text/template"相当于定义一个模板,如果没有使用html()方法的话,是显示不出来的,我们直接看例子(我是在tp框架的里面写的) &l ...

  5. nginx+vue+thinkphp5.1部署,解决前端刷新404,以及前端404解决后,后台又404的问题

    宝塔的话直接在网站的伪静态一栏中如下就行 location /admin { if (!-e $request_filename){ rewrite ^(.*)$ /index.php?s=$1 la ...

  6. [函数] PHP取二进制文件头快速判断文件类型

    一般我们都是按照文件扩展名来判断文件类型,但其实不太靠谱,因为可以通过修改扩展名来伪装文件类型.其实我们可以通过读取文件信息来识别,比如 PHP扩展中提供了类似 exif_imagetype 这样的函 ...

  7. python学习02python入门二

    学前须知:1.本文档有关内容均建立在python3.x版本上,python2.x已经成为历史,如有需要,文内会特别说明. 2.本文使用的编辑器多为架构在Windows上的pycharm,如需了解Lin ...

  8. BIOS和CMOS区别

    在网上看到一篇关于CMOS的文章,分享一下. 原文地址:http://jingyan.baidu.com/article/c843ea0b51155d77921e4a7a.html BIOS是什么? ...

  9. Floyd-Warshall算法正确性证明

    以下所有讨论,都是基于有向无负权回路的图上的.因为这一性质,任何最短路径都不会含有环,所以也不讨论路径中包含环的情形!并且为避免混淆,将"最短路径"称为权值最小的路径,将路径经过的 ...

  10. opencv-10-图像滤波-噪声添加与均值滤波-含opencv C++ 代码实现

    开始之前 再说上一篇文章中, 我们想按照噪声产生, 然后将降噪的, 但是限于篇幅, 我就放在这一篇里面了, 说起图像的噪声问题就又回到了我们上一章的内容, 把噪声当作信号处理, 实际上数字图像处理实际 ...