dosubot[bot] commented on issue #2667: URL: https://github.com/apache/incubator-hugegraph/issues/2667#issuecomment-2380589239
<!-- Answer --> The error "The server with name 'server-1' already in cluster" on the first restart but not on the second restart is likely due to the `server.id` configuration in the `rest-server.properties` file. The `server.id` is set to `server-1`, and it seems that on the first restart, the server might not have fully released the previous instance, causing a conflict. By the second restart, the previous instance is fully terminated, allowing the new instance to start without issues. To avoid this, ensure that the server is fully stopped before restarting it. You can also try changing the `server.id` to a unique value if running multiple instances. Here is the relevant configuration from `rest-server.properties`: ```properties server.id=server-1 server.role=master ``` Additionally, ensure that the `restserver.url` and `gremlinserver.url` configurations are consistent with the host and port settings in `gremlin-server.yaml` to avoid any potential conflicts during the server startup process. For example, in `rest-server.properties`: ```properties restserver.url=http://127.0.0.1:8080 gremlinserver.url=http://127.0.0.1:8182 ``` And in `gremlin-server.yaml`: ```yaml host: 127.0.0.1 port: 8182 ``` Moreover, the issue might also be related to how RocksDB handles its sessions and locks. According to the `RocksDBStore` class in HugeGraph, the database sessions are managed and opened using a thread pool. If the previous instance of RocksDB has not fully released its locks or sessions, it could cause the "already in cluster" error. The second restart works because the previous instance has had enough time to release all resources. To mitigate this, ensure that the RocksDB instance is properly closed before restarting the server. You can also check the logs for any issues related to session handling or lock availability in RocksDB <sup>[[1]](https://github.com/apache/incubator-hugegraph-doc/blob/master/content/en/docs/config/config-guide.md)</sup><sup>[[2]](https://github.com/apache/incubator-hugegraph-doc/blob/master/content/cn/docs/config/config-guide.md)</sup><sup>[[3]](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-server/hugegraph-rocksdb/src/main/java/org/apache/hugegraph/backend/store/rocksdb/RocksDBStore.java)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* -- 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]
