Adding Coordinator Hosts over API


#1

Hi there

I'm currently working on automating the ECE cluster setup and I'm facing the following problem:

I'm generating a new roles-token with the following call:
acurl -u 'root:password' -H 'Content-Type: application/json' -X POST http://ece-api:12400/api/v1/platform/configuration/security/enrollment-tokens -d '{"persistent": false,"roles":["director, coordinator"], "validity_in_seconds": 3000000}')
Then I'm running the installer script with the following arguments:
--roles-token --roles "director,coordinator"

The runner is successfully added to the ECE cluster and in the UI the following roles are assigned: beats-runner, coordinator, director, services-forwarder
But only the following containers are running (as reported in UI):
beats-runner, client-forwarder, runner, services-forwarder

When I remove the coordinator role and add it again using the UI the following containers are reported by the UI:
admin-console, beats-runner, blueprint, client-forwarder, cloud-ui, constructor, curator, director, runner, services-forwarder, zookeeper

So it seems that when using the script and providing the roles token and the roles, they are not applied properly although the documentation suggest otherwise: https://www.elastic.co/guide/en/cloud-enterprise/current/ece-installing.html#ece-installing-additional

I'm using ECE version 1.0.2

Thanks for the help!


(Greg Marzouka) #2

Hi Lafunamor,

The roles argument that's passed to the installer script is a comma-delimited string (which you have correct), but the API request to generate the token requires an array.

So you should change it to:

{
  "persistent": false,
  "roles":["director", "coordinator"], 
  "validity_in_seconds": 3000000
}

There is no validation in the API for roles, so it returned a token that isn't actually going to work. Running the install script again with the newly generated token from the corrected request above should fix it.

Greg


#3

Hi Greg

Thanks a lot. I totally missed the error.

Works perfectly now.

Lafunamor


(system) #4

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.