文章
服务器与存储管理
作者:Lucia Lai
2012 年 9 月发布
简介
|
本文介绍如何充分利用 Oracle Solaris 11 中的 Automated Installer (AI) 来安装和配置 Oracle Solaris Cluster 4.0。
如果没有 AI,您将不得不在集群节点上手动安装集群组件,然后运行 scinstall 工具将节点添加到集群中。如果采用 AI,则可以将 Oracle Solaris 11 和 Oracle Solaris Cluster 4.0 软件包直接从映像包管理系统 (IPS) 信息库安装到集群节点上,而且只需最少的用户干预即可将节点引导到新的集群。
注:目前,自动安装方法只能用于配置采用 IPv4 寻址的集群节点。因此不能在节点中使用 IPv6 寻址。如果任何节点使用了 IPv6 地址,则需要使用标准(手动)IPS 安装方法,而不是本文中介绍的自动化过程。
Oracle Solaris Cluster 4.0 自动安装过程让您“无需手动操作”即可通过网络安装和配置集群。图 1 显示了自动安装过程中涉及的组件和高级操作。

图 1. 自动安装期间涉及的组件和操作
AI 安装服务器必须是与集群节点不同的单独系统,且必须与集群节点位于同一子网上。
标准集群配置工具 scinstall 位于 Oracle Solaris Cluster IPS 软件包 ha-cluster/system/install 中。您可以在指定的 AI 安装服务器上仅安装该软件包,而不必安装其他集群组软件包。
然后,开始运行 scinstall 并提供安装参数与集群配置所需的信息。安装参数描述了软件发布商、信息库来源以及要安装的集群组件。最后,scinstall 会创建一个安装服务,其中包含涉及每个集群节点的 AI 清单文件和系统配置文件。该工具还会打印一条描述每个节点 DHCP 配置、AI 安装服务器和引导文件的消息。您可以使用该信息来设置 DHCP 服务器。
scinstall 实用程序调用 installadm,后者是管理 AI 安装服务的 Oracle Solaris 命令。您可以使用 installadm 来检查 scinstall 为集群创建的安装服务,或执行进一步的定制(比如更新安装服务的清单文件)。
AI 安装服务器必须满足以下硬件要求:
AI 安装服务器必须满足以下软件要求:
netstat 命令显示网络状态,验证服务器采用的是默认路由设置。如果没有通过发现为服务器设置一个默认路由,您可以将服务器网络中的一个路由器 IP 地址填入 /etc/defaultrouter 文件,以此设置一个静态默认路由。svcs 命令查看 svc:/network/dns/multicast Oracle Solaris Service Management Facility (SMF) 服务的状态。必要时可使用 svcadm 命令来启用服务。# svcs /network/dns/multicast STATE STIME FMRI disabled 10:19:28 svc:/network/dns/multicast:default # svcadm enable /network/dns/multicast # svcs /network/dns/multicast STATE STIME FMRI online 13:28:30 svc:/network/dns/multicast:default
DHCP 服务器可以是单独的服务器,也可以和 AI 安装服务器共用一台机器。您可以用 scinstall 命令的输出(例如,每个节点的引导文件信息)来配置 DHCP 服务器。然后,当集群节点从网络引导时,DHCP 服务器配置中指定的设置可帮助集群节点找到正确的安装服务器和引导文件,进而执行安装。
本文以 Oracle Solaris 11 中的 Internet Systems Consortium (ISC) DHCP 服务器实现为例。
信息库可以是基于 HTTP 的 Internet 信息库,也可以是本地软件包信息库。
注:
/net/hosts 作为自动安装点。Oracle Solaris 11 和 Oracle Solaris Cluster 软件被发布到 IPS 软件包信息库中。每个信息库均有一个发布者。例如,solaris 是 Oracle Solaris 11 版本信息库(位于 http://pkg.oracle.com/solaris/release)的发布者。
当您执行 scinstall 时,会提示您指定发布者和信息库位置。然后会列出 Oracle Solaris Cluster 信息库中的组软件包。该信息包含在 scinstall 创建的 AI 清单文件中。
当节点从网络引导时,AI 安装程序会读取 AI 清单文件,软件包会直接从信息库服务器安装到集群节点上。
在开始安装集群之前,必须确保集群节点的硬件组件是受支持的,且正确设置了所有硬件配置(包括作为集群节点间专用互连的共享网络与网络接口)。
集群节点必须满足以下要求才可作为 AI 安装客户端:
创建 AI 安装服务并配置 DHCP 服务器后,只需通过网络引导集群节点,即可开始安装过程。安装完成后,在两次自动重新引导期间,节点会配置到集群中。
注:目前,自动安装方法只能用于配置采用 IPv4 寻址的集群节点。因此不能在节点中使用 IPv6 寻址。如果任何节点使用了 IPv6 地址,则需要使用标准(手动)IPS 安装方法,而不是本文中介绍的自动安装过程。
当您引导通过网络安装的集群节点时,会发生以下高级动作:
boot_archive 文件并加载 Oracle Solaris。要设置 AI 安装服务器,首先要配置 IPS 信息库和发布者,然后安装 Oracle Solaris Cluster 自动安装支持包 ha-cluster/system/install。
要在 AI 安装服务器上安装 ha-cluster/system/install 软件包,AI 安装服务器必须能够访问 Oracle Solaris 11 IPS 软件包信息库和 Oracle Solaris Cluster 4.0 信息库。您可以使用 http://pkg.oracle.com 上承载的 Oracle Solaris Cluster 信息库,也可使用本地软件包信息库。
要使用 http://pkg.oracle.com 上承载的 Oracle Solaris Cluster 信息库并获得要求的 SSL 公钥和私钥,请执行以下步骤。使用本地信息库的步骤在本过程后提供。
此时会显示证书页面,其中包含密钥和证书的下载按钮。
下例使用了版本信息库。-k 选项指定 SSL 密钥文件;-c 选项指定 SSL 证书文件;-g 选项以 URL 格式指定信息库的起源;ha-cluster 指定该信息库的发布者名称。
# pkg set-publisher \ -k /var/pkg/ssl/Oracle_Solaris_Cluster_4.0.key.pem \ -c /var/pkg/ssl/Oracle_Solaris_Cluster_4.0.certificate.pem \ -g https://pkg.oracle.com/ha-cluster/release/ ha-cluster
在 Oracle Solaris 11 中,可以使用与上述步骤类似的步骤设置信息库。但 Oracle Solaris 11 版本信息库不需要 SSL 密钥,而是直接通过 HTTP 访问:
# pkg set-publisher -g http://pkg.oracle.com/solaris/release solaris
要使用本地 Oracle Solaris Cluster 软件包信息库,请执行以下步骤来下载信息库映像:
# gunzip /tmp/osc4.0-repo-full.iso.gz # lofiadm -a /tmp/osc4.0-repo-full.iso /dev/lofi/1 # mount -F hsfs /dev/lofi/1 /mnt # rsync -aP /mnt/repo /export # share /export/repo
ha-cluster 发布者。此示例使用 myrepositoryserver 作为共享信息库本地副本的系统:
# pkg set-publisher -g file:///net/myrepositoryserver/export/repo ha-cluster
可使用类似步骤设置本地 Oracle Solaris 11 信息库:
# lofiadm -a /tmp/V28916-01.iso /dev/lofi/2 # mount -F hsfs /dev/lofi/2 /solaris_mnt # rsync -aP /solaris_mnt/repo /solaris_export # share /solaris_export/repo
solaris 发布者。# pkg set-publisher -g file:///net/myrepositoryserver/solaris_export/repo solaris
在 AI 安装服务器上,您需要确保为 Oracle Solaris 11 和 Oracle Solaris Cluster 4.0 信息库正确设置发布者。如果任何一个信息库的发布者未正确设置,均会导致 ha-cluster/system/install 软件包安装失败。
ha-cluster/system/install 软件包对 Oracle Solaris 自动安装工具包 install/installadm 具有依赖性。如果 install/installadm 软件包尚未安装在 AI 安装服务器上,则安装 ha-cluster/system/install 软件包将同时安装 install/installadm 软件包。
执行以下过程:
pkg list 命令检查是否已安装 ha-cluster/system/install 软件包:# pkg list ha-cluster/system/install pkg list: no packages matching 'ha-cluster/system/install' installed
在为 Oracle Solaris 和 Oracle Solaris Cluster 信息库设置了发布者的情况下,在 pkg list 命令中使用 -a 选项来检查信息库是否包含 ha-cluster/system/install 软件包。
pkg install 命令安装软件包,如清单 1 所示。
# pkg publisher
PUBLISHER TYPE STATUS URI
solaris origin online https://pkg.oracle.com/solaris/release
ha-cluster origin online https://pkg.oracle.com/ha-cluster/release
# pkg list -a ha-cluster/system/install
NAME (PUBLISHER) VERSION IFO
ha-cluster/system/install (ha-cluster) 4.0.0-0.22.1 ---
# pkg install ha-cluster/system/install
Packages to install: 2
Create boot environment: No
Create backup boot environment: No
DOWNLOAD PKGS FILES XFER (MB)
Completed 2/2 58/58 0.4/0.4
PHASE ACTIONS
Install Phase 136/136
PHASE ITEMS
Package State Update Phase 2/2
Image State Update Phase 2/2
清单 1. 安装软件包
接下来,您需要执行一些定制。
您需要在 Oracle Solaris 11 11/11 版本(是 Oracle Solaris Cluster 4.0 要求的版本)中下载自动安装程序引导映像 ISO 文件。引导映像文件中包含的二进制文件稍后在“从网络引导”过程中加载到集群节点,使安装能够继续。
# ls /export/home/*.iso /export/home/sol-11-1111-ai-x86.iso
scinstall 实用程序是设置自动集群安装和配置的工具。在使用 scinstall 实用程序之前,您需要规划集群软件的安装和配置,包括确定要安装哪些集群软件组件,设置所使用的任何名称服务中集群节点的 IP 地址。
每个集群节点的 MAC 地址用作服务器上的客户端标识符。收集 MAC 地址,准备运行 scinstall 时使用。在为每个节点设置 DHCP 配置时,您还需要指定 MAC 地址。
要定制集群安装,请执行以下步骤:
scinstall 实用程序,然后选择选项 1(从该 AI 安装服务器安装并配置集群),如清单 2 所示。
# /usr/cluster/bin/scinstall
*** Main Menu ***
Please select from one of the following (*) options:
* 1) Install and configure a cluster from this Automated Installer install server
* 2) Print release information for this Automated Installer install server
* ?) Help with menu options
* q) Quit
Option: 1
清单 2. 启动 scinstall 实用程序
>>> Custom Automated Installer Boot Image ISO File <<<
Automated Installer uses a minimal boot image to boot the client. This
boot image ISO file is required to set up the installation. You must
download this file and save it in a directory that can be accessed
from this install server. Refer to your Oracle Solaris Cluster
installation document for instructions to download this file.
Be sure to download the Automated Installer boot image and not the
live CD image or the text install image. Download the SPARC Automated
Installer boot image for SPARC nodes, or download the x86 Automated
Installer boot image for x86 nodes. This file must be the same version
as the Oracle Solaris OS release that you plan to install on the
cluster nodes.
What is the full path name of the AI boot image ISO file? /export/home/sol-11-1111-ai-x86.iso
清单 3. 指定 ISO 文件的位置
>>> Custom Automated Installer User root <<<
After the automated installation is complete, you will need "root"
user authorization to access to the cluster nodes. A password is
required for the "root" account.
Password for root:
Re-type password to confirm:
>>> Custom Automated Installer Repositories <<<
The Oracle Solaris and Oracle Solaris Cluster packages are published
into IPS package repositories, and the packages in the latest release
are installed directly from the repositories to the cluster nodes.
Refer to Oracle Solaris and Oracle Solaris Cluster documentation for
the locations of the repositories.
You can also create a local package repository rather than using a
Internet http based package repository, and make the repository
accessible to the cluster nodes and this install server with autofs
mount point in directory /net/<host>. Refer to Oracle Solaris
installation documentation for creating local package repository.
What is the publisher for Oracle Solaris [solaris]?
What is the repository of publisher "solaris"? http://pkg.oracle.com/solaris/release
Accessing the repository ...done
What is the publisher for Oracle Solaris Cluster [ha-cluster]?
What is the repository of publisher "ha-cluster"? /net/myrepositoryserver/export/repo
清单 4. 指定发布者和信息库信息
此时将列出指定信息库中可用的集群软件组件。
ha-cluster-full 软件包,如清单 5 所示:
Select the Oracle Cluster components that you want to install:
Package Description
1) ha-cluster-framework-minimal Oracle Solaris Cluster Framework minimal group package
2) ha-cluster-framework-full Oracle Solaris Cluster Framework full group package
3) ha-cluster-data-services-full Oracle Solaris Cluster Data Services full group package
4) ha-cluster-geo-full Oracle Solaris Cluster Geographic Edition full group package
5) All All above components
Option(s): 5
清单 5. 选择要安装的组件
接着,您将需要选择模式(典型或自定义),利用该模式指定各种集群配置。在“典型”模式中,某些集群配置值设定为默认值,而在“自定义”模式中,您可对值进行自定义。
无论哪种模式,都需要指定以下集群配置参数:
您可以使用 dladm 命令来查询已安装适配器的 MAC 地址:
# dladm show-phys -m net0 LINK SLOT ADDRESS INUSE CLIENT net0 primary 0:14:4f:7e:57:9a yes net0
netX。当您使用 AI 方法来安装和配置集群时,可为传输适配器指定虚适配器名称和非虚适配器名称(例如 e1000g1)。如果指定了非虚传输适配器名称,则集群配置服务会在将节点添加到集群时将它们自动转换为虚名。在“典型”模式中,除上述配置项(要求用户输入)外,所有其他集群配置参数将设置为表 1 中的默认值。要指定非默认设置,需要选择“自定义”模式。
表 1. 配置值| 集群配置 | 默认值(“典型”模式) | 可以指定的其他值的示例(“自定义”模式) |
|---|---|---|
| 添加节点验证 | sys | des |
| 私有网络数目 | 2 | 1 |
| 传输交换机名称 | switch1、switch2 | 任何字符串 |
| 专用网络地址 | 172.16.0.0 | |
| 专用网络掩码 | 255.255.240.0 | |
| 最大节点数 | 64 | 2 ~ 64 |
| 最大专用网络数 | 10 | 2 ~ 128 |
| 最大虚拟集群数 | 12 | 任何数目 |
| 全局屏障 | 开 | 关 |
>>> Typical or Custom Mode <<<
This tool supports two modes of operation, Typical mode and Custom
mode. For most clusters, you can use Typical mode. However, you might
need to select the Custom mode option if not all of the Typical mode
defaults can be applied to your cluster.
For more information about the differences between Typical and Custom
modes, select the Help option from the menu.
Please select from one of the following options:
1) Typical
2) Custom
?) Help
q) Return to the Main Menu
Option [1]:
清单 6. 指定模式
当您回答完所有问题后,scinstall 将所有规格传输到各节点的命令行选项并请求确认,如清单 7 中所示。请参阅 scinstall(1M) 手册页面,了解命令行选项的更多信息。
>>> Confirmation <<<
Your responses indicate the following options to scinstall:
-----------------------------------------
For node "phys-schost-1",
scinstall -c /export/home/sol-11-1111-ai-x86.iso -h phys-schost-1 \
-C clusterA \
-F \
-G lofi \
-W solaris=http://pkg.oracle.com/solaris/release::entire,server_install:::
ha-cluster=/net/myrepositoryserver/export/repo::ha-cluster-framework-minimal,ha-cluster-framework-full,
ha-cluster-data-services-full,ha-cluster-geo-full \
-n ip=192.168.100.98/24,mac=0:14:4f:1:dd:c0 \
-T node=phys-schost-1,node=phys-schost-2,authtype=sys \
-w netaddr=172.16.0.0,netmask=255.255.240.0,maxnodes=64,maxprivatenets=10,numvirtualclusters=12 \
-A trtype=dlpi,name=net1 -A trtype=dlpi,name=bge1 \
-B type=switch,name=switch1 -B type=switch,name=switch2 \
-m endpoint=:net1,endpoint=switch1 \
-m endpoint=:bge1,endpoint=switch2 \
-P task=quorum,state=INIT \
-U /var/cluster/run/scinstall/scinstall.pwd.1866
Are these the options you want to use (yes/no) [yes]?
-----------------------------------------
For node "phys-schost-2",
scinstall -c /export/home/sol-11-1111-ai-x86.iso -h phys-schost-2 \
-C clusterA \
-N phys-schost-1 \
-G lofi \
-W solaris=http://pkg.oracle.com/solaris/release::entire,server_install:::
ha-cluster=/net/myrepositoryserver/export/repo::ha-cluster-framework-minimal,ha-cluster-framework-full,
ha-cluster-data-services-full,ha-cluster-geo-full \
-n ip=192.168.100.99/24,mac=0:14:4f:1:da:fc \
-A trtype=dlpi,name=e1000g1 -A trtype=dlpi,name=net3 \
-m endpoint=:e1000g1,endpoint=switch1 \
-m endpoint=:net3,endpoint=switch2 \
-U /var/cluster/run/scinstall/scinstall.pwd.1866
Are these the options you want to use (yes/no) [yes]?
清单 7. 确认选项
在 scinstall 执行结束时,会显示需要在 DHCP 服务器上创建的 DHCP 定义的清单。SPARC 与 x86 的 DHCP 定义稍有不同。
清单 8 显示的是 x86 节点上的输入:
Do you want to continue with Automated Installer set up (yes/no) [yes]?
Creating Automated Installer install service clusterA-sol-11-1111-ai-x86 ... done
Creating client to install service for node "phys-schost-1" ... done
Adding Automated Installer manifest to install service for node "phys-schost-1" ... done
Creating Automated Installer system configuration profile for node "phys-schost-1" ... done
Before you boot node "phys-schost-1" to install from the network, you must
register the node with a DHCP server using 0100144F01DDC0 as the
client ID, and create DHCP macro for this node with definition
":BootSrvA=192.168.100.1:BootFile=0100144F01DDC0:".
Creating client to install service for node "phys-schost-2" ... done
Adding Automated Installer manifest to install service for node "phys-schost-2" ... done
Creating Automated Installer system configuration profile for node "phys-schost-2" ... done
Before you boot node "phys-schost-2" to install from the network, you must
register the node with a DHCP server using 0100144F01DAFC as the
client ID, and create DHCP macro for this node with definition
":=192.168.100.1:BootFile=0100144F01DAFC:".
清单 8. x86 节点的输出
清单 9 显示的是 SPARC 节点上的输入:
Do you want to continue with Automated Installer set up (yes/no) [yes]?
Creating Automated Installer install service clusterB-sol-11-1111-ai-sparc ... done
Creating client to install service for node "phys-schost-3" ... done
Adding Automated Installer manifest to install service for node "phys-schost-3" ... done
Creating Automated Installer system configuration profile for node "phys-schost-3" ... done
Before you boot node "phys-schost-3" to install from the network, you must
register the node with a DHCP server using 0100144F025030 as the
client ID, and create DHCP macro for this node with definition ":Boot-
SrvA=192.168.100.1:BootFile=http://192.168.100.1:5555/cgi-bin/wan-
boot-cgi:".
清单 9. SPARC 节点的输出
每个集群都会拥有一个 AI 安装服务。安装服务名称的格式为 clustername-ISOfilename,还包含 .iso 扩展名。
您可以使用 installadm 命令列出安装服务,以及与每个客户端服务相关的 AI 清单文件和系统配置文件,如清单 10 所示:
# installadm list -n clusterA-sol-11-1111-ai-x86 -c -p -m
Service Name Client Address Arch Image Path
------------ -------------- ---- ----------
clusterA-sol-11-1111-ai-x86 00:14:4F:01:DA:FC i386 /rpool/ai/target/clusterA-sol-11-1111-ai-x86
00:14:4F:01:DD:C0 i386 /rpool/ai/target/clusterA-sol-11-1111-ai-x86
Manifest Status Criteria
-------- ------ --------
phys-schost-1_manifest mac = 00:14:4F:01:DD:C0
phys-schost-2_manifest mac = 00:14:4F:01:DA:FC
orig_default Default None
Profile Criteria
------- --------
phys-schost-1_profile mac = 00:14:4F:01:DD:C0
phys-schost-2_profile mac = 00:14:4F:01:DA:FC
清单 10. 列出与服务、清单文件和配置文件相关的信息
在通过运行 scinstall 为每个客户端创建的 AI 清单文件中,定义了各种安装参数,包括 IPS 软件包信息库和要安装的软件包。在 AI 安装服务器上,各清单文件的位置为 /var/cluster/logs/install/autoscinstall.d/clustername/nodename/nodename_aimanifest.xml。通过更新这些文件,您可以进一步的定制,以便安装额外的软件。必须先完成这些更新,才能开始在集群节点上进行网络安装。
如 AI 清单文件示例(清单 11)中的 software 元素所示,自动安装过程会安装 entire 和 server_install 这两个 Oracle Solaris 软件包。entire 软件包是一个合并的软件包,该软件包在指定的 Oracle Solaris 软件包组版本上设置约束。软件包 server_install 适用于 AI 安装。
<software name="ips" type="IPS">
<source>
<publisher name="solaris">
<origin name="http://pkg.oracle.com/solaris/release/"/>
</publisher>
<publisher name="ha-cluster">
<origin name="file:///net/myrepositoryserver/repos/i386/Sol_11"/>
</publisher>
</source>
<software_data>
<name>entire</name>
<name>server_install</name>
<name>ha-cluster-data-services-full</name>
<name>ha-cluster-framework-full</name>
<name>ha-cluster-framework-minimal</name>
<name>ha-cluster-geo-full</name>
<name>ha-cluster-full</name>
</software_data>
</software>
清单 11. 清单文件示例
您可以手动更新该 AI 清单文件,以包含 Oracle Solaris entire 合并软件包中不包含的其他软件包。此类软件包可以是 Oracle Solaris 版本中的额外组件,或其他信息库中以 IPS 格式提供的第三方软件,在这种情况下,还需要将该信息库的发布者添加为新的发布者元素。
还可以更新集群软件包,但在任何情况下,都需要遵守以下限制条件:
solaris 和 ha-cluster 发布者。entire 和 server_install 软件包,因为它为自动安装定义了所需的软件包。ha-cluster 组软件包。清单 12 是使用 XML 元素 source 和 software_data 添加新信息库和软件包的示例。
<software name="ips" type="IPS">
<source>
<publisher name="solaris">
<origin name="http://pkg.oracle.com/solaris/release/"/>
</publisher>
<publisher name="ha-cluster">
<origin name="file:///net/myrepositoryserver/repos/i386/Sol_11"/>
</publisher>
<publisher name="my-ips">
<origin name="file:///net/my-ips-repository/"/>
</publisher>
</source>
<software_data>
<name>entire</name>
<name>server_install</name>
<name>ha-cluster-data-services-full</name>
<name>ha-cluster-framework-full</name>
<name>my-ips-group-package</name>
</software_data>
</software>
清单 12. 添加新信息库和软件包
更新 AI 清单文件后,使用 installadm 命令替换与安装服务相关联的旧 AI 清单文件。如果需要,您可以使用 installadm list 命令列出服务名称和清单名称(如清单 10 所示)。
# installadm update-manifest \ -n clusterA-sol-11-1111-ai-x86 \ -f /var/cluster/logs/install/autoscinstall.d/clusterA/phys-schost-1/phys-schost-1_aimanifest.xml \ -m phys-schost-1_manifest
自动安装要求您为 DHCP 环境中的客户端配置和安装服务器与引导文件。通过 DHCP 服务器,您可以对客户端进行配置,使其从网络自动引导并从网络获取信息。DHCP 服务器存储关于客户端网络配置的信息、安装服务器的 IP 地址以及执行客户端网络安装的引导文件。
在您通过网络引导客户端之前,您需要在 DHCP 服务器上创建安装定义,以配置 DHCP 服务器。
Internet Systems Consortium (ISC) DHCP 服务器已添加到 Oracle Solaris 11,但是它可能不会自动安装,如果是这样,就需要手动安装。
如果您需要手动安装,则在 DHCP 服务器上通过 Oracle Solaris 11 信息库设置 solaris 发布者,并按照如下步骤安装软件包:
# pkg publisher PUBLISHER TYPE STATUS URI solaris origin online https://pkg.oracle.com/solaris/release # pkg install install service/network/dhcp/isc-dhcp
安装软件包后,创建 /etc/dhcp/dhcpd4.conf(针对 DHCPv4)文件。该文件是包含一系列语句的 ASCII 文本文件,这些语句指定了 ISC DHCP 服务器后台程序 dhcpd 的配置信息。
# No IP forwarding option ip-forwarding false; # The default time in seconds to lease IP to clients default-lease-time 600; # Maximum allowed time in seconds to lease IP to clients max-lease-time 86400; # # Domain name and name servers to distribute to clients that # is common to all supported networks. # option domain-name "oracle.com"; option domain-name-servers 192.168.0.1; # Make this DHCP server the official DHCP server for all the configured local networks. authoritative;
清单 13. 全局参数
subnet 声明,告知 dhcpd 如何识别子网上的地址。
#
# Declare subnet with the netmask to use, the IP range for clients, broadcast
# address to use, and the router to use
#
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.2 192.168.0.100;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.0.255;
option routers 192.168.0.1;
}
清单 14. 子网声明
集群节点必须被配置为具有静态 IP 地址的客户端。此客户端必须在 dhcpd 配置文件中使用 host 声明来定义每个节点的固定地址,并通过 hardware 参数将每个节点的 Ethernet MAC 地址用作标识符。
您可以将集群节点的语句分组,以指定由多个节点共享的语句,如清单 15 所示。
# x86 node declaration for its MAC identifier, static IP, and boot file. The install
server statement applies to all the nodes in this group.
group {
next-server 192.168.100.1;
host phys-schost-1 {
hardware ethernet 00:14:4F:01:DD:C0;
fixed-address 192.168.100.98;
filename "0100144F01DDC0";
}
host phys-schost-2 {
hardware ethernet 00:14:4F:01:DA:FC;
fixed-address 192.168.100.99;
filename "0100144F01DAFC";
}
}
# A SPARC node declaration.
host phys-schost-2 {
hardware ethernet 00:14:4F:01:DA:FC;
fixed-address 192.168.100.97;
filename "http://192.168.100.1:5555/cgi-bin/wanboot-cgi";
}
清单 15. 将集群节点的语句分组
对于 x86 节点,使用 next-server 语句(如清单 15 所示)来指定 AI 安装服务器的 IP 地址。scinstall 输出中显示 BootSrvA 值表明了 AI 安装服务器的 IP 地址,如下所示。通过 filename 语句指定引导文件,scinstall 输出中的 BootFile 值表明了所使用的引导文件。
Before you boot node "phys-schost-1" to install from the network, you must register the node with a DHCP server using 0100144F01DDC0 as the client ID, and create DHCP macro for this node with definition ":BootSrvA=192.168.100.1:BootFile=0100144F01DDC0:".
对于 x86 节点,引导文件的名称格式为 01 加上节点的 MAC 地址(删除了连字符或冒号分隔符),该文件名可以将安装服务器与为所有集群节点创建的安装服务联系到一起。
# cd /etc/netboot # ls -l 0100144F01DDC0 lrwxrwxrwx 1 root root 47 Nov 19 08:48 0100144F01DDC0 -> ./clusterA- sol-11-1111-ai-x86/boot/grub/pxegrub
对于 SPARC 节点,使用 filename 语句(如清单 15 所示)在 scinstall 输出中显示 BootFile 对象,如下所示。BootFile 值包含安装服务器的 IP 地址,因此不需要 next-server 语句。
Before you boot node "phys-schost-3" to install from the network, you must register the node with a DHCP server using 0100144F025030 as the client ID, and create DHCP macro for this node with definition ":BootSrvA=192.168.100.1:BootFile=http://192.168.100.1:5555/cgi-bin/wanboot-cgi:"
在创建 dhcpd 配置文件后,通过启用 DHCP 服务来启动 dhcpd 服务器,如下所示。network/dhcp/server:ipv4 服务提供来自 IPv4 客户端的 DHCP 和 BOOTP 请求,network/dhcp/relay:ipv4 服务通过 DHCP 服务器将 IPv4 客户端的 DHCP 和 BOOTP 请求中继到网络上。
# svcadm enable svc:/network/dhcp/server:ipv4 # svcadm enable svc:/network/dhcp/relay:ipv4
无论何时更改 dhcpd 配置文件,都应刷新并重启服务来使用新更新的数据:
# svcadm refresh svc:/network/dhcp/server:ipv4 # svcadm refresh svc:/network/dhcp/relay:ipv4
配置了 AI 安装服务器和 DHCP 服务器后,就可以着手从网络安装集群节点了。安装完成后,节点会通过自动引导加入到集群中。
ok boot net:dhcp - install
对于 x86 集群节点,可以使用以下方法之一从网络进行引导,以启动安装过程:
当集群节点启动时,GRUB 菜单会显示两个菜单项,类似于以下清单:
Oracle Solaris 11 11/11 Text Installer and command line Oracle Solaris 11 11/11 Automated Install
Automated Install 项,然后按 Return。默认情况下,选择 Text Installer 项。如果在 20 秒内未选择 Automated Install,会采用默认的交互文本安装程序方法继续进行安装,而不会安装并配置 Oracle Solaris 集群软件。
当所有节点完成重新引导时,集群安装和配置过程就完成了。
svcs 命令检查是否有任何集群 SMF 服务处于维护模式。svc:/system/cluster/sc-ai-config:default 服务仅有一次处于 online 状态。在经过一次 online 状态后,它会自动禁用。
cluster status 等命令来检查总体集群状态,如清单 16 所示。
# svcs -x
# svcs svc:/system/cluster/sc-ai-config:default
STATE STIME FMRI
disabled Nov_19 svc:/system/cluster/sc-ai-config:default
# /usr/cluster/bin/cluster status
=== Cluster Nodes ===
--- Node Status ---
Node Name Status
-------------- -------
phys-schost-1 Online
phys-schost-2 Online
=== Cluster Transport Paths ===
Endpoint1 Endpoint2 Status
------------ ------------ -------
phys-schost-1:net3 phys-schost-2:net3 Path online
phys-schost-1:net1 phys-schost-2:net1 Path online
=== Cluster Quorum ===
--- Quorum Votes Summary from (latest node reconfiguration) ---
Needed Present Possible
--------- --------- ----------
2 3 3
--- Quorum Votes by Node (current status) ---
Node Name Present Possible Status
-------------- -------- --------- -------
phys-schost-1 1 1 Online
phys-schost-2 1 1 Online
--- Quorum Votes by Device (current status) ---
Device Name Present Possible Status
----------- --------- ---------- -------
d1 1 1 Online
=== Cluster Device Groups ===
--- Device Group Status ---
Device Group Name Primary Secondary Status
----------------- --------- ---------- -------
--- Spare, Inactive, and In Transition Nodes ---
Device Group Name Spare Nodes Inactive Nodes In Transition Nodes
----------------- ----------- -------------- --------------------
--- Multi-owner Device Group Status ---
Device Group Name Node Name Status
------------------ ----------- --------
=== Cluster Resource Groups ===
Group Name Node Name Suspended State
------------- --------- ------------ ------
=== Cluster Resources ===
Resource Name Node Name State Status Message
------------- ---------- ------ ------------------
=== Cluster DID Devices ===
Device Instance Node Status
--------------- ------- -------
/dev/did/rdsk/d1 phys-schost-1 Ok
phys-schost-2 Ok
/dev/did/rdsk/d2 phys-schost-1 Ok
phys-schost-2 Ok
/dev/did/rdsk/d3 phys-schost-1 Ok
/dev/did/rdsk/d4 phys-schost-1 Ok
/dev/did/rdsk/d5 phys-schost-2 Ok
/dev/did/rdsk/d6 phys-schost-2 Ok
=== Zone Clusters ===
--- Zone Cluster Status ---
Name Node Name Zone HostName Status Zone Status
------ ---------- --------------- ------- --------------
清单 16. 检查集群状态
使用该自动安装方法进行初始集群设置。其他集群对象(包括设备组、存储、集群文件系统、区域集群以及支持各种数据服务的资源和资源组)不会自动创建,您可以完成初始集群设置后随时配置它们。
开始自动安装后,进度消息会打印到控制台和每个节点上的日志文件。日志文件包含更多详细信息。
在安装期间,您可通过 root 身份使用 solaris 口令登录到某个节点,查看 /system/volatile/install_log 日志文件,了解安装进度。请注意,该 root 帐户包含在 AI 映像中,与安装后创建的 root 不同。您还要注意,只有在 IPS 软件包开始安装一段时间后,该日志文件才能通过安装程序进行更新。
节点首次引导后,安装日志文件会变成 /var/log/install/install_log。
指定安装的 AI 清单位于 /var/log/install/ai.xml。当节点从网络引导时,该文件会从 AI 安装服务器下载到集群节点。
通过 SMF 服务 svc:/system/cluster/sc-ai-config:default 将节点添加到集群中。该服务为节点配置静态 IP 地址,并调用 scinstall 将节点添加到集群。安装日志的位置为 /var/cluster/logs/install/scinstall.log.*。
系统日志文件 /var/adm/messages 也包含与安装和集群配置相关的消息。
scinstall(1M) 手册页面:http://docs.oracle.com/cd/E23623_01/html/E23628/scinstall-1m.html#scrolltocLucia Lai 是 Oracle Solaris Cluster 小组的一名软件开发人员。她的职责包括但不限于 Oracle Solaris Cluster 系统管理(包括安装和配置、升级和命令行命令)。
| 修订版 1.0,2012 年 9 月 6 日 |