Exemplo n.º 1
0
        protected override bool RunIndividualCheck(IAmClusterNode node)
        {
            base.InstanceIdentity = node.Name.NetbiosName;
            AmNodeState state = node.GetState(false);

            if (state == AmNodeState.Paused)
            {
                base.FailContinue(Strings.DagMemberPausedFailed(node.Name.NetbiosName, this.m_dag.Name));
                return(false);
            }
            return(true);
        }
Exemplo n.º 2
0
        protected override bool RunIndividualCheck(IAmClusterNode node)
        {
            base.InstanceIdentity = node.Name.NetbiosName;
            AmNodeState state = node.GetState(false);

            if ((state == AmNodeState.Down || state == AmNodeState.Joining || state == AmNodeState.Unknown) && !base.IsNodeStopped(node.Name))
            {
                base.FailContinue(Strings.DagMemberUpCheckFailed(node.Name.NetbiosName, this.m_dag.Name));
                return(false);
            }
            return(true);
        }
Exemplo n.º 3
0
        private void CheckClusterStateForDagServerRemoval()
        {
            this.m_output.AppendLogMessage("CheckClusterStateForDagServerRemoval entered. m_removeNode={0}, m_destroyCluster={1}", new object[]
            {
                this.m_removeNode,
                this.m_destroyCluster
            });
            try
            {
                this.m_clusDag = AmCluster.OpenDagClus(this.m_dag);
            }
            catch (AmClusterException ex)
            {
                this.m_output.AppendLogMessage("Trying to open the cluster on the servers in the DAG '{0}' failed with exception {1}", new object[]
                {
                    this.m_dagName,
                    ex
                });
                this.m_output.WriteErrorSimple(new DagTaskRemoveDagServerMustHaveQuorumException(this.m_dagName));
            }
            using (DumpClusterTopology dumpClusterTopology = new DumpClusterTopology(this.m_clusDag, this.m_output))
            {
                dumpClusterTopology.Dump();
            }
            this.m_output.AppendLogMessage("Trying to open the node on the cluster.", new object[0]);
            IAmClusterNode amClusterNode = null;

            try
            {
                amClusterNode = this.m_clusDag.OpenNode(this.m_mailboxAmServerName);
            }
            catch (ClusterException ex2)
            {
                this.m_output.AppendLogMessage("OpenNode threw an exception. It's probably because the server is no longer clustered. Proceeding with -configurationonly.", new object[0]);
                this.m_output.AppendLogMessage("For the records, the exception was {0}.", new object[]
                {
                    ex2
                });
                this.m_configurationOnly   = true;
                this.m_mailboxServerIsDown = true;
                return;
            }
            using (amClusterNode)
            {
                AmNodeState state = amClusterNode.GetState(false);
                this.m_output.AppendLogMessage("Node.GetState( {0} ) reports that it is {1}.", new object[]
                {
                    this.m_mailboxAmServerName,
                    state
                });
                if (!AmClusterNode.IsNodeUp(state))
                {
                    this.m_mailboxServerIsDown = true;
                }
            }
            if (!this.m_skipDagValidation)
            {
                try
                {
                    DagTaskHelper.ValidateDagClusterMembership(this.m_output, this.m_dag, this.m_clusDag, this.m_mailboxAmServerName);
                }
                catch (ClusterException ex3)
                {
                    this.DagTrace("ValidateDagClusterMembership() for the mailbox server failed possibly with error {0}, ex = {1}. This is OK.", new object[]
                    {
                        LocalizedException.GenerateErrorCode(ex3.InnerException).ToString(),
                        ex3.Message
                    });
                }
            }
            int num = this.m_clusDag.EnumerateNodeNames().Count <AmServerName>();

            this.DagTrace(string.Format("There are {0} nodes in the cluster.", num), new object[0]);
            if (num == 1)
            {
                this.m_destroyCluster = true;
            }
            else
            {
                this.m_removeNode = true;
            }
            bool destroyCluster = this.m_destroyCluster;

            this.ReopenClusterIfNecessary();
            if ((this.m_removeNode || this.m_destroyCluster) && this.m_dag.DatacenterActivationMode != DatacenterActivationModeOption.Off)
            {
                DagTaskHelper.CheckDagCanBeActivatedInDatacenter(this.m_output, this.m_dag, (ADObjectId)this.m_mailboxServer.Identity, (ITopologyConfigurationSession)base.DataSession);
            }
            this.DagTrace("CheckClusterStateForDagServerRemoval left. m_removeNode={0}, m_destroyCluster={1}.", new object[]
            {
                this.m_removeNode,
                this.m_destroyCluster
            });
        }
Exemplo n.º 4
0
 public ClusterNode(IAmClusterNode clusNode)
 {
     this.Name         = clusNode.Name;
     this.ClusterState = clusNode.GetState(false);
 }