Update Confluence license programmatically
Asked by Adam Wickes:

Hi all,   

I am looking at implementing auto scaling with our Confluence cluster however it looks like the license needs to be replaced every time a new node is spun up.   

Is it possible to set the license programmatically? via api or another method?  

Thanks,  
Adam


Answers:
author: Daniel Eads
body: Hey [@Adam Wickes](/t5/user/viewprofilepage/user-id/1438983) ,

I wanted to direct you to the [Installing Confluence Data Center document](https://confluence.atlassian.com/doc/installing-confluence-data-center-203603.html), which has this information about adding additional nodes:
>
> #### Copy Confluence to second node {#toc-hId--542611984}
>
> To copy Confluence to the second node:
>
> 1. Shut down Confluence on node 1.
> 2. Copy the installation directory from node 1 to node 2.
> 3. Copy the local home directory from node 1 to node 2.
>
> Copying the local home directory ensures the Confluence search index, the database and cluster configuration, and any other settings are copied to node 2.

So that's the standard non-autoscaling way of doing things. When copying the install directory over, confluence.cfg.xml will be included and you shouldn't need to modify the license.

For AWS-specific deployments, our [Confluence Data Center AWS Quickstart template](https://aws.amazon.com/quickstart/architecture/confluence/) should handle tasks like that when autoscaling. I'm guessing you haven't already deployed with the Quickstart (hence the licensing problem you've noted). I would suggest redeploying with the Quickstart if possible, as it takes care of a number of pieces that should make your autoscaling simpler.

Cheers,  
Daniel

comments: author: Adam Wickes
body: We have deployed using that quickstart guide.  
Every time a new node starts, it is created with the default key and not the key manually applied to the first node.


author: Daniel Eads
body: Hi [@Adam Wickes](/t5/user/viewprofilepage/user-id/1438983) ,

In that case, I might suggest opening a case through our support portal so that we can take a look at your AWS configuration. Reviewing your account, you'll either need to reach out to a technical or billing contact for your Confluence Data Center's license, or get added as a contact on the license in order to open a case at <https://support.atlassian.com/contact> . The folks who are able to open a case with support will see the Confluence Data Center license when they check <https://my.atlassian.com> .

Cheers,  
Daniel


author: Adam Wickes
body: Can I just confirm Daniel that using the quickstart guide still means entering the license manually?   

Step 3 of the quick start guide is:  

"On the **License key** page, enter a valid Confluence Data Center license, and then choose Next."  

So my question is this.... when a node is auto scaled, wouldn't we still need to manually perform that step?


author: Fadoua
body: not sure [@Adam Wickes](/t5/user/viewprofilepage/user-id/1438983) let me tag an expert here [@Daniel Eads](/t5/user/viewprofilepage/user-id/1527694) can you please assist Adam?


author: Fadoua
body: [@Adam Wickes](/t5/user/viewprofilepage/user-id/1438983) If it is the same license you will be using in your different environments then you can have license copied via automation. When I say automation I mean you have to do all your installs/upgrades using BitBucket and Jenkins (or other tools of your choice)

But if you are doing everything manually you will have to update the license yourself.

Best,

Fadoua

comments: author: Adam Wickes
body: Hi Fadoua,   

it's the same cluster.   
We are using auto scaling to cycle the nodes daily.  
Each day, the new node requires us to manually enter the license number again.  
I have checked confluence.cfg.xml on both nodes and it looks like the license.message property is identical on both so unsure why one node is ok and one asks for license to be entered again.  

Thanks,  
Adam


author: Adam Wickes
body: Just an update on this. I was incorrect regarding the licence values. Both nodes had similar values but not the same. Copying the value from one to the other and then restarting the confluence service does work.  

This is a long shot but is there any way I can get the encrypted value from the actual license key without having to push it through the gui? It would be super handy to be able to store the encrypted license value in AWS systems manager/secrets manager and then pull it into the node during the user data execution.


author: Fadoua
body: [@Adam Wickes](/t5/user/viewprofilepage/user-id/1438983)

Not sure I ever heard about this feature(meaning rest api to update the license).

I know it is annoying however it has to be done everytime you install confluence on a new server.

Best,

Fadoua

comments: author: Adam Wickes
body: Even when they're part of a cluster?


author: Adam Wickes
body: I thought it might be possible to copy license value from one node to another but it looks like both nodes have exactly the same value in confluence.cfg.xml. Is the only way to add a new license via the gui?


Tags: confluence-server

licence

scale

server