Use a unique random UUID as cluster name - Alfresco Content Services - 23.4 - 23.4 - Ready - Alfresco - external

Alfresco Content Services

Platform
Alfresco
Product
Alfresco Content Services
Release
23.4
License

Given that the Hazelcast cluster name consists of the Repository name and the Repository ID, you should consider changing this value to one that can’t be easily guessed.

Note: This compensating control applies to Content Services up to (and including) version 7.3.x. From Content Services 7.4.0 onwards, this procedure is applied automatically.
  1. Open the Admin Console.
  2. In the Repository Services section, click Repository Server Clustering. You should now see the Repository Server Clustering page.
  3. Take note of the current Cluster ID (for example: MainRepository-3c8081c0-8c36-4719-805e-4132f7a4430e).
  4. Shut down all nodes in the cluster.
  5. You will need to generate a random UUID. Choose your preferred tool, below is an example with JShell:
     jshell> UUID.randomUUID()
     $1 ==> e1c3e8e5-9e6c-480b-a822-f0d80db0abba
    					
  6. Create a new cluster name with the generated random UUID according to this formula {REPOSITORY_NAME}-{RANDOM_UUID} (according to the current example, the result in this case would be: MainRepository-e1c3e8e5-9e6c-480b-a822-f0d80db0abba).
  7. Calculate the CRC-32 checksum for the new cluster name. For example, with JShell:
     jshell> java.util.zip.CRC32 crc = new java.util.zip.CRC32()
     jshell> crc.update("MainRepository-e1c3e8e5-9e6c-480b-a822-f0d80db0abba".getBytes("UTF-8"))
     jshell> crc.getValue()
     $2 ==> 2144787869
    					
  8. Get the last 16 characters from the new cluster name (in the current example, it would be: 822-f0d80db0abba).
  9. Prepare the SQL statement to replace the legacy cluster according to the following template:
    UPDATE
         alf_prop_string_value
     SET
         string_value = [NEW CLUSTER NAME],
         string_end_lower = [LAST 16 CHARACTERS],
         string_crc = [CALCULATED CRC]
     WHEREid = (
         SELECTidFROM
             alf_prop_string_value
         WHERE
             string_value =[LEGACY CLUSTER NAME])
    

    Replace the values within the square brackets, in the context of the current example the prepared statement would look like this:

    UPDATE
         alf_prop_string_value
     SET
         string_value = 'MainRepository-e1c3e8e5-9e6c-480b-a822-f0d80db0abba',
         string_end_lower = '822-f0d80db0abba',
         string_crc = 2144787869
     WHEREid = (
         SELECTidFROM
             alf_prop_string_value
         WHERE
             string_value = 'MainRepository-3c8081c0-8c36-4719-805e-4132f7a4430e')
    					
  10. Execute the prepared SQL statement.
  11. Ensure that each node is fully started before starting the next one.