Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multi-node auth information sharing function #1350

Merged
merged 20 commits into from
Feb 10, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public String system() {
@Timed
@Path("backend")
@Produces(APPLICATION_JSON_WITH_CHARSET)
// @RolesAllowed({"admin", "$owner= $action=metrics_read"})
@RolesAllowed({"admin", "$owner= $action=metrics_read"})
public String backend(@Context GraphManager manager) {
Map<String, Map<String, Object>> results = InsertionOrderUtil.newMap();
for (String graph : manager.graphs()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public static synchronized ServerOptions instance() {
20
);

public static final ConfigOption<Integer> CLIENT_RECONNECT_PERIOD =
public static final ConfigOption<Integer> RPC_CLIENT_RECONNECT_PERIOD =
Copy link
Contributor

Choose a reason for hiding this comment

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

also update rpc.client_reconnect_timeout

new ConfigOption<>(
"rpc.client_reconnect_timeout",
"The timeout(in seconds) of rpc client reconnect to rpc " +
Expand All @@ -276,7 +276,7 @@ public static synchronized ServerOptions instance() {
20
);
javeme marked this conversation as resolved.
Show resolved Hide resolved

public static final ConfigOption<Integer> CLIENT_READ_TIMEOUT =
public static final ConfigOption<Integer> RPC_CLIENT_READ_TIMEOUT =
new ConfigOption<>(
"rpc.client_read_timeout",
"The timeout(in seconds) of rpc client read from rpc " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ public class RpcConsumerConfig {
public <T> void addConsumerConfig(Class<T> clazz, HugeConfig conf) {
String protocol = conf.get(ServerOptions.RPC_PROTOCOL);
String directUrl = conf.get(ServerOptions.AUTH_REMOTE_URL);
int timeout = conf.get(ServerOptions.CLIENT_READ_TIMEOUT) * 1000;
int timeout = conf.get(ServerOptions.RPC_CLIENT_READ_TIMEOUT) * 1000;
int connectTimeout = conf.get(ServerOptions
.RPC_CLIENT_CONNECT_TIMEOUT) * 1000;
int reconnectPeriod = conf.get(ServerOptions
.CLIENT_RECONNECT_PERIOD) * 1000;
.RPC_CLIENT_RECONNECT_PERIOD) * 1000;
int retries = conf.get(ServerOptions.RPC_CLIENT_RETRIES);
String loadBalancer = conf.get(ServerOptions.RPC_CLIENT_LOAD_BALANCER);
ConsumerConfig<T> consumerConfig = new ConsumerConfig<T>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public GraphManagerFactory(HugeConfig conf) {
public void onEvent(ApplicationEvent event) {
if (event.getType() == this.EVENT_INITED) {
manager = new GraphManager(conf);
} else if(event.getType() == this.EVENT_DESTROY) {
} else if (event.getType() == this.EVENT_DESTROY) {
if (manager != null) {
manager.close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ graphs=[hugegraph:conf/hugegraph.properties]
server.id=server-1
server.role=master

#auth.remote_url=10.103.168.25:8899,10.103.168.25:8898,10.103.168.25:8897
rpc.server_port=8899
#auth.remote_url=127.0.0.1:8899,127.0.0.1:8898,127.0.0.1:8897
Copy link
Contributor

Choose a reason for hiding this comment

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

move to line 13

rpc.server_host=127.0.0.1
Copy link
Contributor

Choose a reason for hiding this comment

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

move server_host before server_host

rpc.server_port=8893
rpc.server_timeout=30
rpc.client_connect_timeout=20
rpc.client_reconnect_timeout=20
Expand Down