Part of the reason for my experimentation with deployment techniques has to do with figuring out how to manage and deploy a cluster of Microsoft Office SharePoint Server 2007 servers. Since MOSS contains Excel Services, which are great for financial services scenarios, I want to be able to deploy and provision a large number of servers very quickly.
Using WDS (as noted in my other post) is REALLY fast for deploying a base server image. But what to do about SharePoint? Well, what I did in this case was simply start setup for MOSS on my base image without completing configuration. I then captured that back as my basic node image and am deploying that to my compute nodes now. But once these nodes are deployed you'll still need to finish configuration of MOSS on them. This cannot be done prior to deployment as the sysprep process removes all the needed account information.
So, there are steps to configuring MOSS on your cluster, post setup:
1) Join the nodes the MOSS farm
2) initialize the various services on the farm.
I was able to solve this problem with some scripting, sort of.
To join my nodes to the farm from the command line, I need to use the following command:
psconfig.exe -cmd configdb -connect -server databaseservername -database SharePoint_Config -user domain\user -password password
The username and password are those of the service account you specified when you went through setup on the first server.
Then once that command has run you'll need to run the following command to enumerate the services on the farm and start them up on each compute node.
psconfig.exe -cmd services -provision
I was able to get the individual nodes to execute both commands from a remote server in 2 ways:
1) Using the Job Scheduler, I queued up each command in turn on the nodes waited for them to execute before starting the second job. To make things easy for myself, when filling out the task section I used a UNC pointing back to a share on my head node. this way I didn't need to worry about pushing code to the compute nodes or reimaging them
2) Using these commands here, I wrote some CSHarp code in a Process Class to do the same thing and used psexec from Sysinternals to run thise code on the nodes as well.
Here's the code I used. As always, this is provided AS SAMPLE CODE ONLY and carries no warranties. Please code responsibly
using System;
using System.Diagnostics;
using System.ComponentModel;
namespace MyProcessSample
{
class MyProcess
{
// These are the Win32 error code for file not found or access denied.
const int ERROR_FILE_NOT_FOUND = 2;
const int ERROR_ACCESS_DENIED = 5;
const int ERROR_NETWORK_BUSY = 53;
const int ERROR_NETWORK_ACCESS_DENIED = 65;
void ClusterJoin()
{
Process myProcess = new Process();
try
{
myProcess.StartInfo.FileName = "C:\\program files\\common files\\microsoft shared\\web server extensions\\12\\bin\\psconfig.exe";
myProcess.StartInfo.Arguments = "-cmd configdb -connect -server hpc-admin -database SharePoint_Config -user hpc\\mosssvc -password !H0lyCr0ss";
myProcess.StartInfo.Verb = "Open";
myProcess.StartInfo.CreateNoWindow = true;
myProcess.Start();
}
catch (Win32Exception e)
{
if (e.NativeErrorCode == ERROR_FILE_NOT_FOUND)
{
Console.WriteLine(e.Message + ". Check the path.");
}
else if (e.NativeErrorCode == ERROR_ACCESS_DENIED)
{
Console.WriteLine(e.Message +
". You do not have permission to open this file.");
}
else if (e.NativeErrorCode == ERROR_NETWORK_BUSY)
{
Console.WriteLine(e.Message +
". The Network Is Busy or The Network Share Was Not Found!.");
}
else if (e.NativeErrorCode == ERROR_NETWORK_ACCESS_DENIED)
{
Console.WriteLine(e.Message +
". You do not have permission to open this file across the network.");
}
}
}
public static void Main()
{
MyProcess myProcess = new MyProcess();
myProcess.ClusterJoin();
}
}
}
I am interested to know how anyone else remotely executes code on a machine for which you have permissions over.
- John
-------------------------
This response is provided for informational purposes only, is provided “AS IS” and does not obligate AMD to provide any of the services, technology, or programs described.
Edited: 09/04/2007 at 05:23 PM by john.mccrae-at-amddotcom