Skip to main content
1-Visitor
April 4, 2018
Question

Thingworx master select problem

  • April 4, 2018
  • 1 reply
  • 2630 views

Hi all

I know thingworx server use zookeeper to select master

 

I start two thingworx server, and after that I check the data of znode on zookeeper, as bellow

 

2018-04-04 16_55_36-192.168.1.107_MQTT Broker - SecureCRT.png

 

2018-04-04 16_55_46-192.168.1.107_MQTT Broker - SecureCRT.png

 

I'm not sure how thingworx pickup a master in such kind of architecture,for example thingworx will read to the data of znode ,and chose the larger numbers of the two node'ip part?

 

can anybody tell me the operation process, 

 

Thanks a lot.

 

 

1 reply

14-Alexandrite
April 4, 2018

Hi @Gavin2,

 

When starting up an HA environment, the first ThingWorx server to get a lock on the database is the Leader, and all others will be the Standby.  If you have a certain node you want to make sure is the Leader initially, start that one up first and wait until you see "System ownership locking complete" during the database initialization in the ApplicationLog.log.

 

Also, Zookeeper is not going to bring down a Leader that is currently operational.  If Server A is the initial Leader, goes down, Server B takes over, and then Server A is restarted, it will sit in standby until Server B goes down.

 

Regards,

Tony

 

 

 

 

 

 

Gavin21-VisitorAuthor
1-Visitor
April 8, 2018

Hi  tschmitz 

 

Thanks for your reply

 

So as you mentioned  above, I think ThingWorx use database lock to select the master .Under this circumstance, ThingWorx will use zookeeper to notify ServerB when ServerA goes down, and ServerB will use db lock again to pickup a new master. Is that right?

 

Also I want to know which table is used during master election, "system_ownership" ? 

 

Thanks again for you reply.


 

 

14-Alexandrite
May 1, 2018

Hi @Gavin2,

 

Sorry for the delayed response.  That's a good summary of what is going on.  Once ServerB has ownership of the database, it goes through the process to take over as leader.

 

system_ownership keeps track of who has/had ownership of the database.  

 

Are you thinking of configuring your own custom HA deployment?  Or just trying to get a better grasp on what's happening to see if it meets your company's business needs?

 

Regards,

Tony