Overview

The purpose of this blog is to provide a detailed information on setting up 2 XenMobile Device Manager (8.7) instances and configuring them in cluster mode with MSSQL 2012 DB. This includes step by step instructions with screenshots to configure XDM nodes and adding a LB VIP in NetScaler.

For this activity, I have taken the following:

  1. 2 Instances of Windows 2012 R2 VMs
  2. XDM 8.7 executable files with license and APNS certs
  3. 1 Instance of MSSQL 2012 VM
  4. 1 Instance of NetScaler VM

Step by step guidance

There are four sections involved in this blog, which are :

  1. Installation of XDM – Node 1
  2. Configuration Changes in XDM – Node 1
  3. Install XDM – Node 2
  4. Configure LB VIP in NS for XDM Cluster

Follow the below steps in sequence if you are configuring the XDM from the basics.

Section 1. Installation of XDM Node 1

Since this is the first XDM instance that we are installing – as part of clustering, we will call it as Node 1.

Step 1: Within XenCenter / VMware ESXi spin a new VM of  Windows 2012 server

Step 2: After initial configuration, enable remote login and then remotely login to the Windows 2012 server

Step 3: Locate the folder where the XDM executable files are located and start the XDM installation

Step 4: Click on Next

Step 5: Click on  “I Agree” when prompted with Citrix License Agreement

Step 6:  In the Choose Components section, uncheck “Database Server” and click on Next

Note: The reason being, we will connect this server to MSSQL server

Step 7:  Click Install

Step 8:  Select the XDM license

Step 9:  Export the XDM license and click Next

Step 10:  Enter the SQL server details

  • Select Database Driver as “SQL Server JTDS”
  • Specify the Authentication Type as Windows Auth or SQL Server Auth, based on how you have configured the SQL server
  • Provide the IP address / hostname of MSSQL
  • Provide username / password
Click on “Check the Connection” button to establish the connection with the credentials provided.

Step 11:  Click on “Create” button to create the ZDM database in the MSSQL 2012 server

Step 12:  You will get a success message once the ZDM DB is created

Step 13:  Continue with the installation by clicking Next

Note: Crystal Reports box is left blank.

Step 14:  Click ‘Next’ button for the next 4 screens where it asks for confirmation

Step 15:  Enter the keystore password twice and click on Next

Step 16:  Enter the following:

  • Password – two times
  • FQDN name of the XDM server
and click Next

Step 17:  Provide the APNS certificate

Step 18:  Click Next to confirm the ports

Step 19:  Enter the Administrator name with which you want to access XDM server

Step 20:  Click Finish

Step 21:  This completes the XDM installation

Step 22: Open a browser and check if you are able to login to XDM

Step 23: Stop the XDM service on this Windows server where XDM Node 1 is installed. You can stop the XDM service either from Windows Home Screen or from Services, as shown below.

Section 2. Configuration Changes in XDM – Node 1

Modify Server.xml

1. On cluster node 1, use a text editor (wordpad or notepad) to open the server.xml file in the \tomcat\conf\ directory of the installation.

2. Locate the following element in the file.

<Engine name=”Catalina” defaultHost=”localhost”>

3. Add a below cluster section after the above line (you can press Enter Key to make some space).

<Cluster className=”org.apache.catalina.ha.tcp.SimpleTcpCluster”>
<Manager className=”org.apache.catalina.ha.session.DeltaManager”
expireSessionsOnShutdown=”false”
notifyListenersOnReplication=”true”/>
<Channel className=”org.apache.catalina.tribes.group.GroupChannel”>
<Membership className=”org.apache.catalina.tribes.membership.McastService”
address=”228.0.0.8″
port=”45560″
frequency=”500″
dropTime=”3000″/>
<Receiver className=”org.apache.catalina.tribes.transport.nio.NioReceiver”
address=”auto”
port=”4000″
autoBind=”100″
selectorTimeout=”5000″
minThreads=”3″
maxThreads=”6″/>
<Sender className=”org.apache.catalina.tribes.transport.ReplicationTransmitter”>
<Transport className=”org.apache.catalina.tribes.transport.nio.PooledParallelSender”/>
</Sender>
<Interceptor className=”org.apache.catalina.tribes.group.interceptors.TcpFailureDetector”/>
<Interceptor className=”org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor”/>
</Channel>
<!–
<Deployer className=”org.apache.catalina.ha.deploy.FarmWarDeployer”
tempDir=”${catalina.base}/war-temp”
deployDir=”${catalina.base}/war-deploy”
watchDir=”${catalina.base}/war-listen”
watchEnabled=”true”/>
–>
</Cluster>

Once copied, save the file. Your file will look like below:

Modify ew-config.properties

Use a text editor (wordpad or notepad) to open the ew-config.properties file located at  \tomcat\webapps\zdm\WEB-INF\classes\ directory of the installation and complete the following steps on cluster node 1.

  1. Locate the following line in the file and set the value to true.

cluster.everywan.enabled=false

  1. Immediately below, add the following line.

cluster.hibernate.cache-provider=com.opensymphony.oscache.hibernate.OSCacheProvider

Your cluster configuration should now read:

cluster.everywan.enabled=true

cluster.hibernate.cache-provider=com.opensymphony.oscache.hibernate.OSCacheProvider

  1. Verify that the appropriate property for your database exists in the DAO configuration. Add the property if it is missing.
    • For Microsoft SQL Server databases:

dao.configLocation=classpath:com/sparus/nps/dao/hibernate-native.cfg.xml

    • For MySQL databases:

dao.configLocation=classpath:com/sparus/nps/dao/hibernate-mysql-hilo.cfg.xml

    • For all other databases:

dao.configLocation=classpath:com/sparus/nps/dao/hibernate-hilo.cfg.xml

  1. Add the following lines to the ew-config.properties file, under Other Properties (at the end)

# Everywan cluster shared secret for application connection

everywan.secret=everywan

 # Everywan node name (used on load balancer front end)

cluster.everywan.nodeName=nodex

 # Everywan direct IP access (ex. used by remote support)

cluster.everywan.directAccess=auto

 # Everywan broadcast

cluster.everywan.broadcast.address=228.0.0.8

cluster.everywan.broadcast.port=45561

Set the value of the cluster.everywan.broadcast.address parameter to 228.0.0.8 and the cluster.everywan.broadcast.port parameter to 45561.

Note:

A. Ensure that this combination of UDP broadcast address and port, that is 228.0.0.8:45561, is different from that used by Apache Tomcat in the server.xml file, if at all you are changing the address.

B. cluster.everywan.directAccess= “auto” (search for the first IP address of the first network interface). If you want to assign a specific IP address, use : “ip:192.168.1.251”.

Modify oscache.properties

Use a text editor to open the oscache.properties file in the \tomcat\webapps\zdm\WEB-INF\classes\ directory of the installation.

Locate the following lines in the configuration.

 cache.cluster.properties=UDP(mcast_addr=228.0.0.8;mcast_port=45566;

diagnostics_addr=228.0.0.8;diagnostics_port=45567;mcast_send_buf_size=150000;

mcast_recv_buf_size=80000)…

cache.cluster.multicast.ip=228.0.0.8

Ensure that the value of the mcast_addr parameter is set to 228.0.0.8 and the mcast_port parameter is set to 45566. Verify that the value of thediagnostics_addr parameter is set to 228.0.0.8 and the diagnostics_port parameter is set to 45567. These four parameters are used to check the Hibernate cache consistency among the cluster nodes and must have the same values on all the nodes.

Check that the value of the cache.cluster.multicast.ip parameter is set to 228.0.0.8. This IP address must be the same as that for the mcast_addr parameter.

Verification in applicationContext.xml

  1. Use a text editor to open the applicationContext.xml file in the \tomcat\webapps\zdm\WEB-INF\ directory of the installation.
  2. Verify that the following element is present in the file.

<import resource=”classpath:cluster_configuration.xml” />

Section 3: Installation of XDM – Node 2

Once the XDM installation on Node 1 is completed and required changes are done, start the installation on Node 2, as given below:

Step 1 – Step 9: Follow the same steps as mentioned above to install XDM on Node 2

Step 10: Enter the SQL server details

  • Select Database Driver as “SQL Server JTDS”
  • Specify the Authentication Type as Windows Auth or SQL Server Auth, based on how you have configured
  • Provide the IP address / hostname of MSSQL  (The same IP that you have entered in Node 1)
  • Provide username / password
  • Make sure the “Database Name” is same as given in the Node 1.

Click on “Check the Connection” button to establish the connection with the credentials provided.

Step 11: You will get a success message once connected to the ZDM DB

Step 12: At this point go to Windows server where XDM Node 1 is installed. Copy the files mentioned below from ‘ XDM Cluster Node 1’. In Node 1, navigate to c:\Program Files (x86)\Citrix\XenMobile Device Manager\tomcat\conf

•        https.p12

•        pki-ca-devices.p12

•        pki-ca-root.p12

•        pki-ca-servers.p12

•        pki-ca-root.crt.pem

Copy the above files into the same location in XDM Node 2 (overwrite if prompted):

c:\Program Files (x86)\Citrix\XenMobile Device Manager\tomcat\conf

Note : Make sure you back-up the files before replacing them in Node 2.

Step 13: Continue with the installation by clicking Next

Step 14: Click Next for the next 4 screens

Step 15: Enter the password once and click on Next (Same password that you have entered while configuring Node 1)

Note: Continue clicking ‘Next’ for the 3 screens that follow

Step 16: Enter the Password and the FQDN will be auto-populated.

Step 17: Provide the APNS certificate

Step 18: Click Next to confirm the ports

Step 19: At the Administrator credential screen, you need not do anything because it takes from the certificate keystore that we copied from Node 1.

Step 20: Click Finish to complete the XDM integration

Step 21: Open a browser and check if you are able to login to XDM

Step 22: Stop the XDM service on this Windows server where XDM Node 2 is installed (Same steps as given for Node 1)

After stopping the XDM services in Node 2, you need to modify the clustering files as done for Node 1, given in this blog under the section:

Configuration Changes in XDM – Node 1

  • Modify Server.xml
  • Modify ew-config.properties
  • Modify oscache.properties
  • Verify in applicationContext.xm

Along with the above, back up the following files:

  • cacerts.pem
  • cacerts.pem.jks
  • certchain.pem
  • https.crt.pem
  • https.p12.pem

Copy and overwrite the files from ‘Cluster node 1’ <installation_dir>\tomcat\conf to ‘Cluster Node 2’ <installation_dir>\tomcat\conf.

Now, two nodes of XDM clustering is done. You can configure a third Cluster Node as well by following the same steps as of Cluster Node 2.

To verify if the cluster is successful, check the cluster info by logging into helper.jsp:

https://<IP/HostName>/zdm/helper.jsp

The Cluster Setup, would like below

Cluster with 2 nodes:

Cluster setup with 3 nodes:

Section 4: Configure LB VIP in NS for XDM Cluster

To configure the LB VIP for XDM cluster in NetScaler, follow the steps given below.

Step 1: Login to NetScaler Management Portal

Step 2: Navigate to XenMobile Wizard , under Mobility section

Note: If Load Balancing is not enabled, make sure you enable it by right clicking on it.

Step 3: Enter the Host Name and Virtual IP address with which you want to access the XDM cluster. Make sure this is resolvable by having a DNS entry.

Step 4: Once the Host entry and VIP is provided, enter the XDM server cluster nodes

Step 5: Once the first node is added, click on the “Create New Service” button to add another cluster node.

Step 6: Once all the nodes added, click on Done to save the changes and done to exit the screen

Step 7: After the cluster nodes are configured and binding is done to LB VIP, you can view them under:

Configuration -> Traffic Management -> Load Balancing -> Virtual Servers

Step 8: Once the LB VIP is configured, you can access the cluster via LB VIP or the host name give (provided DNS is added in DNS server for this VIP)

Important Points:

  1. The configurations in the files have to be done in each cluster node
  2. When making changes to configuration files, make sure the XDM service is stopped.
  3. Once first cluster node is installed, copy the specified files from node 1 on to other nodes.
  4. Make sure the FQDN is same across all the nodes.
  5. When you need to open Helper.jsp, you need to first login to the browser with XDM admin and then open another tab to open Helper.jsp. That is, in-order for you to access Helper.jsp page, you need to be logged into the XDM as administrator first.