Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1728412
  • 博文数量: 163
  • 博客积分: 10591
  • 博客等级: 上将
  • 技术积分: 1980
  • 用 户 组: 普通用户
  • 注册时间: 2006-08-08 18:17
文章分类

全部博文(163)

文章存档

2018年(1)

2012年(1)

2011年(47)

2010年(58)

2009年(21)

2008年(35)

分类: LINUX

2010-03-19 10:24:12

nimbus client进行安装部署

 

[root@wang135 opt]# pwd

/opt

[root@wang135 opt]# ./jdk-1_5_0_17-linux-amd64.bin

[root@wang136 opt]# vi /etc/profile                         在文件末添加环境变量

PATH=/opt/jdk1.5.0_17/bin:/opt/jdk1.5.0_17/jre/bin:$PATH

JAVA_HOME=/opt/jdk1.5.0_17

CLASSPATH=/opt/jdk1.5.0_17/lib:/opt/jdk1.5.0_17/jre/lib

export PATH

export JAVA_HOME

export CLASSPATH

 

[root@wang135 opt]# source /etc/profile                      生效环境变量

 

[root@wang135 opt]# java –version                                               验证

java version "1.5.0_17"

Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_17-b04)

Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_17-b04, mixed mode)

 

[root@wang135 opt]# useradd nimbus                        创建nimbus用户

[root@wang135 opt]# passwd nimbus

 

[root@wang135 opt]# cp nimbus-cloud-client-011.tar.gz /home/nimbus/    拷贝软件并赋权限

[root@wang135 opt]# chown -R nimbus:nimbus /home/nimbus/nimbus-cloud-client-011.tar.gz

 

切换到nimbus登陆的终端:

[nimbus@wang135 ~]$ tar zxvf nimbus-cloud-client-011.tar.gz

 

执行下面这行

[nimbus@wang135 ~]$ . /home/nimbus/nimbus-cloud-client-011/lib/this-globus-environment.sh

 

并将下面内容添加入/home/nimbus/.bash_profile

export X509_CERT_DIR=/home/nimbus/nimbus-cloud-client-011/lib/certs

export GLOBUS_LOCATION=/home/nimbus/nimbus-cloud-client-011/lib/globus

echo "I am .bash_profile"

cd /home/nimbus/nimbus-cloud-client-011/lib/

. ./this-globus-environment.sh

cd ~

 

[nimbus@wang135 ~]$ scp nimbus@wang136.hrwang.com:/etc/grid-security/certificates/*.0 /home/nimbus/nimbus-cloud-client-011/lib/certs/

The authenticity of host 'wang136.hrwang.com (172.20.86.136)' can't be established.

RSA key fingerprint is 16:c0:83:94:55:b9:fe:b9:ad:dd:c2:c8:a7:22:c6:48.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added 'wang136.hrwang.com,172.20.86.136' (RSA) to the list of known hosts.

nimbus@wang136.hrwang.com's password:

2f982487.0                                       100%  936     0.9KB/s   00:00 

 

[nimbus@wang135 ~]$ pwd

/home/nimbus

[nimbus@wang135 ~]$ mkdir .globus

[nimbus@wang135 ~]$ scp nimbus@wang136.hrwang.com:/home/nimbus/.globus/* /home/nimbus/.globus/

nimbus@wang136.hrwang.com's password:

usercert.pem                                       100% 2726     2.7KB/s   00:00    

usercert_request.pem                                100% 1439     1.4KB/s   00:00   

userkey.pem                                       100%  963     0.9KB/s   00:00

 

[nimbus@wang135 ~]$ grid-proxy-init -verify –debug

Files used:

  proxy     : /tmp/x509up_u500

  user key  : /home/nimbus/.globus/userkey.pem

  user cert : /home/nimbus/.globus/usercert.pem

Your identity: O=Grid,OU=GlobusTest,OU=simpleCA-wang136.hrwang.com,OU=hrwang.com,CN=Hongrui Wang

Enter GRID pass phrase for this identity:      

Using 512 bits for private key

Creating proxy, please wait...

Proxy verify OK

Saving proxy to: /tmp/x509up_u500

Your proxy is valid until Wed May 27 10:36:50 CST 2009

 

更改配置文件

[nimbus@wang135 ~]$ vi /home/nimbus/nimbus-cloud-client-011/conf/cloud.properties

###########################################################################

# Path to SSH public key to log in with.

#

# If left blank or deleted, the client will proceed calling the service

# without an SSH just-in-time configuration request.  You can override

# using the --ssh-pubkey flag.

###########################################################################

 

ssh.pubkey=~/.ssh/id_rsa.pub

 

 

###########################################################################

# Path to SSH known_hosts file

#

# If a remote host's SSH public key is made available, the presence of

# this configuration signals the cloud client to replace the corresponding

# IP and/or hostname entry in the SSH known_hosts file.

#

# Only used when you invoke --cluster and use contextualization

#

# You can disable this behavior by leaving blank or deleting.

###########################################################################

 

ssh.hostsfile=~/.ssh/known_hosts

 

 

###########################################################################

# Host+port of Virtal Workspace Service (not the URL)

###########################################################################

 

vws.factory=wang136.hrwang.com:8443

 

 

###########################################################################

# Host+port of image repository (not the URL)

###########################################################################

 

vws.repository=wang136.hrwang.com:2811

 

 

###########################################################################

# Virtal Workspace Service identity, to verify we are talking to the

# right machine.

###########################################################################

 

vws.factory.identity=/O=Grid/OU=GlobusTest/OU=simpleCA-wang136.hrwang.com/CN=host/wang136.hrwang.com

 

 

###########################################################################

# Image repository identity, to verify we are talking to the right machine.

###########################################################################

 

vws.repository.identity=/O=Grid/OU=GlobusTest/OU=simpleCA-wang136.hrwang.com/CN=host/wang136.hrwang.com

vws.memory.request=700         

 

1:添加vws.memory.request=700这行,作用是启动虚机时,虚机要求的内存大小

 

2:上面配置文件当中的主机identity,可以到相应的主机下面运行”grid-cert-info  -file /etc/grid-security/hostcert.pem –subject”命令获取。上面的identity,我就是到wang136.hrwang.com主机上以globus用户运行得到的。

 

 

 

[nimbus@wang135 nimbus-cloud-client-011]$ ./bin/cloud-client.sh --hash-print "/O=Grid/OU=GlobusTest/OU=simpleCA-wang136.hrwang.com/OU=hrwang.com/CN=Hongrui Wang"

d9383407                                   这个数字要在创建云目录时使用

 

 

 

 

 

 

 

VMM进行安装部署

 

[root@cloud opt]# ./jdk-1_5_0_17-linux-i586.bin

[root@cloud opt]# vi /etc/profile                         在文件末添加环境变量

PATH=/opt/jdk1.5.0_17/bin:/opt/jdk1.5.0_17/jre/bin:$PATH

JAVA_HOME=/opt/jdk1.5.0_17

CLASSPATH=/opt/jdk1.5.0_17/lib:/opt/jdk1.5.0_17/jre/lib

export PATH

export JAVA_HOME

export CLASSPATH

[root@cloud opt]# source /etc/profile                      生效环境变量

[root@cloud opt]# java –version                          验证

java version "1.5.0_17"

Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_17-b04)

Java HotSpot(TM) Server VM (build 1.5.0_17-b04, mixed mode)

.安装配置nimbus-control

 

[root@cloud opt]# tar zxvf ebtables-v2.0.8-2.tar.gz              安装ebtables

[root@cloud opt]# cd ebtables-v2.0.8-2/

[root@cloud ebtables-v2.0.8-2]# make

[root@cloud ebtables-v2.0.8-2]# make install            

 

 

1  suse10.2上出现如下错误:

install -m 0755 -o root -g root ebtables /usr/local/sbin/ebtables

install -m 0755 -o root -g root ebtables-restore /usr/local/sbin/ebtables-restore

cat ebtables-save | sed 's/__EXEC_PATH__/\/usr\/local\/sbin/g' > ebtables-save_

install -m 0755 -o root -g root ebtables-save_ /usr/local/sbin/ebtables-save

cat ebtables.sysv | sed 's/__EXEC_PATH__/\/usr\/local\/sbin/g' | sed 's/__SYSCONFIG__/\/etc\/sysconfig/g' > ebtables.sysv_

install -m 0755 -o root -g root ebtables.sysv_ /etc/rc.d/init.d/ebtables

install: cannot create regular file `/etc/rc.d/init.d/ebtables': No such file or directory

make: *** [scripts] Error 1

 

 

[root@cloud ebtables-v2.0.8-2]# useradd globus        

[root@cloud ebtables-v2.0.8-2]# passwd globus

 

[root@cloud opt]# tar zxvf nimbus-controls-TP2.2.tar.gz

[root@cloud opt]# mkdir workspace

[root@cloud opt]# cd nimbus-controls-TP2.2/workspace-control/

[root@cloud workspace-control]# cp worksp.conf.example /opt/workspace/worksp.conf

[root@cloud workspace-control]# python install.py -c /opt/workspace/worksp.conf -a globus -g globus -n

[root@cloud workspace-control]# cp dhcpd.conf.example /etc/dhcpd.conf

 

[root@cloud workspace-control]# visudo          添加如下内容:

globus ALL=(root) NOPASSWD: /opt/workspace/bin/mount-alter.sh

globus ALL=(root) NOPASSWD: /opt/workspace/bin/dhcp-config.sh

globus ALL=(root) NOPASSWD: /usr/sbin/xm

globus ALL=(root) NOPASSWD: /usr/sbin/xend

并且把所有带有requiretty的行都注释掉

#defaults requiretty

 

 

 

 

[root@cloud workspace]# brctl show                                                        查看网桥

bridge name     bridge id               STP enabled     interfaces

virbr0          8000.000000000000       yes

xenbr0          8000.feffffffffff       no                peth0

                                                     vif0.0

 

[root@cloud workspace-control]#vi /opt/workspace/worksp.conf        调整worksp.conf文件

guestkernels: %(localdir)s/vmlinuz-2.6.18-53.el5xen

association_0: private1; xenbr0; vif0.0 ; none; 192.168.1.0/24

 

 

1:将/boot下的vmlinuz-2.6.18-53.el5xen拷贝到/opt/workspace/images目录下。

2: 将文件中的networking部分的内容改为如上。因为我们要在VMM节点上启动dhcp服务,要指定dhcp监听在哪个网桥的哪个接口上。通过brctl show,我们看到xenbr0为网桥,vif0.0domon0在网桥上的接口。具体的判断方法可以google学习。最后的字段我们制定了dhcp将要分发的ip地址段。

 

[root@cloud workspace]#cp /opt/nimbus-controls-TP2.2/workspace-control/dhcpd.conf.example /etc/dhcpd.conf

[root@cloud workspace]# vi /etc/dhcpd.conf                   调整dhcp配置文件

subnet 192.168.1.0 netmask 255.255.255.0 {

#     range  192.168.1.2         192.168.1.200;                 这行不需要

}

 

 

[root@cloud workspace]# ifconfig eth0:0 192.168.1.1 netmask 255.255.255.0    配置网络接口

 

[root@cloud workspace]# service dhcpd start                       启动dhcpd服务

 

 

. 创建半虚拟化镜像

 

用于半虚拟化安装NFS

 

[root@cloud ~]# mkdir -p /export/rhel5

[root@cloud ~]# vi /etc/exports

/export/rhel5           *(ro)

 

[root@cloud ~]# service nfs start

Starting NFS services:                                     [  OK  ]

Starting NFS quotas:                                       [  OK  ]

Starting NFS daemon:                                       [  OK  ]

Starting NFS mountd:                                       [  OK  ]

 

[root@cloud ~]# showmount -e localhost

Export list for localhost:

/export/rhel5  *

 

[root@cloud ~]# vi /etc/yum.repos.d/centos5.repo       配置RHEL5.2使用centos的源

[base]

name=CentOS-5 - Base

#mirrorlist=

 

repo=os

#baseurl=

 

baseurl=

gpgcheck=1

gpgkey=

 

#released updates

 

[update]

name=CentOS-5 - Updates

#mirrorlist=

 

baseurl=

gpgcheck=1

gpgkey=

 

#packages used/produced in the build but not released

 

[addons]

name=CentOS-5 - Addons

#mirrorlist=

 

 

baseurl=

gpgcheck=1

gpgkey=

 

#additional packages that may be useful

 

[extras]

name=CentOS-5 - Extras

#mirrorlist=

 

 

baseurl=

gpgcheck=1

gpgkey=

 

#additional packages that extend functionality of existing packages

 

[centosplus]

name=CentOS-5 - Plus

#mirrorlist=

 

baseurl=

gpgcheck=1

enabled=0

gpgkey=

 

#contrib - packages by Centos Users

 

[contrib]

name=CentOS-5 - Contrib

#mirrorlist=

 

baseurl=

gpgcheck=1

enabled=0

gpgkey=

 

[root@cloud iso]# pwd

/iso

[root@cloud iso]# mount -o loop RHEL5-U2-I386.iso /media/

[root@cloud iso]# cp -a /media/* /export/rhel5/

[root@cloud iso]# yum install createrepo

[root@cloud iso]#cd /export/rhel5

 

半虚拟化安装rhel5.2

 [root@cloud /]# mkdir /images

[root@cloud /]# dd if=/dev/zero of=/images/cloud1.img bs=1M count=5000

 

[root@cloud /]# virt-install -n hrwang-rhel5 -r 512 -f /images/cloud1.img --nographics -l nfs:172.20.86.169:/export/rhel5

 

注:也许是因为dhcp分配的ip地址是192.168.1网段的,所以启动起来找不到nfs共享的磁盘,我将nfs服务器重新指向192.168.1.1就可以继续安装了。

下图为安装指南

 

阅读(1709) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~