CloudStack 4.4+KVM之KVM计算节点安装
二、KVM计算节点安装1. 修改主机名在hosts中增加1
2
3
4
# vi /etc/hosts
192.168.10.190 node01.abc.com
# vi /etc/sysconfig/network
HOSTNAME=node01.abc.com
2. 关闭SELINUX设置
1
2
# vi /etc/selinux/config
SELINUX=disabled
3. 关闭防火墙
1
2
# service iptables stop
# chkconfig iptables off
4. 直接同步互联网时间服务器
1
2
# crontabc -e
01 */3 * * * /usr/sbin/ntpdate ntp.fudan.edu.cn
5. 配置系统YUM源1)配置163 CentOS系统安装源
1
2
3
# cd /etc/yum.repos.d/
# mv *.repo ../
# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
2)添加cloudstack软件包的官方源
1
2
3
4
5
6
7
8
9
# vi /etc/yum.repos.d/cloudstack.repo
name=cloudstack
baseurl=http://cloudstack.apt-get.eu/rhel/4.4/
enabled=1
gpgcheck=0
# yum clean all
# yum makecache
# yum repolist
6. 安装cloudstack agent
1
# yum -y install cloudstack-agent
7. 安装KVM虚拟化环境1)要支持KVM
1
2
3
# egrep '(vmx|svm)' --color=always /proc/cpuinfo
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts xtopology tsc_reliable nonstop_tsc aperfmperf unfair_spinlock pni pclmulqdq vmx ssse3 cx16 sse4_1 sse4_2 popcnt xsave hypervisor lahf_lm arat epb xsaveopt pln pts dts tpr_shadow vnmi ept vpid
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts xtopology tsc_reliable nonstop_tsc aperfmperf unfair_spinlock pni pclmulqdq vmx ssse3 cx16 sse4_1 sse4_2 popcnt xsave hypervisor lahf_lm arat epb xsaveopt pln pts dts tpr_shadow vnmi ept vpid
2)安装KVM软件包
1
# yum -y install kvm python-virtinst libvirt tunctl bridge-utils virt-manager qemu-kvm-tools virt-viewer virt-v2v libguestfs-tools
3)配置QEMU
1
2
3
# vi /etc/libvirt/qemu.conf
# 去掉其注释
vnc_listen=0.0.0.0
4) 配置Libvirt
1
2
3
4
5
6
# vi /etc/libvirt/libvirtd.conf
listen_tls = 0
listen_tcp = 1
tcp_port = "16509"
auth_tcp = "none"
mdns_adv = 0
1
2
3
4
5
# vi /etc/sysconfig/libvirtd
取消如下行的注释:
LIBVIRTD_ARGS="--listen"
# service libvirtd restart
# chkconfig libvirtd on
5) 配置agent
1
2
3
# vi /etc/cloudstack/agent/agent.properties
# cloudstack管理服务器地址
host=192.168.10.185
6) 配置nfs域名
1
2
# vi /etc/idmapd.conf
Domain = abc.com
8. 配置桥接网络1)创建桥接网卡配置文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# cd /etc/sysconfig/network-scripts
# cp ifcfg-eth0 ifcfg-cloudbr0
# cat ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
HWADDR=00:0c:29:21:27:ea
IPADDR=192.168.10.190
PREFIX=24
GATEWAY=192.168.10.254
DNS1=202.100.192.68
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
BRIDGE=cloudbr0
1
2
3
4
5
6
7
8
9
10
11
12
13
# cat /etc/sysconfig/network-scripts/ifcfg-cloudbr0
DEVICE=cloudbr0
TYPE=Bridge
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.10.190
PREFIX=24
GATEWAY=192.168.10.254
DNS1=202.100.192.68
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
2)重启网络服务
1
# service network restart
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
# ifconfig
cloudbr0 Link encap:Ethernet HWaddr 00:0C:29:1D:8A:F0
inet addr:192.168.10.190 Bcast:192.168.10.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe1d:8af0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:60 errors:0 dropped:0 overruns:0 frame:0
TX packets:22 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4294 (4.1 KiB) TX bytes:2752 (2.6 KiB)
eth0 Link encap:Ethernet HWaddr 00:0C:29:1D:8A:F0
inet6 addr: fe80::20c:29ff:fe1d:8af0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:312744 errors:0 dropped:0 overruns:0 frame:0
TX packets:56830 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:447680883 (426.9 MiB) TX bytes:4767893 (4.5 MiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:240 (240.0 b) TX bytes:240 (240.0 b)
virbr0 Link encap:Ethernet HWaddr 52:54:00:2D:AD:E4
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
9. 初始化cloudstack-agent
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# cloudstack-setup-agent
Stopping Cloud Agent:
Starting Cloud Agent:
# cloudstack-setup-agent
Welcome to the CloudStack Agent Setup:
Please input the Management Server Hostname/IP-Address:
Please input the Zone Id:
Please input the Pod Id:
Please input the Cluster Id:
Please choose which network used to create VM:
Starting to configure your system:
Configure Cgroup ...
Configure SElinux ...
Configure Network ...
Configure Libvirt ...
Configure Firewall ...
Configure Nfs ...
Configure cloudAgent ...
CloudStack Agent setup is done!
1
2
3
# service cloudstack-agent restart
Stopping Cloud Agent:
Starting Cloud Agent:
1
2
3
# service libvirtd restart
# /etc/init.d/cloudstack-agent status
cloudstack-agent (pid 13952) is running...
排错日志查看地址:
1
2
# tail -f /var/log/cloudstack/agent/cloudstack-agent.out
2014-08-21 10:04:29,768{GMT} INFO (main:) Agent started
10. 按此配置安装node02,这里略过配置过程。
页:
[1]