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:
   Binds to `config.getBindHost()`, `0.0.0.0` by default. With S3G on by 
default + the fixed `admin`/`admin123`, `ozone local run` ends up serving a 
writable S3 endpoint on all interfaces (checked locally: reachable from a 
non-loopback IP, `createBucket` works with the default creds, though the 
summary says `127.0.0.1`). Default to loopback and make `0.0.0.0` opt-in via 
`--bind-host`?



-- 
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]

Reply via email to