生产环境的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. MongoDB笔记(一):MongoDB介绍及Windows下安装

    一.前言 MongoDB火了也蛮久了,关于简介看看这里吧.项目中一直没用上,最近闲的慌就自己学了下,顺便记录下以便今后复习. 本系列是基于MongoDB 2.4.8 windows 64位讲解,后面的 ...

  2. <转>c++ builder JSONCPP 注意事项 XE2 解决编译问题 _Mfl

    在C++Builder中使用JSONCPP需要注意的问题 1.使用STL的MAP而不是内建的MAP这个问题实际上和编译器无关.内建的MAP不是很稳定,当解析数据大于600K左右时,会崩溃.虽然一般来说 ...

  3. mvc模型绑定问题

    public void AddDesk(x_s_desk x_s_desk) 绑定的到 public void AddDesk(x_s_desk desk) 绑定不到 目前不知道原因 且仅有部分模型需 ...

  4. [DevExpress]XtraTabControl右键加入关闭当前页、关闭其它页、所有关闭的实现

    private void xtraTabControl_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButton ...

  5. zabbix proxy 安装

    ### 前期准备 ```   # 直接yum安装 ```   ### 安装 ``` # 安装 sqlite zabbix-proxy-sqlite3 yum -y install sqlite sql ...

  6. TortoiseSVN客户端使用方法

    SVN对于程序开发来说是非常重要的东西,它是非常不错的版本管理工具,下面介绍一下TortoiseSVN客户端的使用方法. 工具/原料 TortoiseSVN 方法/步骤   如果没有TortoiseS ...

  7. GTS、GCK,GSR全称

    GTS:Global 3-state buffer delay 全局使能,三态 GCK:Global Clock buffer delay   全局时钟 GSR:Global set/reset bu ...

  8. 【bzoj1875】【SDOI2009】【HH去散步】

    1875: [SDOI2009]HH去散步 Time Limit: 20 Sec Memory Limit: 64 MB Submit: 932 Solved: 424 [Submit][Status ...

  9. UML类图详解_关联关系_多对一

    首先先来明确一个概念,即多重性.什么是多重性呢?多重性是指两个对象之间的链接数目,表示法是“下限...上限”,最小数据为零(0),最大数目为没有设限(*),如果仅标示一个数目级上下限相同. 实际在UM ...

  10. iOS开发多线程篇 11 —自定义NSOperation

    iOS开发多线程篇—自定义NSOperation 一.实现一个简单的tableView显示效果 实现效果展示: 代码示例(使用以前在主控制器中进行业务处理的方式) 1.新建一个项目,让控制器继承自UI ...