CloudStack 4.4+KVM之KVM计算节点安装

CloudStack 4.4+KVM之管理服务器安装   
http://koumm.blog.51cto.com/703525/1558660

CloudStack 4.4+KVM之KVM计算节点安装    
http://koumm.blog.51cto.com/703525/1558670    
CloudStack 4.4+KVM之CloudStack配置过程    
http://koumm.blog.51cto.com/703525/1558683    
CloudStack 4.4+KVM之通过ISO文件创建CentOS虚拟机
http://koumm.blog.51cto.com/703525/1564958

CloudStack 4.4+KVM之虚拟机模板创建
http://koumm.blog.51cto.com/703525/1565551
CloudStack 4.4+KVM之虚拟机在线动态迁移
http://koumm.blog.51cto.com/703525/1565556

本文出自:http://koumm.blog.51cto.com

二、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
[cloudstack] 
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. 配置桥接网络   \\我测试时初始化cloudstack-agent时系统会自动创建桥接网卡,所以其实这步用不到

1)创建桥接网卡配置文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[root@node01 ~] # cd /etc/sysconfig/network-scripts 
[root@node01 ~] # cp ifcfg-eth0 ifcfg-cloudbr0 
[root@node01 ~] # 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
[root@node01 ~] # 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: 
[root@node01 network-scripts] # cloudstack-setup-agent 
Welcome to the CloudStack Agent Setup: 
Please input the Management Server Hostname /IP-Address :[192.168.10.185] 
Please input the Zone Id:[default] 
Please input the Pod Id:[default] 
Please input the Cluster Id:[default] 
Please choose  which  network used to create VM:[cloudbr0]  \\应该是eth0,cloudbr0是系统将要创建的
Starting to configure your system: 
Configure Cgroup ... [OK] 
Configure SElinux ... [OK] 
Configure Network ... [OK] 
Configure Libvirt ... [OK] 
Configure Firewall ... [OK] 
Configure Nfs ... [OK] 
Configure cloudAgent ... [OK] 
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...

[root@kvm01 ~]# /etc/init.d/cloudstack-agent status 
cloudstack-agent 已死,但是 subsys 被锁

我启动该服务时会提示报如上错误,但似乎不影响正常使用,所以初始化成功后没有再去理会这个问题

排错日志查看地址:   

1
2
# tail -f /var/log/cloudstack/agent/cloudstack-agent.out 
2014-08-21 10:04:29,768{GMT} INFO [cloud.agent.AgentShell] (main:) Agent started

10. 按此配置安装node02,这里略过配置过程。

本文出自 “koumm的linux技术博客” 博客,请务必保留此出处http://koumm.blog.51cto.com/703525/1558670

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值