A while back, you may recall that we published a blog about GeoSync when it was still a fairly new feature within the Ivanti User Workspace Manager (UWM) Suite.
In case you didn’t see it, here is the link Since we published that blog, GeoSync has certainly improved and, when implemented correctly, can do a great job keeping the Personalization database synchronized between multiple datacenters.
The challenge with GeoSync is in getting it set up “correctly”… and no, unfortunately it’s not always as simple as following the instructions. For many customers, the out-of-the-box configuration settings within GeoSync don’t get the job done.
Before we get into that, let me address another challenge you might encounter when setting up GeoSync. The “ConfigureGeoSync.ps1” PowerShell script included with the UWM install does a great job enabling GeoSync for you when all of your Subscribers are built and ready to be synchronized.
But… what happens when you need to set up Subscriber#1 today but cannot add Subscriber#2 until next week? Well, the “ConfigureGeoSync.ps1” script isn’t going to help you ADD a subscriber and, in fact, will complain that the Publisher already exists and will exit on you.
I’m a little surprised that Ivanti didn’t just add a second script to deal with adding Subscribers, but it turns out to be rather easy once I dug through the GeoSync PowerShell cmdlets.
Here’s the procedure for adding a Subscriber to an EM environment that already has one Publisher and one Subscriber:
- Go to a Personalization Server that is connected to the PUBLISHER database, log in and run PowerShell as an Administrator.
- Type “Import-Module AppSenseInstances” and press enter.
3. Type “get-ApsInstance” and press enter.
- Copy the InstanceID from the output for Personalization Server (usually the lower one).
- Type “Import-ApsInstanceModule -InstanceId <paste in the id you just copied>” then press Enter.
5. Now your Personalization Server Instance is loaded so you can start the commands to add a GeoSync Subscriber.
- Type “Add-EMPSSubscriber” and press enter.
- You will be prompted to enter the SubscriberServer. (This is the database server you’d like to add to GeoSync). (UWM03 in the screen shot below)
- Next will be the database name on the Subscriber database server. This is whatever name you created for the Personalization DB when you did the install. In this case, we are using the default “PersonalizationServer”.
- When you press enter, you may be prompted for credentials. This will need to be an account that has at least dbowner permissions on the Personalization DB.
- The PublisherServer is now requested. (SQL01 in the screen shot below)
- Finally, the PublisherDatabase name is needed. “PersonalizationServer” in this case.
- Press Enter.
- Now let’s check to see if the new Subscriber is there.
- Type Get-EMPSSubscribers and press enter.
- Enter the PublisherServer (in this case SQL01) and press enter.
- Enter the PublisherDatabase (in this case PersonalizationServer) and press enter.
- You should now see the new Subscriber listed.
- Open the EM Console on the Publisher server.
- Go to Manage > GeoSync
- You should see the new Subscriber now in the window as “Unassigned”. You should now be able to assign the new Subscriber to a Personalization Group and set a Sync schedule.
Not a terribly painful process, but certainly more complex than using the PS1 script.
Here’s where we get back to the “tuning” needed to make GeoSync work for some customers. If the bandwidth between the Publisher and the Subscribers is robust and the network latency is nice and low, the out-of-box configuration may be fine for you.
When conditions are not optimal between the databases, you may run into a recurring problem where Synchronization Status will show as “Synchronization Incomplete”.
When this problem rears up, it usually seems to stem from the timeout values within the “BackgroundService.config” (typically located in C:\Program Files\AppSense\Environment Manager\Personalization Server\BackgroundService).
If you are getting incomplete synchronizations, one of the first thing Ivanti Support tries is to double some of the values in that “BackgroundService.config” file. Here are the ones you’ll need to modify (should be line 162 to 172 in the file):
<add key=”GeoSyncAgentRetryCount” value=”4” />
<!– Wait before retrying deadlock –>
<add key=”GeoSyncAgentRetryWaitMs” value=”600” />
<!– Wait before retrying non-deadlock –>
<add key=”GeoSyncAgentNonDeadlockRetryWaitMs” value=”10000” />
<!– Execution timeout for geo sql commands –>
<add key=”GeoSyncAgentDefaultCommandTimeoutSecs” value=”180” />
<!– Reconnect tries after connection lost–>
<add key=”GeoSyncAgentReconnectTries” value=”6” />
<!– Delay before attempting reconnect –>
<add key=”GeoSyncAgentReconnectDelayMs” value=”10000” />
Once you’ve finished modifying the file with the new values, you will need to restart the Ivanti Background Service on the UWM Server to get the changes into use.
Next step is to force a sync and see what happens. Go back to your EM Console (on a Publisher) and go to Manage > GeoSync. Then click the little ellipsis on the right of one of the Subscribers and select Synchronize.
If after some time, you get “Synchronization Complete”, there’s a good chance you’ve got it working. You’ll want to check each Subscriber to make sure the settings worked for all of them.
If you still get “Synchronization Incomplete” for any of your Subscribers, you can try increasing the values even more. There is also another modification you can try (again a modification of the “BackgroundService.config” file).
This change is detailed by Ivanti here: https://forums.ivanti.com/s/article/Fine-Tuning-a-GeoSync-job-for-optimal-running
Bonus tip: Sometimes, when you have a new, Uninitialized Subscriber, you may get a failure on that initial Synchronization. Try doing a “Configuration-only synchronization” first and THEN doing a full Synchronization and see if that solves the problem.
Ivanti Practice Lead
Critical Design Associates