http://blog.lofyer.org/6-2-2-cloud-ha-ovirt/

12. 搭建高可用oVirt(hosted engine)

笔者写此文时oVirt已经更新到3.4。

在此,我们会用到之前创建的distributed-replicate存储,这样可用保证系统服务的高度可用性有所提高。

有以下几点需要注意:

1. 宿主机的CPU架构需要为Westmere(Westmere E56xx/L56xx/X56xx)、Nehalem(Intel Core i7 9xx)、Penryn(Intel Core 2 Duo P9xxx)或者Conroe(Intel Celeron_4x0)中的之一,否则集群类型会与宿主机类型不兼容导致数据中心启动失败。

CPU Family table 参阅
Intel Architecture and Processor Identification With CPUID Model and Family Numbers

2. 建议参考第11节提前安装含有oVirt管理的虚拟机,硬盘格式为RAW,从而在安装管理机时作为OVF导入或者覆盖虚拟磁盘,减少失败风险时间。

准备

每台机器上都要添加作为虚拟机运行的engine的FQDN,此处为ha.lofyer.org。

1
# echo -e '192.168.10.100\tha.lofyer.org' >> /etc/hosts

存储可以使用之前的glusterfs,方式为NFS_V3,注意将brick的权限设置为vdsm.kvm或者36:36。

1
# gluster volume create gluster-vol1 replica 2 gs1.example.com:/gluster_brick0 gs2.example.com:/gluster_brick0 gs3.example.com:/gluster_brick0 gs4.example.com:/gluster_brick0 gs1.example.com:/gluster_brick1 gs2.example.com:/gluster_brick1 gs3.example.com:/gluster_brick1 gs4.example.com:/gluster_brick1 force

由于engine以及node的网络服务依赖于network而非NetworkManager,我们需要启用前者禁用后者,在每一台服务器上都进行如下类似配置修改网络。

/etc/sysconfig/network-scripts/ifcfg-eth0
1
2
3
4
5
6
7
8
9

NAME=eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
# 注意修改此处的IP
IPADDR=192.168.10.101
NETMASK=255.255.255.0
GATEWAY=192.168.10.1
DNS1=192.168.10.1

1
2
3

# chkconfig NetworkManager off
# chkconfig network on
# service NetworkManager stop; service network restart

添加repo

1
2

# yum localinstall http://resources.ovirt.org/releases/ovirt-release.noarch.rpm
# yum install ovirt-hosted-engine-setup

或者手动添加:

/etc/yum.repos.d/ovirt.repo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

[ovirt-stable]
name=Latest oVirt Releases
baseurl=http://ovirt.org/releases/stable/rpm/EL/$releasever/
enabled=1
skip_if_unavailable=1
gpgcheck=0
[ovirt-3.4-stable]
name=Latest oVirt 3.4.z Releases
baseurl=http://ovirt.org/releases/3.4/rpm/EL/$releasever/
enabled=1
skip_if_unavailable=1
gpgcheck=0
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
includepkgs=epel-release,python-uinput,puppet,python-lockfile,python-cpopen,python-ordereddict,python-pthreading,python-inotify,python-argparse,novnc,python-ply,python-kitchen,python-daemon,python-websockify,livecd-tools,spice-html5,mom
gpgcheck=0
[ovirt-glusterfs-epel]
name=GlusterFS is a clustered file-system capable of scaling to several petabytes.
baseurl=http://download.gluster.org/pub/gluster/glusterfs/LATEST/EPEL.repo/epel-$releasever/$basearch/
enabled=1
skip_if_unavailable=1
gpgcheck=0
[ovirt-glusterfs-noarch-epel]
name=GlusterFS is a clustered file-system capable of scaling to several petabytes.
baseurl=http://download.gluster.org/pub/gluster/glusterfs/LATEST/EPEL.repo/epel-$releasever/noarch
enabled=1
skip_if_unavailable=1
gpgcheck=0

安装hosted-engine

1
# yum install ovirt-hosted-engine-setup

回答一些列问题,如下所示:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173

# hosted-engine --deploy
[ INFO  ] Stage: Initializing
          Continuing will configure this host for serving as hypervisor and create a VM where you have to install oVirt Engine afterwards.
          Are you sure you want to continue? (Yes, No)[Yes]: yes
[ INFO  ] Generating a temporary VNC password.
[ INFO  ] Stage: Environment setup
          Configuration files: []
          Log file: /var/log/ovirt-hosted-engine-setup/ovirt-hosted-engine-setup-20140508182241.log
          Version: otopi-1.2.0 (otopi-1.2.0-1.el6)
[ INFO  ] Hardware supports virtualization
[ INFO  ] Bridge ovirtmgmt already created
[ INFO  ] Stage: Environment packages setup
[ INFO  ] Stage: Programs detection
[ INFO  ] Stage: Environment setup
[ INFO  ] Stage: Environment customization
        
          --== STORAGE CONFIGURATION ==--
        
          During customization use CTRL-D to abort.
          Please specify the storage you would like to use (nfs3, nfs4)[nfs3]:
# 此处的存储域只存储hosted-engine的相关文件,不作为主数据域
          Please specify the full shared storage connection path to use (example: host:/path): 192.168.10.101:/gluster-vol1/ovirt_data/hosted_engine
[ INFO  ] Installing on first host
          Please provide storage domain name. [hosted_storage]:
          Local storage datacenter name is an internal name and currently will not be shown in engine's admin UI.Please enter local datacenter name [hosted_datacenter]:
        
          --== SYSTEM CONFIGURATION ==--
        
        
          --== NETWORK CONFIGURATION ==--
        
          iptables was detected on your computer, do you wish setup to configure it? (Yes, No)[Yes]: no
          Please indicate a pingable gateway IP address [192.168.10.1]:
        
          --== VM CONFIGURATION ==--
# 虚拟engine的安装方式        
          Please specify the device to boot the VM from (cdrom, disk, pxe) [cdrom]:
          The following CPU types are supported by this host:
           - model_Conroe: Intel Conroe Family
          Please specify the CPU type to be used by the VM [model_Conroe]:
          Please specify path to installation media you would like to use [None]: /tmp/centos.iso
          Please specify the number of virtual CPUs for the VM [Defaults to minimum requirement: 2]:
          Please specify the disk size of the VM in GB [Defaults to minimum requirement: 25]:
          You may specify a MAC address for the VM or accept a randomly generated default [00:16:3e:59:9b:e2]:
          Please specify the memory size of the VM in MB [Defaults to minimum requirement: 4096]: 4096
          Please specify the console type you would like to use to connect to the VM (vnc, spice) [vnc]:
        
          --== HOSTED ENGINE CONFIGURATION ==--
        
          Enter the name which will be used to identify this host inside the Administrator Portal [hosted_engine_1]:
          Enter 'admin@internal' user password that will be used for accessing the Administrator Portal:
          Confirm 'admin@internal' user password:
          Please provide the FQDN for the engine you would like to use.
          This needs to match the FQDN that you will use for the engine installation within the VM.
          Note: This will be the FQDN of the VM you are now going to create,
          it should not point to the base host or to any other existing machine.
          Engine FQDN: ha.lofyer.org
[WARNING] Failed to resolve ha.lofyer.org using DNS, it can be resolved only locally
          Please provide the name of the SMTP server through which we will send notifications [localhost]:
          Please provide the TCP port number of the SMTP server [25]:
          Please provide the email address from which notifications will be sent [root@localhost]:
          Please provide a comma-separated list of email addresses which will get notifications [root@localhost]:
[ INFO  ] Stage: Setup validation
        
          --== CONFIGURATION PREVIEW ==--
        
          Engine FQDN                        : ha.lofyer.org
          Bridge name                        : ovirtmgmt
          SSH daemon port                    : 22
          Gateway address                    : 192.168.10.1
          Host name for web application      : hosted_engine_1
          Host ID                            : 1
          Image size GB                      : 25
          Storage connection                 : 192.168.10.101:/gluster-vol1/ovirt_data/hosted_data/
          Console type                       : vnc
          Memory size MB                     : 4096
          MAC address                        : 00:16:3e:59:9b:e2
          Boot type                          : cdrom
          Number of CPUs                     : 2
          ISO image (for cdrom boot)         : /tmp/centos.iso
          CPU Type                           : model_Conroe
        
          Please confirm installation settings (Yes, No)[No]: yes
[ INFO  ] Generating answer file '/etc/ovirt-hosted-engine/answers.conf'
[ INFO  ] Stage: Transaction setup
[ INFO  ] Stage: Misc configuration
[ INFO  ] Stage: Package installation
[ INFO  ] Stage: Misc configuration
[ INFO  ] Configuring libvirt
[ INFO  ] Configuring VDSM
[ INFO  ] Starting vdsmd
[ INFO  ] Waiting for VDSM hardware info
[ INFO  ] Waiting for VDSM hardware info
[ INFO  ] Waiting for VDSM hardware info
[ INFO  ] Waiting for VDSM hardware info
[ INFO  ] Creating Storage Domain
[ INFO  ] Creating Storage Pool
[ INFO  ] Connecting Storage Pool
[ INFO  ] Verifying sanlock lockspace initialization
[ INFO  ] Initializing sanlock lockspace
[ INFO  ] Initializing sanlock metadata
[ INFO  ] Creating VM Image
[ INFO  ] Disconnecting Storage Pool
[ INFO  ] Start monitoring domain
[ INFO  ] Configuring VM
[ INFO  ] Updating hosted-engine configuration
[ INFO  ] Stage: Transaction commit
[ INFO  ] Stage: Closing up
          The following network ports should be opened:
              tcp:5900
              tcp:5901
              udp:5900
              udp:5901
          An example of the required configuration for iptables can be found at:
              /etc/ovirt-hosted-engine/iptables.example
          In order to configure firewalld, copy the files from
          /etc/ovirt-hosted-engine/firewalld to /etc/firewalld/services
          and execute the following commands:
              firewall-cmd -service hosted-console
[ INFO  ] Creating VM
          You can now connect to the VM with the following command:
           /usr/bin/remote-viewer vnc://localhost:5900
          Use temporary password "2067OGHU" to connect to vnc console.
          Please note that in order to use remote-viewer you need to be able to run graphical applications.
          This means that if you are using ssh you have to supply the -Y flag (enables trusted X11 forwarding).
          Otherwise you can run the command from a terminal in your preferred desktop environment.
          If you cannot run graphical applications you can connect to the graphic console from another host or connect to the console using the following command:
          virsh -c qemu+tls://192.168.1.150/system console HostedEngine
          If you need to reboot the VM you will need to start it manually using the command:
          hosted-engine --vm-start
          You can then set a temporary password using the command:
          hosted-engine --add-console-password
          The VM has been started.  Install the OS and shut down or reboot it.  To continue please make a selection:
        
          (1) Continue setup - VM installation is complete
          (2) Reboot the VM and restart installation
          (3) Abort setup
# 需要在另外一个有图形能力的terminal中运行"remote-viewer vnc://192.168.10.101:5900"连接虚拟机并关闭(密码在第123行),如有需要可运行"hosted-engine --add-console-password"更换控制台密码。如果之前选择cdrom进行安装的话,此处可以在gs1上用已经安装好engine的虚拟磁盘进行覆盖,类似"mount -t nfs 192.168.10.101:192.168.10.101:/gluster-vol1/ovirt_data/hosted_data/ /mnt; engine.raw /mnt/ovirt_data/hosted_data/.../vm_UUID"
          (1, 2, 3)[1]: 1
          Waiting for VM to shut down...
[ INFO  ] Creating VM
          You can now connect to the VM with the following command:
           /usr/bin/remote-viewer vnc://localhost:5900
          Use temporary password "2067OGHU" to connect to vnc console.
          Please note that in order to use remote-viewer you need to be able to run graphical applications.
          This means that if you are using ssh you have to supply the -Y flag (enables trusted X11 forwarding).
          Otherwise you can run the command from a terminal in your preferred desktop environment.
          If you cannot run graphical applications you can connect to the graphic console from another host or connect to the console using the following command:
          virsh -c qemu+tls://192.168.1.150/system console HostedEngine
          If you need to reboot the VM you will need to start it manually using the command:
          hosted-engine --vm-start
          You can then set a temporary password using the command:
          hosted-engine --add-console-password
          Please install and setup the engine in the VM.
          You may also be interested in installing ovirt-guest-agent-common package in the VM.
          To continue make a selection from the options below:
          (1) Continue setup - engine installation is complete
          (2) Power off and restart the VM
          (3) Abort setup
# 此处参考第一次操作,连接虚拟机控制台后进行"engine-setup --offline"以安装engine
          (1, 2, 3)[1]: 1
[ INFO  ] Engine replied: DB Up!Welcome to Health Status!
[ INFO  ] Waiting for the host to become operational in the engine. This may take several minutes...
[ INFO  ] Still waiting for VDSM host to become operational...
[ INFO  ] The VDSM Host is now operational
          Please shutdown the VM allowing the system to launch it as a monitored service.
# 到此,需要连接虚拟机控制台关闭虚拟机
          The system will wait until the VM is down.
[ INFO  ] Enabling and starting HA services
          Hosted Engine successfully set up
[ INFO  ] Stage: Clean up
[ INFO  ] Stage: Pre-termination
[ INFO  ] Stage: Termination

此时,运行”hosted-engine –vm-start”启动engine。

搭建高可用oVirt(hosted engine)相关推荐

  1. 云服务器搭建高可用keepalived+nginx+emqx集群

    云服务器搭建高可用keepalived+nginx+emqx集群 一.高可用emqx集群搭建 1 单机搭建emqx 2 配置认证和鉴权插件 3 搭建emqx集群 二.nginx搭建负载均衡 1 ngi ...

  2. 搭建高可用mongodb集群(二)—— 副本集

    2019独角兽企业重金招聘Python工程师标准>>> 在上一篇文章<搭建高可用MongoDB集群(一)--配置MongoDB> 提到了几个问题还没有解决. 主节点挂了能 ...

  3. 如何搭建高可用Redis服务

    作者:漫步CODE人生 来自:cnblogs.com/scode2/p/8670980.html 题记 基于内存的Redis应该是目前各种web开发业务中最为常用的key-value数据库了,我们经常 ...

  4. MyCAT+MySQL 搭建高可用企业级数据库集群

    第1章 课程介绍 课程介绍 1-1 MyCAT导学 试看 1-2 课程介绍 第2章 MyCAT入门 这一章中,我们将回顾了垂直切分,水平切分,分库分表等基础概念,然后快速回如何安装和启动MyCAT的, ...

  5. 用Keepalived搭建高可用集群

    一.集群介绍 1.根据功能划分为两大类:高可用和负载均衡 2.高可用:一台工作,另一台冗余,当一台服务器故障宕机时,另一台服务器提供服务.开源软件有heartbeat,keepalived. 3.负载 ...

  6. 【Nginx那些事】nginx配置实例(四)搭建高可用集群

    [Nginx那些事]nginx配置实例(四)搭建高可用集群 nginx 实现高可用 安装keepalived keepalived配置 主Nginx服务器配置 从nginx服务器配置 脚本文件权限设置 ...

  7. k8s高可用集群_搭建高可用集群(初始化和部署keepalived)---K8S_Google工作笔记0055

    技术交流QQ群[JAVA,C++,Python,.NET,BigData,AI]:170933152 然后我们来部署keepalived,搭建高可用集群. 然后我们这里需要master,155, ma ...

  8. k8s高可用集群_搭建高可用集群(实现方式介绍)---K8S_Google工作笔记0054

    技术交流QQ群[JAVA,C++,Python,.NET,BigData,AI]:170933152 然后我们来说搭建高可用集群,为什么要搭建高可用集群. 因为,首先我们说master节点是用来管理其 ...

  9. 使用SpringCloud搭建高可用服务注册中心

    我们需要的,不仅仅是一个服务注册中心而已,而是一个高可用服务注册中心. 上篇博客中我们介绍了如何使用Spring Cloud搭建一个服务注册中心,但是搭建好的服务注册中心是一个单节点的服务注册中心,这 ...

最新文章

  1. 如何安装蓝湖插件支持Photoshop CC 2017
  2. 最简android之wifi调试
  3. Redis 高可用特性之 “持久化” 详解
  4. php phalcon.dll 下载,extension=php_phalcon.dll 安装过程
  5. Netty设计模式应用
  6. java regex match 替换_java正则表达式四种常用的处理方式(匹配、分割、替代、获取)...
  7. 闭包函数和装饰器(待补充)
  8. 函数call相关[ASM]
  9. proc文件系统、sysfs文件系统、kobject操作
  10. 谷歌大牛Jeff Dean亲自撰文:深度学习研究的黄金十年
  11. CF100015B - Ball Painting
  12. 疯狂的上网本意义何在?
  13. java就是我的幸福,关于幸福的句子经典
  14. wi-fi数据双通道_有限的Wi-Fi通道会限制网络可用性吗?
  15. 西电上机题——P378-正整数的最优分解
  16. 关机代码(强制关机)
  17. org.apache.flume.conf.ConfigurationException: Channel c1 not in active set.
  18. 一分钟带你了解超五类、六类网线的特点及区别
  19. 11家共享单车可通过支付宝免押骑车,这种省钱的方法你get了吗?
  20. 传感器实训心得体会_传感器心得体会

热门文章

  1. 组成计算机cpu的两大软件是,交换机和计算机一样,也由硬件和软件两部分组成,硬件包括CPU...
  2. 汽车区域控制器的关键技术和MCU解决方案深度分析
  3. 华视电子vue身份证读取
  4. 亚马逊平台还收费吗?收费多少?
  5. 个人博客网站接入来必力评论系统
  6. insert table mysql_MYSQL insert data(如何插入数据到table)
  7. grbl控制3轴机械臂 原理 实现 (四) 之GRBL源码修改驱动三轴机械臂
  8. html5 video 手机端视频播放全屏显示
  9. nginx安装、配置文件详解、测试
  10. OLAP分析引擎Druid配置文件详解(五):MiddleManager配置文件