rich7420 commented on code in PR #10759:
URL: https://github.com/apache/ozone/pull/10759#discussion_r3719498038
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/local/LocalOzoneCluster.java:
##########
@@ -477,16 +553,39 @@ private void configureOmStorage(OzoneConfiguration conf)
throws IOException {
omMetadataDir.toString());
}
- private List<OzoneConfiguration> configureDatanodes(OzoneConfiguration conf,
+ private int configureS3Gateway(OzoneConfiguration conf,
PersistedPortState persistedPorts, PortAllocator portAllocator)
throws IOException {
- int datanodeCount = config.getDatanodes();
- if (datanodeCount > MAX_DATANODES) {
- throw new IOException("Datanode count " + datanodeCount
- + " exceeds the local maximum of " + MAX_DATANODES
- + "; each datanode reserves " + DATANODE_PORT_KEY_SUFFIXES.length
- + " local ports.");
+ if (!config.isS3gEnabled()) {
+ return -1;
}
+ int s3gHttpPort = reservePort(portAllocator, persistedPorts,
+ S3G_HTTP_PORT_KEY, config.getS3gPort());
+ int s3gHttpsPort = reservePort(portAllocator, persistedPorts,
+ S3G_HTTPS_PORT_KEY, 0);
+ int s3gWebHttpPort = reservePort(portAllocator, persistedPorts,
+ S3G_WEBADMIN_HTTP_PORT_KEY, 0);
+ int s3gWebHttpsPort = reservePort(portAllocator, persistedPorts,
+ S3G_WEBADMIN_HTTPS_PORT_KEY, 0);
+
+ conf.set(OZONE_S3G_HTTP_ADDRESS_KEY,
+ address(config.getHost(), s3gHttpPort));
+ conf.set(OZONE_S3G_HTTP_BIND_HOST_KEY, config.getBindHost());
Review Comment:
This wires the S3 Gateway to `config.getBindHost()`, which defaults to
`0.0.0.0` (from `LocalOzoneClusterConfig`, pre-existing). Combined with S3G
being on by default and the fixed `admin`/`admin123`, a plain `ozone local run`
now exposes a *writable* S3 endpoint to the whole network. I checked locally:
from a non-loopback IP the port is reachable and a signed `createBucket`
succeeds with the default creds, even though the startup summary advertises
`127.0.0.1`. For a `local` tool, would loopback (`127.0.0.1`) be a safer
default, with `0.0.0.0` opt-in via `--bind-host`? Without the bind-host
override the services would stay loopback-only.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]