生产环境的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. asp.net core mvc视频A:笔记5-1.路由规则

    方法一:通过MapRoute方法,配置文件位置 小例子:如果所有路径都要在admin下,可以这样写 方法二:通过路由属性 相对路由 现在需要加/admin/home/index才能正常访问原来的默认页 ...

  2. destoon二次开发基础指南

    代码首先包含common.inc.php文件 在common.inc.php文件中,首先定义常量. define('IN_DESTOON', true); define('IN_ADMIN', def ...

  3. android应用多线程守护让你非常难杀死它

    1.android 应用开启后启动一个服务 public class TestserviceActivity extends Activity { /** Called when the activi ...

  4. NHibernate Transformers.AliasToEntityMap 返回Hashtable

    string query = "select a.CustomerName as CustomerName, b.ProductName as ProductName from Custom ...

  5. C语言基础(17)-作用域

    一个C语言变量的作用域可以是代码块 作用域,函数作用域或者文件作用域. 不推荐写法 int a; // 出现了语法的二义性,可能是声明也可能是定义,所以最好定义完成之后声明 void func();  ...

  6. 服务器中很多的CLOSE_WAIT

    服务器中很多的CLOSE_WAIT,请教各位大虾!!!!!!!!!最近遇到一个问题,工程在LINUX服务器上面跑起来了以后,运行一段时间 就有很多的CLOSE_WAIT链接,多了之后,网站就访问不了了 ...

  7. AudioToolKit的简单介绍及教程

    AudioToolKit的简单介绍及教程 (2013-02-21 09:29:18) 转载▼ 标签: 游戏开发 unity3d教程 unity3d unity it 分类: Unity3d之插件篇 原 ...

  8. iOS 全屏播放网页视频退出后状态栏被隐藏

    使用wkWebView播放网页上的视频,播放完成后,退出视频返回到网页发现app的状态整个被隐藏了,解决方法,监听状态栏隐藏通知,在适当的时候让状态栏显示出来 [[NSNotificationCent ...

  9. IOS设计模式浅析之单例模式(Singleton)

    说在前面 进入正式的设计模式交流之前,扯点闲话.我们在项目开发的过程中,经常会不经意的使用一些常见的设计模式,如单例模式.工厂方法模式.观察者模式等,以前做.NET开发的时候,认真拜读了一下程杰老师的 ...

  10. G - Harmonic Number (II) 找规律--> 给定一个数n,求n除以1~n这n个数的和。n达到2^31 - 1;

    /** 题目:G - Harmonic Number (II) 链接:https://vjudge.net/contest/154246#problem/G 题意:给定一个数n,求n除以1~n这n个数 ...