容器技术之LXC WEB管理工具LXC WEB Panel
前一篇博文中主要说了下,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的更多相关文章
- redis cluster集群web管理工具 relumin
redis cluster集群web管理工具 relumin 下载地址 https://github.com/be-hase/relumin 只支持redis cluster模式 java环境 tar ...
- KVM web管理工具——WebVirtMgr(一)
WebVirtMgr 介绍 WebVirtMgr采用几乎纯Python开发,其前端是基于Python的Django,后端是基于Libvirt的Python接口,将日常kvm的管理操作变的更加的 ...
- Elasticasearch Web管理工具-Cerebro
cerebro是一个使用Scala,Play Framework,AngularJS和Bootstrap构建的开源(MIT许可)elasticsearch web管理工具.需要Java 1.8或更高版 ...
- 虚拟化技术之kvm WEB管理工具kimchi
在前面的博客中,我们介绍了kvm的各种工具,有基于图形管理的virt-manager.有基于命令行管理的virt-install .qemu-kvm.virsh等等:今天我们来介绍一款基于web界面的 ...
- SWAT—Samba WEB管理工具
本文试验环境是RHEL5.2+samba-swat-3.0.28.Server的IP是192.168.120.241. 1. swat介绍 SWAT:The Samba WEB Administr ...
- Docker 的 Web 管理工具 DockerFly
Dockerfly是基于 Docker1.12+ (Docker API 1.24+) 开发出Docker 管理工具,提供里最基本的基于 Docker 的管理功能,目的是能够方便广大Docker初学者 ...
- ZooKeeper可视化Web管理工具收集(待实践)
原来ZooKeeper是有Web管理后台的.但是仅限于操作ZooKeeper的数据,如果要监控性能,估计要借助Nagios去配合. 这些工具应该ZK UI最好用,下面是收集的一些工具安装教程: htt ...
- 云计算管理平台之OpenStack Web管理工具dashboard
在上一篇博客中,我们成功的基于两种网络启动虚拟机:这意味着openstack的核心服务都搭建完成,并正常运行着:有关启动虚拟机实例请参考上一篇博客:今天我们来了解下,基于一个web界面图形工具来管理o ...
- 快速搭建 kvm web 管理工具 WebVirtMgr
作者:SRE运维博客 博客地址: https://www.cnsre.cn/ 文章地址:https://www.cnsre.cn/posts/211117937177/ 相关话题:https://ww ...
随机推荐
- Spring5:事务管理【整合Mybatis】
Spring 整合Mybatis 1:导入依赖 <dependencies> <!--测试依赖--> <dependency> <groupId>jun ...
- 挑战全网最幽默的Vuex系列教程:第三讲 Vuex旗下的Mutation
写在前面 上一讲「Vuex 旗下的 State 和 Getter」,告诉了我们怎么去使用仓库 store 中的状态数据.当然,光会用肯定还不够,大部分的应用场景还得对这些状态进行操控,那么具体如何操控 ...
- linux上Docker安装gogs私服
一.背景介绍 Gogs 是一款类似GitHub的开源文件/代码管理系统(基于Git),Gogs 的目标是打造一个最简单.最快速和最轻松的方式搭建自助 Git 服务.使用 Go 语言开发使得 Gogs ...
- 想学习CTF的一定要看这篇,让你学习效率提升80%
在学习CTF过程中你是否遇到这样的情况: 下定决心想要学习CTF,不知道从哪里开始? 找了一堆CTF相关的知识学习,但是知识点太凌乱,没有统一明确的学习路径. 又或者理论学习完,没有相应的实操环境? ...
- 对JavaScript中的this的理解
什么是this: 解析器(就是浏览器)在调用函数时,每次都会向函数内部传递两个隐含的参数: 这两个隐含参数其中一个就是this(还有一个是arguments,用来接收函数的实参),this指向的是一个 ...
- 【mybatis annotation】数据层框架应用--Mybatis(二) 基于注解实现数据的CRUD
使用MyBatis框架进行持久层开发 MyBatis是支持普通SQL查询,存储过程和高级映射的优秀持久层框架. MyBatis消除了几乎所有的JDBC代码和参数的手工设置以及对结果集的检索. MyBa ...
- 解释BOM头和去掉方法
http://www.thinkphp.cn/topic/2592.html 以上是叫你去掉bom头的,因为有些文件加载不出来就是window会以记事本的形式打开,然后默认给我们加了了bom头,有些文 ...
- java中wait和sleep的区别
文章目录 Wait和sleep的区别 唤醒wait和sleep java中wait和sleep的区别 在本篇文章中,我们将会讨论一下java中wait()和sleep()方法的区别.并讨论一下怎么使用 ...
- Spring Cloud sleuth with zipkin over RabbitMQ教程
文章目录 Spring Cloud sleuth with zipkin over RabbitMQ demo zipkin server的搭建(基于mysql和rabbitMQ) 客户端环境的依赖 ...
- 加分二叉树 vijos1991 NOIP2003第三题 区间DP/树形DP/记忆化搜索
描述 设一个n个节点的二叉树tree的中序遍历为(l,2,3,-,n),其中数字1,2,3,-,n为节点编号.每个节点都有一个分数(均为正整数),记第i个节点的分数为di,tree及它的每个子树都有一 ...