You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/12/31 09:38:41 UTC

[GitHub] [pulsar] AnonHxy opened a new pull request #13590: [WIP] Support IP as advertisedAddress if not set

AnonHxy opened a new pull request #13590:
URL: https://github.com/apache/pulsar/pull/13590


   <!--
   ### Contribution Checklist
     
     - Name the pull request in the form "[Issue XYZ][component] Title of the pull request", where *XYZ* should be replaced by the actual issue number.
       Skip *Issue XYZ* if there is no associated github issue for this pull request.
       Skip *component* if you are unsure about which is the best component. E.g. `[docs] Fix typo in produce method`.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
   
   **(The sections below can be removed for hotfixes of typos)**
   -->
   ### Motivation
   
   Sometimes we need use IP as advertisedAddress  when  executing automatic deployment
   
   ### Modifications
   
   * Add the field `ipAsAdvertisedAddress` in `ProxyConfiguration` and `ServiceConfiguration`
   * Most changes are concentrated on `org.apache.pulsar.broker.ServiceConfigurationUtils#getDefaultOrConfiguredAddress` and  `org.apache.pulsar.broker.ServiceConfigurationUtils#unsafeLocalhostResolve`
   
   ### Verifying this change
   
   - [x] Make sure that the change passes the CI checks.
   
   This change added tests and can be verified as follows:
   
     - *Extended case `MultipleListenerValidatorTest#testGetAppliedAdvertised`*
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API: (no)
     - The schema: (no)
     - The default values of configurations: (no)
     - The wire protocol: (no)
     - The rest endpoints: (no)
     - The admin cli options: (no)
     - Anything that affects deployment: (no)
   
   ### Documentation
   
   - [x] `doc` 
     
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] AnonHxy commented on pull request #13590: Support IP as advertisedAddress if not set

Posted by GitBox <gi...@apache.org>.
AnonHxy commented on pull request #13590:
URL: https://github.com/apache/pulsar/pull/13590#issuecomment-1003419763


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] AnonHxy commented on a change in pull request #13590: [WIP]Support IP as advertisedAddress if not set

Posted by GitBox <gi...@apache.org>.
AnonHxy commented on a change in pull request #13590:
URL: https://github.com/apache/pulsar/pull/13590#discussion_r778559675



##########
File path: site2/docs/reference-configuration.md
##########
@@ -705,7 +707,8 @@ The [Pulsar proxy](concepts-architecture-overview.md#pulsar-proxy) can be config
 | functionWorkerWebServiceURLTLS | The TLS Web service URL pointing to the function worker cluster. It is only configured when you setup function workers in a separate cluster. | |
 |zookeeperSessionTimeoutMs| ZooKeeper session timeout (in milliseconds) |30000|
 |zooKeeperCacheExpirySeconds|ZooKeeper cache expiry time in seconds|300|
-|advertisedAddress|Hostname or IP address the service advertises to the outside world. If not set, the value of `InetAddress.getLocalHost().getHostname()` is used.|N/A|
+|advertisedAddress| Hostname or IP address the service advertises to the outside world. If not set, the value of `InetAddress.getLocalHost().getHostName()` is used by default, or `InetAddress.getLocalHost().getHostAddress()` if `ipAsAdvertisedAddress` is true ||
+|ipAsAdvertisedAddress| If set true and `advertisedAddress` not set, the value of `InetAddress.getLocalHost().getHostAddress()` is used to set to advertisedAddress|false|

Review comment:
       updated




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] AnonHxy removed a comment on pull request #13590: Support IP as advertisedAddress if not set

Posted by GitBox <gi...@apache.org>.
AnonHxy removed a comment on pull request #13590:
URL: https://github.com/apache/pulsar/pull/13590#issuecomment-1003434854


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] AnonHxy removed a comment on pull request #13590: Support IP as advertisedAddress if not set

Posted by GitBox <gi...@apache.org>.
AnonHxy removed a comment on pull request #13590:
URL: https://github.com/apache/pulsar/pull/13590#issuecomment-1003419763


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] AnonHxy removed a comment on pull request #13590: Support IP as advertisedAddress if not set

Posted by GitBox <gi...@apache.org>.
AnonHxy removed a comment on pull request #13590:
URL: https://github.com/apache/pulsar/pull/13590#issuecomment-1003343794


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] AnonHxy commented on pull request #13590: Support IP as advertisedAddress if not set

Posted by GitBox <gi...@apache.org>.
AnonHxy commented on pull request #13590:
URL: https://github.com/apache/pulsar/pull/13590#issuecomment-1003731440


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] AnonHxy commented on pull request #13590: Support IP as advertisedAddress if not set

Posted by GitBox <gi...@apache.org>.
AnonHxy commented on pull request #13590:
URL: https://github.com/apache/pulsar/pull/13590#issuecomment-1003346790


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] AnonHxy commented on pull request #13590: Support IP as advertisedAddress if not set

Posted by GitBox <gi...@apache.org>.
AnonHxy commented on pull request #13590:
URL: https://github.com/apache/pulsar/pull/13590#issuecomment-1003434854


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] AnonHxy commented on pull request #13590: Support IP as advertisedAddress if not set

Posted by GitBox <gi...@apache.org>.
AnonHxy commented on pull request #13590:
URL: https://github.com/apache/pulsar/pull/13590#issuecomment-1003343794


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] Anonymitaet commented on a change in pull request #13590: Support IP as advertisedAddress if not set

Posted by GitBox <gi...@apache.org>.
Anonymitaet commented on a change in pull request #13590:
URL: https://github.com/apache/pulsar/pull/13590#discussion_r778494868



##########
File path: site2/docs/reference-configuration.md
##########
@@ -162,7 +162,8 @@ Pulsar brokers are responsible for handling incoming messages from producers, di
 |jvmGCMetricsLoggerClassName|Classname of Pluggable JVM GC metrics logger that can log GC specific metrics.|N/A|
 |bindAddress| Hostname or IP address the service binds on, default is 0.0.0.0.  |0.0.0.0|
 |bindAddresses| Additional Hostname or IP addresses the service binds on: `listener_name:scheme://host:port,...`.  ||
-|advertisedAddress| Hostname or IP address the service advertises to the outside world. If not set, the value of `InetAddress.getLocalHost().getHostName()` is used.  ||
+|advertisedAddress| Hostname or IP address the service advertises to the outside world. If not set, the value of `InetAddress.getLocalHost().getHostName()` is used by default, or `InetAddress.getLocalHost().getHostAddress()` if `ipAsAdvertisedAddress` is true ||

Review comment:
       ```suggestion
   |advertisedAddress| Hostname or IP address the service advertises to the outside world. If `advertisedAddress` is not set, the value of `InetAddress.getLocalHost().getHostName()` is used by default. If `advertisedAddress` is not set and `ipAsAdvertisedAddress` is set to true, the value of `InetAddress.getLocalHost().getHostAddress()` is used. ||
   ```
   do you mean this?

##########
File path: site2/docs/reference-configuration.md
##########
@@ -162,7 +162,8 @@ Pulsar brokers are responsible for handling incoming messages from producers, di
 |jvmGCMetricsLoggerClassName|Classname of Pluggable JVM GC metrics logger that can log GC specific metrics.|N/A|
 |bindAddress| Hostname or IP address the service binds on, default is 0.0.0.0.  |0.0.0.0|
 |bindAddresses| Additional Hostname or IP addresses the service binds on: `listener_name:scheme://host:port,...`.  ||
-|advertisedAddress| Hostname or IP address the service advertises to the outside world. If not set, the value of `InetAddress.getLocalHost().getHostName()` is used.  ||
+|advertisedAddress| Hostname or IP address the service advertises to the outside world. If not set, the value of `InetAddress.getLocalHost().getHostName()` is used by default, or `InetAddress.getLocalHost().getHostAddress()` if `ipAsAdvertisedAddress` is true ||
+|ipAsAdvertisedAddress| If set true and `advertisedAddress` not set, the value of `InetAddress.getLocalHost().getHostAddress()` is used to set to advertisedAddress|false|

Review comment:
       ```suggestion
   |ipAsAdvertisedAddress| If `ipAsAdvertisedAddress` is set to true and `advertisedAddress` is not set, the value of `InetAddress.getLocalHost().getHostAddress()` is used to set tthe advertised address. |false|
   ```
   do you mean this?

##########
File path: site2/docs/reference-configuration.md
##########
@@ -437,7 +438,8 @@ You can set the log level and configuration in the  [log4j2.yaml](https://github
 |webServicePort|  The port used by the standalone broker for HTTP requests  |8080|
 |bindAddress| The hostname or IP address on which the standalone service binds  |0.0.0.0|
 |bindAddresses| Additional Hostname or IP addresses the service binds on: `listener_name:scheme://host:port,...`.  ||
-|advertisedAddress| The hostname or IP address that the standalone service advertises to the outside world. If not set, the value of `InetAddress.getLocalHost().getHostName()` is used.  ||
+|advertisedAddress| Hostname or IP address the service advertises to the outside world. If not set, the value of `InetAddress.getLocalHost().getHostName()` is used by default, or `InetAddress.getLocalHost().getHostAddress()` if `ipAsAdvertisedAddress` is true ||
+|ipAsAdvertisedAddress| If set true and `advertisedAddress` not set, the value of `InetAddress.getLocalHost().getHostAddress()` is used to set to advertisedAddress|false|

Review comment:
       same comment

##########
File path: site2/docs/reference-configuration.md
##########
@@ -705,7 +707,8 @@ The [Pulsar proxy](concepts-architecture-overview.md#pulsar-proxy) can be config
 | functionWorkerWebServiceURLTLS | The TLS Web service URL pointing to the function worker cluster. It is only configured when you setup function workers in a separate cluster. | |
 |zookeeperSessionTimeoutMs| ZooKeeper session timeout (in milliseconds) |30000|
 |zooKeeperCacheExpirySeconds|ZooKeeper cache expiry time in seconds|300|
-|advertisedAddress|Hostname or IP address the service advertises to the outside world. If not set, the value of `InetAddress.getLocalHost().getHostname()` is used.|N/A|
+|advertisedAddress| Hostname or IP address the service advertises to the outside world. If not set, the value of `InetAddress.getLocalHost().getHostName()` is used by default, or `InetAddress.getLocalHost().getHostAddress()` if `ipAsAdvertisedAddress` is true ||
+|ipAsAdvertisedAddress| If set true and `advertisedAddress` not set, the value of `InetAddress.getLocalHost().getHostAddress()` is used to set to advertisedAddress|false|

Review comment:
       same comment




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] AnonHxy commented on a change in pull request #13590: [WIP]Support IP as advertisedAddress if not set

Posted by GitBox <gi...@apache.org>.
AnonHxy commented on a change in pull request #13590:
URL: https://github.com/apache/pulsar/pull/13590#discussion_r778559756



##########
File path: site2/docs/reference-configuration.md
##########
@@ -162,7 +162,8 @@ Pulsar brokers are responsible for handling incoming messages from producers, di
 |jvmGCMetricsLoggerClassName|Classname of Pluggable JVM GC metrics logger that can log GC specific metrics.|N/A|
 |bindAddress| Hostname or IP address the service binds on, default is 0.0.0.0.  |0.0.0.0|
 |bindAddresses| Additional Hostname or IP addresses the service binds on: `listener_name:scheme://host:port,...`.  ||
-|advertisedAddress| Hostname or IP address the service advertises to the outside world. If not set, the value of `InetAddress.getLocalHost().getHostName()` is used.  ||
+|advertisedAddress| Hostname or IP address the service advertises to the outside world. If not set, the value of `InetAddress.getLocalHost().getHostName()` is used by default, or `InetAddress.getLocalHost().getHostAddress()` if `ipAsAdvertisedAddress` is true ||
+|ipAsAdvertisedAddress| If set true and `advertisedAddress` not set, the value of `InetAddress.getLocalHost().getHostAddress()` is used to set to advertisedAddress|false|

Review comment:
       > do you mean this?
   
   update




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] AnonHxy commented on a change in pull request #13590: [WIP]Support IP as advertisedAddress if not set

Posted by GitBox <gi...@apache.org>.
AnonHxy commented on a change in pull request #13590:
URL: https://github.com/apache/pulsar/pull/13590#discussion_r778553823



##########
File path: site2/docs/reference-configuration.md
##########
@@ -162,7 +162,8 @@ Pulsar brokers are responsible for handling incoming messages from producers, di
 |jvmGCMetricsLoggerClassName|Classname of Pluggable JVM GC metrics logger that can log GC specific metrics.|N/A|
 |bindAddress| Hostname or IP address the service binds on, default is 0.0.0.0.  |0.0.0.0|
 |bindAddresses| Additional Hostname or IP addresses the service binds on: `listener_name:scheme://host:port,...`.  ||
-|advertisedAddress| Hostname or IP address the service advertises to the outside world. If not set, the value of `InetAddress.getLocalHost().getHostName()` is used.  ||
+|advertisedAddress| Hostname or IP address the service advertises to the outside world. If not set, the value of `InetAddress.getLocalHost().getHostName()` is used by default, or `InetAddress.getLocalHost().getHostAddress()` if `ipAsAdvertisedAddress` is true ||

Review comment:
       Yes, thanks for your suggestions




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] AnonHxy commented on pull request #13590: Support IP as advertisedAddress if not set

Posted by GitBox <gi...@apache.org>.
AnonHxy commented on pull request #13590:
URL: https://github.com/apache/pulsar/pull/13590#issuecomment-1003731317


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] AnonHxy closed pull request #13590: [WIP]Support IP as advertisedAddress if not set

Posted by GitBox <gi...@apache.org>.
AnonHxy closed pull request #13590:
URL: https://github.com/apache/pulsar/pull/13590


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] AnonHxy commented on pull request #13590: Support IP as advertisedAddress if not set

Posted by GitBox <gi...@apache.org>.
AnonHxy commented on pull request #13590:
URL: https://github.com/apache/pulsar/pull/13590#issuecomment-1003899598


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] AnonHxy removed a comment on pull request #13590: Support IP as advertisedAddress if not set

Posted by GitBox <gi...@apache.org>.
AnonHxy removed a comment on pull request #13590:
URL: https://github.com/apache/pulsar/pull/13590#issuecomment-1003346790






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org