生产环境的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. where 泛型类型参数及约束

    private void InsertData<TRowMetadata, TFieldMetadata, TCellMetadata>(IMetadataReader<TRowMe ...

  2. 自己写浏览器和webserver的分析!

    自己写浏览器和webserver 在android写一个浏览器 editText:输入网址ip:port/login.html.提交 把域名解析成ip 产生请求行 get login.html /r/ ...

  3. iOS-NSMutableParagraphStyle段落风格

    apple API: NS_CLASS_AVAILABLE(10_0, 6_0) @interface NSMutableParagraphStyle : NSParagraphStyle @prop ...

  4. bwlabel

    bwlabel是用来标记二维的二值图像中的连通组的,简言之,就是黑背景下面有多少白的块,也就是从黑背景甄别白块块的. L = bwlabel(BW, n) returns a matrix L, of ...

  5. Windows下免费软件的首选推荐

    PS:以下按装机顺序排列,“|”号后面是备选软件. 启动引导:EasyBCD 虚拟机:VirtualBox Linux:Zorin | Linux Mint(Mate) | Ubuntu 驱动工具:驱 ...

  6. Win10:如何修改双网卡的优先级?

    很多使用双网卡的IT之家网友可能遇到一种情况,比如笔记本电脑在插上网线后还是用WiFi,得手动关闭无线连接才能转换到有线连接.如何才能调整合适的网络优先级呢?一般来说,有两种方法比较常用. 一.调整网 ...

  7. 【Python + ATX基于uiautomator2】之编写unittest自动化测试脚本

    不说废话上代码: #!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2018/08/31 09:43 # @Author : zc # @ ...

  8. jvm(12)-java内存模型与线程

    [0]README 0.1)本文部分文字描述转自“深入理解jvm”,旨在学习“java内存模型与线程” 的基础知识:   [1]概述 1)并发处理的广泛应用是使得 Amdahl 定律代替摩尔定律称为计 ...

  9. scikit-learn:3.4. Model persistence

    參考:http://scikit-learn.org/stable/modules/model_persistence.html 训练了模型之后,我们希望能够保存下来,遇到新样本时直接使用已经训练好的 ...

  10. PRINTDLG 打印对话框操作

    typedef struct tagPD { DWORD lStructSize; HWND hwndOwner; HGLOBAL hDevMode; HGLOBAL hDevNames; HDC h ...