Broker Startup Failure: UUID Already Set

Symptom

You try to start a broker on a new host with the result that the broker fails to peer into the domain. The failure message might be Failed to set ServerStateUUID ... UUID was already set.

Cause

This message indicates that you are trying to merge domains, which is not allowed. Consider the following scenario:

Install NuoDB on host 1, and start the broker B1 with the peer property not set. Broker B1 will create a new domain, with only the one broker running in it.

Install NuoDB on host 2, also not setting the peer property. Broker B2 will also start its own domain.

Edit default.properties on host 2 and set peer=B1. Restart broker B2, which attempts to peer to broker B1 and fails with:

2015-01-15T13:50:46.185-0500 SEVERE PeerService$EntryListener.messageArrived (..)
Failed to set ServerStateUUID
java.lang.IllegalArgumentException: UUID was already set

This is a safety guard to prevent the merging of two formerly separate domains. Each domain could, of course, have multiple brokers running, with its own durable domain configuration and databases. Domains cannot be merged.

Solution

If, for example, host 2 is a new host that is supposed to be provisioned for an existing domain, then restart B2 with a clean state, and peer it as follows:

Use the broker command line parameter "--reset-broker-state" to clear B2's state before peering it into the domain. Do this only once. Do not set the flag again for the next restart.

Alternatively, you can remove the Raft directory prior to broker start-up as this contains the conflicting durable domain configuration. The Raft directory exists by default in /var/opt/nuodb on MacOS and Linux and in %ALLUSERSPROFILE%\nuodb\var on Windows.

The new broker B2 will inherit the domain's distributed, consistent, durable state when peering with B1.