Hi everyone, I'm trying to use the controller API ...
# general
s
Hi everyone, I'm trying to use the controller API to create tenants and assign them brokers and servers but running into some issues. All of our broker and server instances are created with a "DefaultTenant" tag and when I make a POST request to /tenants I end up with a 500 error with message "Failed to allocate broker instances to Tag" due to not having enough untagged instances. Is there a way to create the instances without the "DefaultTenant" tag? I've tried manually changing the tag to "untagged" using the /instances endpoint per this page in the docs but I'm still running into the same issue. It works ok if I just use the /instances endpoint to update the tag but it feels like a hack doing it that way. Can someone advise on whether I'm missing a step and/or the best approach please? Thanks
n
Using the update endpoint is a legit way. But if you want to do it with the create ending, try updating the tag to ""
s
Hey @User, thank you so much for getting back to me! I tried
Copy code
pinotControllerClient.updateInstanceTags("Broker_172.17.0.3_8000", Map.of("instanceTags", List.of("")));
And got the following:
Copy code
[400 Bad Request] during [PUT] to [<http://localhost:55387/instances/Broker_172.17.0.3_8000/updateTags?instanceTags>] [PinotControllerClient#updateInstanceTags(String,Map)]: [{"code":400,"error":"Must provide tags to update"}]
This also fails with the same error
Copy code
pinotControllerClient.updateInstanceTags("Broker_172.17.0.3_8000", Map.of("instanceTags", Collections.emptyList()));
n
I see. Will check that out. We should allow empty tagging. In the meantime, please use the update API. It is stable and an acceptable way to achieve what you want
s
Thank you, I really appreciate that! Just out of curiosity, are all servers/brokers/minions created with the tag "DefaultTenant" by default or can we create them without tags? For context, we're setting up our pinot cluster in kubernetes
n
yes, just dug that up
Set
cluster.tenant.isolation.enable=false
in your controller conf file. eg my controller.conf looks like this
Copy code
controller.host=localhost
controller.port=9000
controller.data.dir=/Users/npawar/quick_start_configs/pinot-quick-start/dataDir
controller.zk.str=localhost:2181
controller.helix.cluster.name=PinotCluster
cluster.tenant.isolation.enable=false
This should make your brokers/servers join with tag
broker_untagged
and
server_untagged
. You should then be able to use the
POST /tenants
API and directly create tenants without using the
updateTags
API
@User ^