Configuration: Windows Clustering on Windows Server 2012
Windows Clustering feature is only available in the Enterprise Edition.
In order to ensure RavenDB high availability you can run it on a failover cluster.
- Windows Server 2012 R2
- Failover Clustering feature added
- Storage Area Network (SAN) configured
Configuring RavenDB service
Execute the following steps on every cluster node:
- If RavenDB isn't installed as a service, follow this link in order to do it
- Stop RavenDB service by executing the following command on the command line: Raven.Server.exe /stop
- In the Raven.Server.exe.config file set up Raven/DataDir to the SAN
Note: A failover cluster will take care of working RavenDB. If the failure takes place on one of the cluster nodes, then a failover cluster will start RavenDB service immediately. So it's important that RavenDB instance on every node should use the same data directory placed on the SAN.
Creating failover cluster
- Go to Server Manager -> Tools -> Failover Cluster Manager
- Select Create a cluster option from context menu
- Go through the wizard
- Add cluster nodes
- Name a cluster and assign IP address for it
- Confirm and unselect 'Add all eligible storage to the cluster'
- Wait for cluster creation
- Finish operation
Adding RavenDB as a Generic Service resource
- Right click on Roles of newly created cluster and choose Configure Role... option from context menu
- Go through the High Availability Wizard
- Choose Generic Service
- Select RavenDB service
- Type the cluster service name and assign the IP address under which RavenDB will be available
- RavenDB has been already configured on every node to keep data in SAN, so no storage is needed here. Click Next
- Click Next
- Summary screen. Click Finish
Windows Authentication usage
In a clustered environment a host can have more than one name associated. That can cause problems for Kerberos. If you are going to use Windows Authentication then use static IP addresses and add a DNS A record for RavenDB.
- After click on Roles in a cluster tree you will see RavenDB service information
- General options
- Failover options
- General options
- Right click on RavenDB resource and choose Simulate failure of this resource
- During failover the resource has been moved to a different node and is in pending mode
- Failover succeeded