Skip to content

Commit e29ed16

Browse files
committed
adjust configuration.md
1 parent 529f33a commit e29ed16

File tree

4 files changed

+96
-83
lines changed

4 files changed

+96
-83
lines changed

fluss-common/src/main/java/com/alibaba/fluss/config/ConfigOptions.java

Lines changed: 48 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,54 @@ public class ConfigOptions {
177177
"The maximum number of buckets that can be created for a table."
178178
+ "The default value is 128000");
179179

180+
181+
/**
182+
* The network address and port the server binds to for accepting connections.
183+
*
184+
* <p>This specifies the interface and port where the server will listen for incoming requests.
185+
* The format is {@code listener_name://host:port}, supporting multiple addresses separated by
186+
* commas.
187+
*
188+
* <p>The default value {@code "CLIENT://localhost:9123"} is suitable for local development.
189+
*/
190+
public static final ConfigOption<String> BIND_LISTENERS =
191+
key("bind.listeners")
192+
.stringType()
193+
.noDefaultValue()
194+
.withDescription(
195+
"The network address and port to which the server binds for accepting connections. "
196+
+ "This defines the interface and port where the server will listen for incoming requests. "
197+
+ "The format is `listener_name://host:port`, and multiple addresses can be specified, separated by commas. "
198+
+ "Use `0.0.0.0` for the `host` to bind to all available interfaces which is dangerous on production and not suggested for production usage. "
199+
+ "The `listener_name` serves as an identifier for the address in the configuration. For example, "
200+
+ "`internal.listener.name` specifies the address used for internal server communication. "
201+
+ "If multiple addresses are configured, ensure that the `listener_name` values are unique.");
202+
203+
/**
204+
* The externally advertised address and port for client connections.
205+
*
206+
* <p>This specifies the address other nodes/clients should use to connect to this server. It is
207+
* required when the bind address ({@link #BIND_LISTENERS}) is not publicly reachable (e.g.,
208+
* when using {@code localhost} in {@code bind.listeners}). <b>Must be configured in distributed
209+
* environments</b> to ensure proper cluster discovery. If not explicitly set, the value of
210+
* {@code bind.listeners} will be used as fallback.
211+
*/
212+
public static final ConfigOption<String> ADVERTISED_LISTENERS =
213+
key("advertised.listeners")
214+
.stringType()
215+
.noDefaultValue()
216+
.withDescription(
217+
"The externally advertised address and port for client connections. "
218+
+ "Required in distributed environments when the bind address is not publicly reachable. "
219+
+ "Format matches `bind.listeners` (listener_name://host:port). "
220+
+ "Defaults to the value of `bind.listeners` if not explicitly configured.");
221+
222+
public static final ConfigOption<String> INTERNAL_LISTENER_NAME =
223+
key("internal.listener.name")
224+
.stringType()
225+
.defaultValue(DEFAULT_LISTENER_NAME)
226+
.withDescription("The listener for server internal communication.");
227+
180228
// ------------------------------------------------------------------------
181229
// ConfigOptions for Coordinator Server
182230
// ------------------------------------------------------------------------
@@ -234,52 +282,6 @@ public class ConfigOptions {
234282
+ " (“50100,50101”), ranges (“50100-50200”) or a combination of both."
235283
+ "This option is deprecated. Please use bind.listeners instead, which provides a more flexible configuration for multiple ports");
236284

237-
/**
238-
* The network address and port the server binds to for accepting connections.
239-
*
240-
* <p>This specifies the interface and port where the server will listen for incoming requests.
241-
* The format is {@code listener_name://host:port}, supporting multiple addresses separated by
242-
* commas.
243-
*
244-
* <p>The default value {@code "CLIENT://localhost:9123"} is suitable for local development.
245-
*/
246-
public static final ConfigOption<String> BIND_LISTENERS =
247-
key("bind.listeners")
248-
.stringType()
249-
.noDefaultValue()
250-
.withDescription(
251-
"The network address and port to which the server binds for accepting connections. "
252-
+ "This defines the interface and port where the server will listen for incoming requests. "
253-
+ "The format is `listener_name://host:port`, and multiple addresses can be specified, separated by commas. "
254-
+ "Use `0.0.0.0` for the `host` to bind to all available interfaces which is dangerous on production and not suggested for production usage. "
255-
+ "The `listener_name` serves as an identifier for the address in the configuration. For example, "
256-
+ "`internal.listener.name` specifies the address used for internal server communication. "
257-
+ "If multiple addresses are configured, ensure that the `listener_name` values are unique.");
258-
259-
/**
260-
* The externally advertised address and port for client connections.
261-
*
262-
* <p>This specifies the address other nodes/clients should use to connect to this server. It is
263-
* required when the bind address ({@link #BIND_LISTENERS}) is not publicly reachable (e.g.,
264-
* when using {@code localhost} in {@code bind.listeners}). <b>Must be configured in distributed
265-
* environments</b> to ensure proper cluster discovery. If not explicitly set, the value of
266-
* {@code bind.listeners} will be used as fallback.
267-
*/
268-
public static final ConfigOption<String> ADVERTISED_LISTENERS =
269-
key("advertised.listeners")
270-
.stringType()
271-
.noDefaultValue()
272-
.withDescription(
273-
"The externally advertised address and port for client connections. "
274-
+ "Required in distributed environments when the bind address is not publicly reachable. "
275-
+ "Format matches `bind.listeners` (listener_name://host:port). "
276-
+ "Defaults to the value of `bind.listeners` if not explicitly configured.");
277-
278-
public static final ConfigOption<String> INTERNAL_LISTENER_NAME =
279-
key("internal.listener.name")
280-
.stringType()
281-
.defaultValue(DEFAULT_LISTENER_NAME)
282-
.withDescription("The listener for server internal communication.");
283285

284286
public static final ConfigOption<Integer> COORDINATOR_IO_POOL_SIZE =
285287
key("coordinator.io-pool.size")

website/docs/apis/java-client.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,20 @@ single `Connection` instance per application and use it to create multiple `Admi
5252
`Table` and `Admin` instances, on the other hand, are not thread-safe and should be created for each thread that needs to access them.
5353
Caching or pooling of `Table` and `Admin` is not recommended.
5454

55-
Create a new `Admin` instance:
55+
Create a new `Admin` instance :
5656
```java
5757
// creating Connection object to connect with Fluss cluster
5858
Configuration conf = new Configuration();
5959
conf.setString("bootstrap.servers", "localhost:9123");
60+
61+
//If you are using SASL authentication, you need to set the following properties
62+
//conf.setString("client.security.protocol", "sasl");
63+
//conf.setString("client.security.sasl.mechanism", "PLAIN");
64+
//conf.setString("client.security.sasl.username", "alice");
65+
//conf.setString("client.security.sasl.password", "alice-secret");
6066
Connection connection = ConnectionFactory.createConnection(conf);
6167

68+
6269
// obtain Admin instance from the Connection
6370
Admin admin = connection.getAdmin();
6471
admin.listDatabases().get().forEach(System.out::println);
@@ -68,6 +75,8 @@ Table table = connection.getTable(TablePath.of("my_db", "my_table");
6875
System.out.println(table.getTableInfo());
6976
```
7077

78+
79+
7180
## Working Operations
7281
All methods in `FlussAdmin` return `CompletableFuture` objects. You can handle these in two ways:
7382

0 commit comments

Comments
 (0)