生产环境的KVM宿主机越来越多,需要对宿主机的状态进行调控。这里用webvirtmgr进行管理。图形化的WEB,让人能更方便的查看kvm 宿主机的情况和操作

1 安装支持的软件源

yum -y install http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

2 安装相关软件

yum -y install git python-pip libvirt-python libxml2-python python-websockify supervisor nginx

3 从git-hub中下载相关的webvirtmgr代码

cd /usr/local/src/

git clone git://github.com/retspen/webvirtmgr.git

4 安装webvirtmgr

cd webvirtmgr/

pip install -r requirements.txt

5 安装数据库

yum install python-sqlite2

6 对django进行环境配置

./manage.py syncdb

You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Username (leave blank to use 'root'): admin
Email address: 2733176200@qq.com
Password:*********
Password (again):*********
 
 ./manage.py collectstatic #生成配置文件
./manage.py createsuperuser #添加管理员账号
 
7 拷贝web到 相关目录
cd ..
mkdir -pv /var/www
cp -Rv webvirtmgr /var/www/webvirtmgr
 
8 设置ssh
ssh-keygen
ssh-copy-id 192.168.2.32
ssh 192.168.2.32 -L localhost:8000:localhost:8000 -L localhost:6080:localhost:6080
 
9 编辑nginx配置文件
vim /etc/nginx/conf.d/webvirtmgr.conf 添加下面内容到文件中
server {
    listen 80 default_server;
 
    server_name $hostname;
    #access_log /var/log/nginx/webvirtmgr_access_log;
 
    location /static/ {
        root /var/www/webvirtmgr/webvirtmgr; # or /srv instead of /var
        expires max;
    }
 
    location / {
        proxy_pass http://127.0.0.1:8000;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for;
        proxy_set_header Host $host:$server_port;
        proxy_set_header X-Forwarded-Proto $remote_addr;
        proxy_connect_timeout 600;
        proxy_read_timeout 600;
        proxy_send_timeout 600;
        client_max_body_size 1024M; # Set higher depending on your needs
    }
}
 
 
mv /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.bak
 
10 启动nginx
/etc/init.d/nginx restart
 
11 修改防火墙规则
/usr/sbin/setsebool httpd_can_network_connect true
 
 
12 设置 supervisor 
chown -R nginx:nginx /var/www/webvirtmgr
vim /etc/supervisord.conf #在文件末尾添加
[program:webvirtmgr]
command=/usr/bin/python /var/www/webvirtmgr/manage.py run_gunicorn -c /var/www/webvirtmgr/conf/gunicorn.conf.py
directory=/var/www/webvirtmgr
autostart=true
autorestart=true
logfile=/var/log/supervisor/webvirtmgr.log
log_stderr=true
user=nginx
 
[program:webvirtmgr-console]
command=/usr/bin/python /var/www/webvirtmgr/console/webvirtmgr-console
directory=/var/www/webvirtmgr
autostart=true
autorestart=true
stdout_logfile=/var/log/supervisor/webvirtmgr-console.log
redirect_stderr=true
user=nginx
 
 
修改/var/www/webvirtmgr/conf/gunicorn.conf.py 
bind = "0:8000"
 
13 设置开机启动
chkconfig supervisord on
vim /etc/rc.local
/usr/sbin/setsebool httpd_can_network_connect true
 
 
14 启动进程
/etc/init.d/supervisord restart
 
15查看进程
netstat -lnpt 即可以看到6080和8000已经启动
 
16 web访问
http://192.168.0.194/login/
 
 
 
 
 
 

KVM WEB管理工具webvirtmgr安装和使用的更多相关文章

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

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

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

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

  3. KVM WEB管理工具——WebVirtMgr(二)日常配置

    配置宿主机 1.登录WebVirtMgr管理平台 2.添加宿主机 选择首页的WebVirtMgr -->Addd Connection 选择“SSH链接“,设置Label,IP,用户 注意:La ...

  4. KVM web管理工具——WebVirtMgr

    系统环境: [root@kvm-admin ~]# cat /etc/redhat-release CentOS Linux release (Core) 关闭防火墙.selinux [root@kv ...

  5. kvm管理工具Webvirtmgr安装

    虚拟机版本vmware workstation 15.5.0 pro   (也就是linux版) cat /etc/redhat-release CentOS Linux release 7.4.17 ...

  6. KVM Web管理平台 WebVirtMgr

    WebVirtMgr介绍 WebVirtMgr是一个KVM管理平台,让kvm管理变得更为可视化,对中小型kvm应用场景带来了更多方便.WebVirtMgr采用几乎纯Python开发,其前端是基于Pyt ...

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

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

  8. KVM网页管理工具WebVirtMgr部署

    KVM-WebVirtMgr 0ther https://github.com/retspen/webvirtmgr/wiki System Optimization(Only CentOS6.X) ...

  9. kvm虚拟化管理平台WebVirtMgr部署-完整记录(1)

    公司机房有一台2U的服务器(64G内存,32核),由于近期新增业务比较多,测试机也要新增,服务器资源十分有限.所以打算在这台2U服务器上部署kvm虚拟化,虚出多台VM出来,以应对新的测试需求.当KVM ...

随机推荐

  1. Connect China Azure Storage Blob By Container Token In Python SDK

    简介: 基于Python SDK,使用Container Token操作container对象.关于Token的生成可以使用Storage SDK创建,也可以使用工具快速创建供测试. 示例代码: fr ...

  2. C# Enum,Int,String,之间及bool与int之间的转换

    枚举类型的基类型是除 Char 外的任何整型,所以枚举类型的值是整型值. Enum 提供一些实用的静态方法: (1)比较枚举类的实例的方法 (2)将实例的值转换为其字符串表示形式的方法 (3)将数字的 ...

  3. Linux 查看CPU个数和磁盘个数

    top后按数字1,多个cpu的话会显示多个 fdisk -l可以看到多个物理硬盘,做了硬raid只能看到一个硬盘 cat /proc/cpuinfo查看cpu具体的信息

  4. iOS_绘制带删除线的Label

    效果图例如以下: 一个带删除线的文本标签,继承自UILabel 自绘代码过程例如以下: 1,重写控件的drawRect方法 2,首先得到上下文对象 3,设置颜色,并指定是填充(Fill)模式还是笔刷( ...

  5. python3 读取csv的常用语法

    import csv #打开文件,用with打开可以不用去特意关闭file了,python3不支持file()打开文件,只能用open() with open("info.csv" ...

  6. if not aa 表示如果aa等于空就是true 相当于if not aa 相当于 if aa== 空

    aa='tt' print(not aa) #表示 bb是空的 not 表示空 bb='' print(not bb)

  7. 24模拟keepalved vrrp功能,监听主节点,如果主节点不可访问则备节点启动并配置LVS实现接管主节点的资源提供服务(提醒:注意ARP缓存)

    [root@lb04 scripts]# cat ha_lv.sh #!/bin/bash while true do check_count=$(nmap 10.0.0.13|grep " ...

  8. How tomcat works学习笔记

    最近在看Tomcat的源码, 所以找了一本相关的书籍<How tomcat works>. 博客内容多为 学习该书时所记录的笔记.(如有侵权行为,请联系我:eviltomorrow@163 ...

  9. mybatis执行多条sql语句

    1,mybatis执行多条sql语句,有以下几种思路, a,存储过程 b,修改jdbc的参数,允许执行多条语句,如下所示: sqlserver可以直接使用begin,end来执行多条语句, mysql ...

  10. Ext扩展的QQ表情选择面板

    Ext扩展的QQ表情选择面板 define(function () { EmoteChooser = function(cfg){ this.width=340; this.height=112; t ...