Setup Clustering via database settings. Message non-master JSS

edgardeveij
New Contributor II

I'm trying to automate the setup of a multiple instance and clustered environment as far as possible.

So far I manage to offer tomcat a modified .war file with edited JSS settings for database, logging, and caching. At the database server side, creation of database and granting rights is automated. This works and at first startup and weblogin I'm greeted with the enter a serial page. So far so good.

But somehow I'm not able to define clustering. I copied clustering info from a working instance and recreate these tables in the new one (tables limited_access_mode_settings, jss_cluster_settings, jss_cluster_nodes).

Upon first startup I get this message on the master: "This is a non-master JSS web application. Upgrade your master web application before upgrading the non-master web applications." It's as if the clustering settings aren't correct or not complete.

Am I missing a SQL table or a tomcat instance setting somewhere?

13 REPLIES 13

kerouak
Valued Contributor

Here you go:
Clearly Mysql commands...

USE 'dbname';

UPDATE jss_settings SET clustered = 0;

You will then be able to access πŸ™‚

G'Luck!

edgardeveij
New Contributor II

Thanks, but that’s not what I want to achieve.

I want to prep a vanilla setup into a clustered mode without the need to logging into the jss. This by creating the necessary database tables in advance. These tables I take from a test setup, and recreate them in a new empty database.

I don’t see what disabling clustered mode helps with this?

kerouak
Valued Contributor

I was replying to this statement
Upon first startup I get this message on the master: "This is a non-master JSS web application. Upgrade your master web application before upgrading the non-master web applications."

edgardeveij
New Contributor II

Hi Rob,

Yeah, you’re right on that part. I’ve tried that solution as well initially, but before a jss has run the database doesn’t contain the tables needed so that didn’t work. So I reconstruct those tables beforehand but that doesn’t seen to work. Maybe I’m missing another table or something.

Thanks anyway Rob!

kerouak
Valued Contributor

So i had the same 2 days ago. I restored a db from our live jss and unexpectedly had the error..

May help others without your related issue.. all the best!!

marklamont
Contributor III
I want to prep a vanilla setup into a clustered mode without the need to logging into the jss.

I don't get the issue, as long as you have already switched on clustering and selected a master all subsequent installs join straight into the cluster if you've filled in the db details correctly.

edgardeveij
New Contributor II

For arguments sake let's say I host 20 different JSS environments in a clustered setup with a master tomcat server, backup tomcat server, and three public tomcat servers behind a load balancer. I don't want to repeat steps 20 or more times if I can catch those settings and play them back beforehand. It would prevent misconfiguration, ensures repeatable outcome and makes setting things up a matter of minutes. For a single site this effort wouldn't make sense, I agree.

So, after database creation I create and fill the three tables (tables limited_access_mode_settings, jss_cluster_settings, jss_cluster_nodes) which enable and config the cluster setup. But somehow I'm missing a last bit somehow.

I just want to know what else is involved in the proces. I haven't catched the last bit of magic that has is done when you set clustering in the GUI.

bradtchapman
Valued Contributor

You're trying to puppet/chef the setup, aren't you? What I mean by this is that you'd like some kind of scripted process that installs Tomcat, MySQL, etc., and populates the databases. Is that right?

edgardeveij
New Contributor II

Yeah, sort of scripted setup and maintenance.

bradtchapman
Valued Contributor

Good luck. I don't know if anyone has written anything designed for rapid deployment of test environments, as it's not something this community does all the time.

Have you enabled ALL debug logs in an attempt to capture the database writes? There's three debug logs: Jamf Debug, ArtemisMQ, and SQL transactions. They're all enabled from the "your.jss.com/logging.html" page. And all three need to be enabled on each JSS node that you want to watch. The other thing I would suggest is enable system logging on the first JSS before enabling clustering. With all that logging going on, you should be able to catch the specific setting(s) you're after.

edgardeveij
New Contributor II

Aha, good pointers Brad! Very good indeed. I'll see what I can find there. Thank you!

Yesterday, I thought of making two mysql exports, one before and one after clustering. And then diffing for the changes. I found three tables just by glancing over the database, but maybe there's more. Oh well, enough ways to tinker.

Luckily, setting things up from scratch is a matter of minutes LOL.

wburnett
New Contributor II

Hi Edgar, I'm trying to do much the same thing. I've automated most of my setup for a fresh instance of jamf, but where I'm now stuck is trying to turn clustering on from terminal. Did you have any luck in getting this to work?

loceee
Contributor

I have been working on ansible roles to handle the lifecycle of jamf infra.

This works for me -- replace the jinja variable you need to and import into your database.

## create the jss_cluster_nodes table
CREATE TABLE IF NOT EXISTS jss_cluster_nodes (address varchar(63) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', is_master tinyint(1) NOT NULL DEFAULT '0', last_check_in_epoch bigint(32) NOT NULL DEFAULT '0') ENGINE=INNODB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

## empty the jss_cluster_nodes table
TRUNCATE jss_cluster_nodes;

## create the jss_cluster_settings table
CREATE TABLE IF NOT EXISTS jss_cluster_settings (clustered tinyint(1) NOT NULL DEFAULT '0', cluster_monitor_frequency int(11) NOT NULL DEFAULT '60') ENGINE=INNODB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

## empty the jss_cluster_settings table
TRUNCATE jss_cluster_settings;

## enable clustering
INSERT INTO jss_cluster_settings (clustered, cluster_monitor_frequency) VALUES (1,60);

## configure the master Jamf Pro node
INSERT INTO jss_cluster_nodes set address = '{{ jss_master_host }}', is_master = 1;