Skip to content

[fix][broker] Create "standalone" cluster when starting standalone server - #15583

Merged
Technoboy- merged 2 commits into
apache:masterfrom
massakam:tenant-creation
May 15, 2022
Merged

[fix][broker] Create "standalone" cluster when starting standalone server#15583
Technoboy- merged 2 commits into
apache:masterfrom
massakam:tenant-creation

Conversation

@massakam

@massakam massakam commented May 13, 2022

Copy link
Copy Markdown
Contributor

Motivation

Up to version 2.10.0, we could create any tenant as soon as we started the standalone server. However, the current master cannot do that.

$ ./bin/pulsar-admin tenants create foo

2022-05-13T13:33:21,852+0900 [AsyncHttpClient-7-1] WARN  org.apache.pulsar.client.admin.internal.BaseResource - [http://localhost:8080/admin/v2/tenants/foo] Failed to perform http put request: javax.ws.rs.ClientErrorException: HTTP 412 Clusters can not be empty
Clusters can not be empty

Reason: Clusters can not be empty

$ ./bin/pulsar-admin tenants create -c standalone foo

2022-05-13T13:33:37,011+0900 [AsyncHttpClient-7-1] WARN  org.apache.pulsar.client.admin.internal.BaseResource - [http://localhost:8080/admin/v2/tenants/foo] Failed to perform http put request: javax.ws.rs.ClientErrorException: HTTP 412 Clusters do not exist
Clusters do not exist

Reason: Clusters do not exist

Modifications

The reason why tenant creation fails is that the "standalone" cluster does not actually exist.

$ grep 'clusterName' conf/standalone.conf

clusterName=standalone

$ ./bin/pulsar-admin clusters get standalone

Cluster does not exist

Reason: Cluster does not exist

The process of creating this cluster has been removed in #15186, but it seems that there is no need to remove it. So, I added the process of creating the "standalone" cluster again.

Verifying this change

  • Make sure that the change passes the CI checks.

Documentation

  • no-need-doc

@massakam massakam added type/bug The PR fixed a bug or issue reported a bug area/broker doc-not-needed Your PR changes do not impact docs labels May 13, 2022
@massakam massakam added this to the 2.11.0 milestone May 13, 2022
@massakam massakam self-assigned this May 13, 2022
@Technoboy- Technoboy- changed the title [bug][broker] Create "standalone" cluster when starting standalone server [fix][broker] Create "standalone" cluster when starting standalone server May 13, 2022
@merlimat

Copy link
Copy Markdown
Contributor

@massakam The CPP tests are failing because the script is creating the standalone cluster again:

2022-05-13T10:28:38,588+0000 [AsyncHttpClient-7-1] WARN  org.apache.pulsar.client.admin.internal.BaseResource - [https://localhost:8443/admin/v2/clusters/standalone] Failed to perform http put request: javax.ws.rs.ClientErrorException: HTTP 409 Cluster already exists
[42](https://github.com/apache/pulsar/runs/6420579337?check_suite_focus=true#step:11:42)
Cluster already exists
[43](https://github.com/apache/pulsar/runs/6420579337?check_suite_focus=true#step:11:43)

@codelipenghui

Copy link
Copy Markdown
Contributor

/pulsarbot run-failure-checks

@massakam

Copy link
Copy Markdown
Contributor Author

@massakam The CPP tests are failing because the script is creating the standalone cluster again:

Fixed the script to create the standalone cluster only if it doesn't exist.

@Technoboy-
Technoboy- merged commit ad96be0 into apache:master May 15, 2022
@massakam
massakam deleted the tenant-creation branch May 16, 2022 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/broker doc-not-needed Your PR changes do not impact docs type/bug The PR fixed a bug or issue reported a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants