Create Windows Server 2008 cluster from the command line
How to create a Windows Server 2008 cluster from the command line?
Creating a cluster in Server 2008 using the cluster.exe command follows essentially the same process as creating a cluster by using the Microsoft Management Console (MMC) Failover Cluster Management snap-in. The process essentially consists of telling the Create Cluster Wizard the nodes that will be in the cluster and then the network name and static IP address (if dynamic IP isn’t used on the NICs).
Before you attempt to create a Server 2008 cluster, you need to install the Server 2008 Failover Clustering feature. If you’re running Server Core, you’d use the following command to install failover clustering:
start /w ocsetup FailoverCluster-Core
On a full Server 2008 installation, you can install failover clustering by running this command:
servermanagercmd -install Failover-Clustering
(Of course, you can also use the MMC Server Manager snap-in to install features, but here we’re concentrating on the command line.) To create a Server 2008 cluster from the command line, run cluster.exe using the following format:
cluster /cluster: /create /nodes:" " /ipaddress: /
Here’s a cluster.exe command example and its ouput:
C:\>cluster /cluster:savdalclusfs01 /create /nodes:"savdalclus01 savdalclus02" /ipaddress:192.168.1.105/255.255.255.0
4% Initializing Cluster savdalclusfs01.
9% Validating cluster state on node savdalclus01.
13% Searching the domain for computer object savdalclusfs01
18% Verifying computer object savdalclusfs01 in the domain
22% Configuring computer object savdalclusfs01 as cluster name object
27% Validating installation of the Microsoft Failover Cluster Virtual Adapter o
n node savdalclus01.
31% Validating installation of the Cluster Disk Driver on node savdalclus01.
36% Configuring Cluster Service on node savdalclus01.
40% Validating installation of the Microsoft Failover Cluster Virtual Adapter o
n node savdalclus02.
45% Validating installation of the Cluster Disk Driver on node savdalclus02.
50% Configuring Cluster Service on node savdalclus02.
54% Starting Cluster Service on node savdalclus01.
54% Starting Cluster Service on node savdalclus02.
59% Forming cluster savdalclusfs01.
63% Adding cluster common properties to savdalclusfs01.
68% Creating resource types on cluster savdalclusfs01.
72% Creating group 'Cluster Group'.
72% Creating group 'Available Storage'.
77% Creating IP Address resource 'Cluster IP Address'.
81% Creating Network Name resource 'savdalclusfs01'.
86% Searching the domain for computer object savdalclusfs01
90% Verifying computer object savdalclusfs01 in the domain
95% Configuring computer object savdalclusfs01 as cluster name object
100% Bringing resource group 'Cluster Group' online.
When you create a cluster at the command line, disk resources are not added automatically and Node Majority will be used as the quorum mode.
How to add disk resources to a Windows Server 2008 cluster from the command line?
To add a disk resource, you must first create a resource group for the disk, then add the disk into the new resource group. As you can see in the following sample command, which creates a resource group, I've called my resource Quorum Disk (you can name the new resource whatever you want), and I've added the resource to available storage group.
C:\>cluster res "Quorum Disk" /create /group:"Available Storage" /type:"Physical Disk"
Here’s the command’s output:
Creating resource 'Quorum Disk'...
Resource Group Node Status
-------------------- -------------------- --------------- ------
Quorum Disk Available Storage savdalclus01 Offline
The next step is to add one or more disks. Before you do so, you’ll need the disk ID, which you can obtain by using the DiskPart tool, as follows:
C:\>diskpart
You’ll see the following command output and prompts to enter commands (list disk, select disk, and detail disk).
Microsoft DiskPart version 6.0.6001
Copyright (C) 1999-2007 Microsoft Corporation.
On computer: SAVDALCLUS01
DISKPART> list disk
Disk ### Status Size Free Dyn Gpt
-------- ---------- ------- ------- --- ---
Disk 0 Online 127 GB 0 B
Disk 1 Offline 512 MB 0 B
Disk 2 Offline 20 GB 0 B
DISKPART> select disk 1
Disk 1 is now the selected disk.
DISKPART> detail disk
ROCKET IMAGEFILE SCSI Disk Device
Disk ID: DB2875A4
Type : iSCSI
Bus : 0
Target : 1
LUN ID : 0
Read-only : Yes
Boot Disk : No
Pagefile Disk : No
Hibernation File Disk : No
Crashdump Disk : No
There are no volumes.
You can now add a disk by running cluster.exe and specifying either the disk’s GUID (/priv DiskIDGuid) or its signature (/priv DiskSignature), then bring it online. The previous command output shows the signature—DB2875A4—in hexadecimal (a number means that it’s the signature that’s displayed and not the GUID). You’ll need to convert the hex value to a decimal value for use in the cluster.exe command, as follows:
C:\>cluster res "Quorum Disk" /priv DiskSignature=3676861860
Now, to bring the disk online, enter this:
C:\>cluster res "Quorum Disk" /on
You’ll see this output:
Bringing resource 'Quorum Disk' online...
Resource Group Node Status
-------------------- -------------------- --------------- ------
Quorum Disk Available Storage savdalclus01 Online
The disk will now be available in the available storage area of the Microsoft Management Console (MMC) Failover Cluster Management snap-in and via the cluster res command.
How to change a Windows Server 2008 cluster quorum from the command line?
You can use the cluster.exe command to change a cluster’s quorum mode. To view the existing quorum mode for a cluster, you use the following command (in the format cluster cluster name /quorum), as follows:
C:\>cluster savdalclusfs01 /quorum
You’ll get this output:
Witness Resource Name Path Type
--------------------- --------------------------------------------------
(Node Majority)
Majority
To change the quorum mode, you add a resource for the type of quorum mode you want—for example, a file-share witness—as follows. (Both the commands you enter and their output are shown.)
C:\>cluster /cluster:savdalclusfs01 res "File Share Witness" /create /group:"Cluster Group" /type:"File Share Witness" /priv SharePath=\\savdaldc02\fsw
Creating resource 'File Share Witness'...
Resource Group Node Status
-------------------- -------------------- --------------- ------
File Share Witness Cluster Group savdalclus01 Offline
C:\>cluster /cluster:savdalclusfs01 res "File Share Witness" /online
Bringing resource 'File Share Witness' online...
Resource Group Node Status
-------------------- -------------------- --------------- ------
File Share Witness Cluster Group savdalclus01 Online
C:\>cluster savdalclusfs01 /quorum:"File Share Witness"
Witness Resource Name Path Type
--------------------- --------------------------------------------------
File Share Witness
Majority
Notice we add the file share as a resource, bring the new resource online, then tell the cluster to use that resource for the quorum. Unlike the procedure for changing the cluster quorum via the Microsoft Management Console (MMC) Failover Cluster Management snap-in, you must give the cluster computer object, and not the administrator, full control on the share. That is, for my cluster I must add account savdalclusfs01$ with full control to the share fsw on server savdaldc02.
To change quorum to a disk witness, you need to move a disk resource into the cluster group, like this:
C:\>cluster res "Quorum Disk" /move:"Cluster Group"
Moving resource 'Quorum Disk' to group 'Cluster Group'...
Resource Group Node Status
-------------------- -------------------- --------------- ------
Quorum Disk Cluster Group savdalclus01 Online
Now you need to tell the cluster to use the disk for the quorum:
C:\>cluster /quorum:"Quorum Disk"
Witness Resource Name Path Type
--------------------- -----------------------------------------------------
Quorum Disk F:\Cluster\
Majority
Note that if you add /disk to the end of the command, you tell the cluster to use disk only and not Node and Disk Majority (the normal mode).
C:\>cluster /quorum:"Quorum Disk" /disk
Quorum Resource Name Path Type
-------------------- ------------------------------ --------
Quorum Disk F:\Cluster\ No Majority--Disk
Only
You can switch to Node Majority only by running the following command:
C:\>cluster /quorum /node
Witness Resource Name Path Type
--------------------- --------------------------------------------------
(Node Majority)
Majority
How to move the default Cluster Group in Windows Server 2008?
Microsoft simplified Server 2008 clustering and removed certain features that it deemed nonessential for everyday cluster management, among them the Cluster Group. The Cluster Group should only have three resources in it: the cluster IP address, cluster name, and the witness resources; nothing else should ever be in this group, so it isn’t a feature that administrators typically use.
You can find the Cluster Group’s current location by using either the Microsoft Management Console (MMC) Failover Cluster Management snap-in or the cluster . group command); however, you can move the Cluster Group only by using the command, not the snap-in. In the following command example, I’m moving the group to the savdalclus02 node. Note that if you have only a two-node cluster, you can just use /move without a node name; in that case, the command will simply move the cluster group to the other node in the cluster. (I use the period to show that we’re modifying the local cluster.)
C:\>cluster . group "Cluster Group" /move:savdalclus02
Moving resource group 'Cluster Group'...
Group Node Status
-------------------- --------------- ------
Cluster Group savdalclus02 Online
How to create a new Windows Server 2008 cluster resource group from the command line?
You should never add any resources to the default Cluster Group. Instead, you should create resource groups that you want to use to host resources. When you add a new resource group, at minimum it needs an IP address, a network name, and an instance of a resource type (e.g., file server). Let’s create a new group and a file server resource within it. Note that I use the period (.) to show that we’re modifying the local cluster.
C:\>cluster . group "file server" /create
Creating resource group 'file server'...
Group Node Status
-------------------- --------------- ------
file server savdalclus01 Offline
C:\>cluster . res "File Server" /create /group:"file server" /type:"File Server"
Creating resource 'File Server'...
Resource Group Node Status
-------------------- -------------------- --------------- ------
File Server file server savdalclus01 Offline
You can use the cluster restype command to display a full list of resource types, as follows:
C:\>cluster restype
Listing all available resource types:
Display Name Resource Type Name
------------------------------------------------------------------------
DHCP Service DHCP Service
Distributed File System Distributed File System
Distributed Transaction Coordinator Distributed Transaction Coordinator
File Server File Server
File Share Quorum Witness File Share Witness
Generic Application Generic Application
Generic Script Generic Script
Generic Service Generic Service
IP Address IP Address
IPv6 Address IPv6 Address
IPv6 Tunnel Address IPv6 Tunnel Address
iSNSClusRes Microsoft iSNS
(Resource Type Unavailable) MSMQ
(Resource Type Unavailable) MSMQTriggers
Network Name Network Name
NFS Share NFS Share
Physical Disk Physical Disk
Print Spooler Print Spooler
Volume Shadow Copy Service Task Volume Shadow Copy Service Task
WINS Service WINS Service
Now you add the IP address and network name. Note that I created an IPv4 address, but you can also add an IPv6 address if you’re using IPv6.
C:\>cluster . res "FS IP Address" /create /group:"file server" /type:"IP Address" /priv address=192.168.1.106 subnetmask=255.255.255.0
Creating resource 'FS IP Address'...
Resource Group Node Status
-------------------- -------------------- --------------- ------
FS IP Address file server savdalclus01 Offline
C:\>cluster . res "FS Name" /create /group:"file server" /type:"Network Name" /priv name="savdalclusfsfs01" dnsname="savdalclusfsfs01"
Creating resource 'FS Name'...
Resource Group Node Status
-------------------- -------------------- --------------- ------
FS Name file server savdalclus01 Offline
Now you need to create a dependency between the IP address and the name, like this:
C:\>cluster . res "FS Name" /adddep:"FS IP Address"
Making resource 'FS Name' depend on resource 'FS IP Address'...
C:\>cluster . res "FS Name" /listdep
Listing resource dependency expression for 'FS Name':
----------------------------------------------------------------
([FS IP Address])
Listing resource dependencies for 'FS Name':
Resource Group Node Status
-------------------- -------------------- --------------- ------
FS IP Address file server savdalclus02 Online
We can now bring the resources online by using the cluster .res "resource name" /on command.
For most resource group types, you also need some shared storage to actually do anything useful. So let’s move some available storage into the new resource group:
C:\>cluster res "Data Disk" /move:"file server"
Moving resource 'Data Disk' to group 'file server'...
Resource Group Node Status
-------------------- -------------------- --------------- ------
Data Disk file server savdalclus01 Online
Now you set the network name and the storage as dependencies for the resource group to be online, like this:
C:\>cluster . res "file server" /adddep:"FS Name"
Making resource 'file server' depend on resource 'FS Name'...
C:\>cluster . res "file server" /adddep:"Data Disk"
Making resource 'file server' depend on resource 'Data Disk'...
C:\>cluster . res "file server" /listdep
Listing resource dependency expression for 'file server':
----------------------------------------------------------------
([Data Disk]) and ([FS Name])
Listing resource dependencies for 'file server':
Resource Group Node Status
-------------------- -------------------- --------------- ------
Data Disk file server savdalclus01 Online
FS Name file server savdalclus01 Online
You can bring up the resource group by using the cluster .group group name /on command. Finally, you can actually add items to the resource group as you’d do with a share using typical methods, for example
net share data=e:\data /remark:"Data Share"v
Create Windows Server 2008 cluster from the command line的更多相关文章
- Windows Server 2008 - How to Move the Quorum Disk Group
I received this question from a friend the other day - asking how on a Windows Server 2008 cluster y ...
- 基于Windows Server 2008 R2的Failover Cluster
转载一下别人的文章吧,写的不错 基于Windows Server 2008 R2的Failover Cluster(故障转移群集)部署Sql Server 2008 AA(主主) 模式群集(第一部分) ...
- Xen虚拟机磁盘镜像模板制作(二)—Windows Server 2008(2012)
在<Xen虚拟机磁盘镜像模板制作(一)—Windows Server 2008(2012)>一文中,我们已经成功制作出了Windows Server磁盘镜像.下面我们说明下如何通过它来生成 ...
- Xen虚拟机磁盘镜像模板制作(一)—Windows Server 2008(2012)
这段时间一直在研究如何制作一个适合Xen虚拟化的Windows Server 2008(2012)磁盘镜像,中间虽然遇到了一些阻挠,不过最终还是顺利解决,成功制作出了Xen Windows Serve ...
- Windows Server 2008 Workstation Converter优化设置
http://www.win2008workstation.com/windows-server-2008-workstation-converter/ If you don’t want to co ...
- 开启Windows Server 2008 R2上帝模式
TAG标签: 摘要:这个“God Mode” 应该大部分的网友都听过了,只是在 Windows Server 2008 R2 上也支持此一功能.启用方式非常简单,在桌面新建一个文件夹,命名为: God ...
- 烂泥:KVM安装Windows Server 2008 R2使用virtio硬盘
本文首发于烂泥行天下. 在上一篇文章中,我们介绍了使用IDE硬盘来安装Windows Server 2008 R2,这篇文章我们来介绍使用virtio硬盘来安装Windows Server 2008 ...
- 烂泥:KVM中安装Windows Server 2008 R2系统
本文由秀依林枫提供友情赞助,首发于烂泥行天下. 在前一篇文章中,我介绍了有关在KVM中的安装Centos系统.接下来,就来介绍如何在KVM中安装Windows系统. 注意:在此我安装的是windows ...
- 使用LVS实现负载平衡之Windows Server 2008配置
LVS是Linux Virtual Server的简写,意即Linux虚拟服务器,是一个虚拟的服务器集群系统.本项目在1998年5月由章文嵩博士成立,是中国国内最早出现的自由软件项目之一.承载于 II ...
随机推荐
- MySQL数据库 : 自关联,视图,事物,索引
自关联查询(自身id关联自身id(主键),查询的时候可以逻辑分为两个表,然后分别起一个别名来区分) select * from areas as cityinner join areas as pro ...
- 子查询,用户管理,pymysql使用
当我们的一条记录 分散不同的表中时,就需要进行多表查询例如 一对一 一对多 多对多 1.笛卡尔积查询 意思就是将两个表中的所有数据 全部关联在一起例如A表有两条 B表有三条 一共有6条会产生大量的错误 ...
- Pandas 数据结构Series:基本概念及创建
Series:"一维数组" 1. 和一维数组的区别 # Series 数据结构 # Series 是带有标签的一维数组,可以保存任何数据类型(整数,字符串,浮点数,Python对象 ...
- [Noip2016]愤怒的小鸟(状压DP)
题目描述 题意大概就是坐标系上第一象限上有N只猪,每次可以构造一条经过原点且开口向下的抛物线,抛物线可能会经过某一或某些猪,求使所有猪被至少经过一次的抛物线最少数量. 原题中还有一个特殊指令M,对于正 ...
- [KMP][BZOJ1355][Baltic2009]Radio Transmission
题面 Description 给你一个字符串,它是由某个字符串不断自我连接形成的. 但是这个字符串是不确定的,现在只想知道它的最短长度是多少. Input 第一行给出字符串的长度,\(1 < L ...
- 大话目标检测经典模型(RCNN、Fast RCNN、Faster RCNN)
目标检测是深度学习的一个重要应用,就是在图片中要将里面的物体识别出来,并标出物体的位置,一般需要经过两个步骤:1.分类,识别物体是什么 2.定位,找出物体在哪里 除了对单个物体进行检测,还要能支持 ...
- 20145202马超GDB调试汇编堆栈过程分析
20145202马超GDB调试汇编堆栈过程分析 esc :w保存,:wq保存并退出 x:删除错误的单个字母 dw:删除整个单词 gcc hello.c -o hello:运行hello.c gcc - ...
- 《Cracking the Coding Interview》——第17章:普通题——题目6
2014-04-28 22:49 题目:给定一个整数数组.如果你将其中一个子数组排序,那么整个数组都变得有序.找出所有这样子数组里最短的一个. 解法:线性时间,常数空间内可以解决,思想类似于动态规划. ...
- Python学习-django-Form组件
Django的Form主要具有一下几大功能: 生成HTML标签 验证用户数据(显示错误信息) HTML Form提交保留上次提交数据 初始化页面显示内容 小试牛刀 1.创建Form类 +? 1 2 3 ...
- Linq语法和C#6.0
一. linq 1.简介: 能用linq实现的基本都可以用扩展方法实现: 举例: 查询ID>1的狗有如下两种写法 (1)var r1=dogs.where(d=>d.id>1) ( ...