Skip to content

Conversation

@rdhabalia
Copy link
Contributor

Motivation

Right now, broker always listens on non-tls webservice(8080) and brokerservice(6650) port even though when user doesn't define it. So, broker always listens on non-secure port by default even when user doesn't want. And making those port optional will be tricky because broker has direct dependencies of them at many places (eg: while registering load-balancer node, always selecting broker with http-url, creating ownership-cache with non-tls url, etc.)

Modification

  • Make non-secured port and service-url optional
  • If non-secure web/broker service url not present then fallback to secured url.

Result

User can start pulsar in a secure mode only.

@rdhabalia rdhabalia added this to the 2.3.0 milestone Feb 1, 2019
@rdhabalia rdhabalia self-assigned this Feb 1, 2019
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this disable the "clear-text" service by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this disable the "clear-text" service by default?

yes. with this change, "clear-text" will disable the service.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, will it be disabled by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this disable the "clear-text" service by default?

yes. in order to disable it, right now, we are considering that user will give "clear-text". So, by default if user doesn't provide port then it will be disable. also pulsar-service fails if user doesn't provide both tls and non-tls ports.

However, I also agree that broker service should start with default port if none of the port is provided by default. so, we can have multiple options to disable service on non-tls port

  1. user can provide clear-text that will disable it by default.
  2. user can explicitly provide -1 value to disable non-tls port else by default it will listen on non-tls ports
  3. if both tls and non-tls ports are not provided then broker will start service on default non-tls ports.

I think we can do 2nd option to explicitly disable non-tls ports. any thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if user provides brokerServicePort= in broker.conf instead of leaving that line empty?

Copy link
Contributor Author

@rdhabalia rdhabalia Feb 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then right now, as we can see in this test, PulsarConfigurationLoader doesn't update the field and broker considers default field value so, it will be always 8080 if we keep private Integer brokerServicePort = 6650;. let me check if we can make change at PulsarConfigurationLoader where it sets field value null if value is not provided in config file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@merlimat can you review PR: #3543 .

@rdhabalia
Copy link
Contributor Author

retest this please

@rdhabalia
Copy link
Contributor Author

rerun cpp tests

@rdhabalia
Copy link
Contributor Author

@merlimat can you please review this and #3933 again when you get chance.

@sijie
Copy link
Member

sijie commented Jun 9, 2019

@rdhabalia do we need this issue for 2.4.0? or can we move it to 2.5.0?

@rdhabalia
Copy link
Contributor Author

@sijie yes, we need for 2.4.0 ..

@rdhabalia
Copy link
Contributor Author

addressed all comments, so can we please review this pR again

@codelipenghui
Copy link
Contributor

@merlimat Please help review this PR again

@sijie
Copy link
Member

sijie commented Jun 17, 2019

@merlimat can you please check this PR again?

@merlimat merlimat merged commit e9425c5 into apache:master Jun 18, 2019
@rdhabalia rdhabalia deleted the config_default branch July 7, 2020 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants