apache / incubator-hugegraph

A graph database that supports more than 100+ billion data, high performance and scalability (Include OLTP Engine & REST-API & Backends)
https://hugegraph.apache.org
Apache License 2.0
2.65k stars 518 forks source link

The server with name 'server-1' already in cluster #1462

Closed cdshuaijun closed 3 years ago

cdshuaijun commented 3 years ago

Expected behavior 期望表现

能够成功启动

Actual behavior 实际表现

启动失败 The server with name 'server-1' already in cluster

配置文件关键信息

hugegraph.properties

# gremlin entrence to create graph
gremlin.graph=com.baidu.hugegraph.HugeFactory
backend=memory
serializer=text
store=hugegraph

wscgraph.properties

# gremlin entrence to create graph
gremlin.graph=com.baidu.hugegraph.HugeFactory

backend=mysql
serializer=mysql
store=wscgraph

search.text_analyzer=jieba
search.text_analyzer_mode=INDEX

# mysql backend config
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://***:3306
jdbc.username=***
jdbc.password=***

gremlin-server.yaml

# host and port of gremlin server, need to be consistent with host and port in rest-server.properties
host: 0.0.0.0
port: 8182

# timeout in ms of gremlin query
scriptEvaluationTimeout: 30000

channelizer: org.apache.tinkerpop.gremlin.server.channel.WsAndHttpChannelizer
graphs: {
  hugegraph: conf/hugegraph.properties,
  wscgraph: conf/wscgraph.properties
}

rest-server.properties

# bind url
restserver.url=http://0.0.0.0:8080
# gremlin server url, need to be consistent with host and port in gremlin-server.yaml
gremlinserver.url=http://0.0.0.0:8182

# graphs list with pair NAME:CONF_PATH
graphs=[hugegraph:conf/hugegraph.properties,wscgraph:conf/hugegraph.properties]

# authentication
#auth.authenticator=
#auth.admin_token=
#auth.user_tokens=[]

server.id=server-1
server.role=master

启动命令

./bin/init-stroe.sh
./bin/start-hugegraph.sh

错误日志

2021-05-20 14:23:43 791   [main] [INFO ] com.jcabi.manifests.Manifests [] - 83 attributes loaded from 234 stream(s) in 52ms, 83 saved, 3341 ignored: ["Agent-Class", "Ant-Version", "Archiver-Version", "Automatic-Module-Name", "Bnd-LastModified", "Build-Id", "Build-Jdk", "Build-Version", "Built-At", "Built-By", "Built-Date", "Built-On", "Bundle-ActivationPolicy", "Bundle-Activator", "Bundle-Category", "Bundle-ClassPath", "Bundle-ContactAddress", "Bundle-Copyright", "Bundle-Description", "Bundle-DocURL", "Bundle-License", "Bundle-ManifestVersion", "Bundle-Name", "Bundle-NativeCode", "Bundle-RequiredExecutionEnvironment", "Bundle-SymbolicName", "Bundle-Vendor", "Bundle-Version", "Class-Path", "Created-By", "DSTAMP", "DynamicImport-Package", "Eclipse-BuddyPolicy", "Eclipse-ExtensibleAPI", "Embed-Dependency", "Export-Package", "Extension-Name", "Extension-name", "Fragment-Host", "Ignore-Package", "Implementation-Build", "Implementation-Build-Date", "Implementation-Build-Id", "Implementation-Title", "Implementation-URL", "Implementation-Vendor", "Implementation-Vendor-Id", "Implementation-Version", "Import-Package", "Include-Resource", "JCabi-Build", "JCabi-Date", "JCabi-Version", "Log4jReleaseKey", "Log4jReleaseManager", "Log4jReleaseVersion", "Main-Class", "Manifest-Version", "Maven-Version", "Multi-Release", "Originally-Created-By", "Package", "Premain-Class", "Private-Package", "Provide-Capability", "Require-Bundle", "Require-Capability", "Sealed", "Specification-Title", "Specification-Vendor", "Specification-Version", "TODAY", "TSTAMP", "Tool", "X-Compile-Source-JDK", "X-Compile-Target-JDK", "hash", "implementation-version", "mode", "package", "service", "url", "version"]
2021-05-20 14:23:43 797   [main] [INFO ] com.baidu.hugegraph.dist.HugeGremlinServer [] - 3.4.3
         \,,,/
         (o o)
-----oOOo-(3)-oOOo-----

2021-05-20 14:23:43 879   [main] [INFO ] com.baidu.hugegraph.dist.HugeGremlinServer [] - Configuring Gremlin Server from /home/hugegraph/hugegraph-0.11.2/conf/gremlin-server.yaml
2021-05-20 14:23:43 1038  [main] [INFO ] org.apache.tinkerpop.gremlin.server.GremlinServer [] - Graph [hugegraph] was successfully configured via [conf/hugegraph.properties].
2021-05-20 14:23:43 1054  [main] [INFO ] org.apache.tinkerpop.gremlin.server.GremlinServer [] - Graph [wscgraph] was successfully configured via [conf/wscgraph.properties].
2021-05-20 14:23:43 1054  [main] [INFO ] org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor [] - Initialized Gremlin thread pool.  Threads in pool named with pattern gremlin-*
2021-05-20 14:23:43 1354  [main] [INFO ] org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor [] - Initialized GremlinExecutor and preparing GremlinScriptEngines instances.
2021-05-20 14:23:45 3365  [main] [INFO ] org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor [] - Initialized gremlin-groovy GremlinScriptEngine and registered metrics
2021-05-20 14:23:45 3378  [main] [INFO ] org.apache.tinkerpop.gremlin.server.op.OpLoader [] - Adding the standard OpProcessor.
2021-05-20 14:23:45 3380  [main] [INFO ] org.apache.tinkerpop.gremlin.server.op.OpLoader [] - Adding the session OpProcessor.
2021-05-20 14:23:45 3426  [main] [INFO ] org.apache.tinkerpop.gremlin.server.op.OpLoader [] - Adding the traversal OpProcessor.
2021-05-20 14:23:45 3431  [main] [INFO ] org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor [] - Initialized cache for TraversalOpProcessor with size 1000 and expiration time of 600000 ms
2021-05-20 14:23:45 3457  [main] [INFO ] org.apache.tinkerpop.gremlin.server.GremlinServer [] - Executing start up LifeCycleHook
2021-05-20 14:23:45 3467  [main] [INFO ] org.apache.tinkerpop.gremlin.server.GremlinServer [] - Executed once at startup of Gremlin Server.
2021-05-20 14:23:45 3472  [main] [INFO ] org.apache.tinkerpop.gremlin.server.GremlinServer [] - idleConnectionTimeout was set to 0 which resolves to 0 seconds when configuring this value - this feature will be disabled
2021-05-20 14:23:45 3473  [main] [INFO ] org.apache.tinkerpop.gremlin.server.GremlinServer [] - keepAliveInterval was set to 0 which resolves to 0 seconds when configuring this value - this feature will be disabled
2021-05-20 14:23:45 3508  [main] [INFO ] org.apache.tinkerpop.gremlin.server.AbstractChannelizer [] - Configured application/vnd.graphbinary-v1.0 with org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1
2021-05-20 14:23:45 3514  [main] [INFO ] org.apache.tinkerpop.gremlin.server.AbstractChannelizer [] - Configured application/json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0
2021-05-20 14:23:45 3526  [main] [INFO ] org.apache.tinkerpop.gremlin.server.AbstractChannelizer [] - Configured application/vnd.gremlin-v2.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV2d0
2021-05-20 14:23:45 3526  [main] [INFO ] org.apache.tinkerpop.gremlin.server.AbstractChannelizer [] - application/json already has org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0 configured - it will not be replaced by org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV2d0, change order of serialization configuration if this is not desired.
2021-05-20 14:23:45 3534  [main] [INFO ] org.apache.tinkerpop.gremlin.server.AbstractChannelizer [] - Configured application/vnd.gremlin-v3.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0
2021-05-20 14:23:45 3534  [main] [INFO ] org.apache.tinkerpop.gremlin.server.AbstractChannelizer [] - application/json already has org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0 configured - it will not be replaced by org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, change order of serialization configuration if this is not desired.
2021-05-20 14:23:45 3544  [main] [INFO ] org.apache.tinkerpop.gremlin.server.AbstractChannelizer [] - Configured application/vnd.graphbinary-v1.0 with org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1
2021-05-20 14:23:45 3545  [main] [INFO ] org.apache.tinkerpop.gremlin.server.AbstractChannelizer [] - Configured application/json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0
2021-05-20 14:23:45 3547  [main] [INFO ] org.apache.tinkerpop.gremlin.server.AbstractChannelizer [] - Configured application/vnd.gremlin-v2.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV2d0
2021-05-20 14:23:45 3547  [main] [INFO ] org.apache.tinkerpop.gremlin.server.AbstractChannelizer [] - application/json already has org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0 configured - it will not be replaced by org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV2d0, change order of serialization configuration if this is not desired.
2021-05-20 14:23:45 3549  [main] [INFO ] org.apache.tinkerpop.gremlin.server.AbstractChannelizer [] - Configured application/vnd.gremlin-v3.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0
2021-05-20 14:23:45 3549  [main] [INFO ] org.apache.tinkerpop.gremlin.server.AbstractChannelizer [] - application/json already has org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0 configured - it will not be replaced by org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, change order of serialization configuration if this is not desired.
2021-05-20 14:23:45 3608  [gremlin-server-boss-1] [INFO ] org.apache.tinkerpop.gremlin.server.GremlinServer [] - Gremlin Server configured with worker thread pool of 1, gremlin pool of 4 and boss thread pool of 1.
2021-05-20 14:23:45 3608  [gremlin-server-boss-1] [INFO ] org.apache.tinkerpop.gremlin.server.GremlinServer [] - Channel started at port 8182.
2021-05-20 14:23:45 3612  [main] [INFO ] com.baidu.hugegraph.server.RestServer [] - RestServer starting...
May 20, 2021 2:23:46 PM org.glassfish.grizzly.http.server.NetworkListener start
INFO: Started listener bound to [0.0.0.0:8080]
2021-05-20 14:23:46 4494  [main] [INFO ] com.baidu.hugegraph.server.RestServer [] - Graph 'hugegraph' was successfully configured via 'conf/hugegraph.properties'
2021-05-20 14:23:46 4495  [main] [INFO ] com.baidu.hugegraph.server.RestServer [] - Graph 'wscgraph' was successfully configured via 'conf/hugegraph.properties'
2021-05-20 14:23:46 4604  [main] [INFO ] com.baidu.hugegraph.HugeGraph [] - Graph 'hugegraph' has been initialized
2021-05-20 14:23:46 4634  [main] [INFO ] com.baidu.hugegraph.HugeGraph [] - Graph 'hugegraph' has been initialized
2021-05-20 14:23:46 4634  [main] [INFO ] com.baidu.hugegraph.HugeGraph [] - Init server info for graph 'hugegraph'...
2021-05-20 14:23:46 4656  [main] [INFO ] com.baidu.hugegraph.HugeGraph [] - Restoring incomplete tasks for graph 'hugegraph'...
2021-05-20 14:23:46 4668  [main] [INFO ] com.baidu.hugegraph.HugeGraph [] - Init server info for graph 'hugegraph'...
May 20, 2021 2:23:47 PM org.glassfish.grizzly.http.server.NetworkListener shutdownNow
INFO: Stopped listener bound to [0.0.0.0:8080]
2021-05-20 14:23:47 4689  [main] [ERROR] com.baidu.hugegraph.dist.HugeGraphServer [] - HugeRestServer start error:
java.lang.IllegalArgumentException: The server with name 'server-1' already in cluster
        at com.google.common.base.Preconditions.checkArgument(Preconditions.java:163) ~[guava-25.1-jre.jar:?]
        at com.baidu.hugegraph.util.E.checkArgument(E.java:56) ~[hugegraph-common-1.8.1.jar:1.8.1.0]
        at com.baidu.hugegraph.task.ServerInfoManager.initServerInfo(ServerInfoManager.java:142) ~[hugegraph-core-0.11.2.jar:0.11.2.0]
        at com.baidu.hugegraph.StandardHugeGraph.serverStarted(StandardHugeGraph.java:220) ~[hugegraph-core-0.11.2.jar:0.11.2.0]
        at com.baidu.hugegraph.core.GraphManager.serverStarted(GraphManager.java:237) ~[hugegraph-api-0.11.2.jar:0.58.0.0]
        at com.baidu.hugegraph.core.GraphManager.<init>(GraphManager.java:78) ~[hugegraph-api-0.11.2.jar:0.58.0.0]
        at com.baidu.hugegraph.server.ApplicationConfig$GraphManagerFactory$1.onEvent(ApplicationConfig.java:108) ~[hugegraph-api-0.11.2.jar:0.58.0.0]
        at org.glassfish.jersey.server.internal.monitoring.CompositeApplicationEventListener.onEvent(CompositeApplicationEventListener.java:74) ~[jersey-server-2.25.1.jar:?]
        at org.glassfish.jersey.server.internal.monitoring.MonitoringContainerListener.onStartup(MonitoringContainerListener.java:81) ~[jersey-server-2.25.1.jar:?]
        at org.glassfish.jersey.server.ApplicationHandler.onStartup(ApplicationHandler.java:1180) ~[jersey-server-2.25.1.jar:?]
        at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.start(GrizzlyHttpContainer.java:357) ~[jersey-container-grizzly2-http-2.25.1.jar:?]
        at org.glassfish.grizzly.http.server.HttpHandlerChain.start(HttpHandlerChain.java:398) ~[grizzly-http-server-2.4.4.jar:2.4.4]
        at org.glassfish.grizzly.http.server.HttpServer.setupHttpHandler(HttpServer.java:293) ~[grizzly-http-server-2.4.4.jar:2.4.4]
        at org.glassfish.grizzly.http.server.HttpServer.start(HttpServer.java:269) ~[grizzly-http-server-2.4.4.jar:2.4.4]
        at com.baidu.hugegraph.server.RestServer.start(RestServer.java:64) ~[hugegraph-api-0.11.2.jar:0.58.0.0]
        at com.baidu.hugegraph.server.RestServer.start(RestServer.java:133) ~[hugegraph-api-0.11.2.jar:0.58.0.0]
        at com.baidu.hugegraph.dist.HugeRestServer.start(HugeRestServer.java:58) ~[hugegraph-dist-0.11.2.jar:?]
        at com.baidu.hugegraph.dist.HugeGraphServer.<init>(HugeGraphServer.java:55) [hugegraph-dist-0.11.2.jar:?]
        at com.baidu.hugegraph.dist.HugeGraphServer.main(HugeGraphServer.java:100) [hugegraph-dist-0.11.2.jar:?]
2021-05-20 14:23:47 4695  [main] [INFO ] org.apache.tinkerpop.gremlin.server.GremlinServer [] - Shutting down OpProcessor[]
2021-05-20 14:23:47 4695  [main] [INFO ] org.apache.tinkerpop.gremlin.server.GremlinServer [] - Shutting down OpProcessor[session]
2021-05-20 14:23:47 4696  [main] [INFO ] org.apache.tinkerpop.gremlin.server.GremlinServer [] - Shutting down OpProcessor[traversal]
2021-05-20 14:23:47 4697  [main] [INFO ] org.apache.tinkerpop.gremlin.server.GremlinServer [] - Shutting down thread pools.
2021-05-20 14:23:47 4699  [gremlin-server-stop] [INFO ] org.apache.tinkerpop.gremlin.server.GremlinServer [] - Executing shutdown LifeCycleHook
2021-05-20 14:23:47 4699  [gremlin-server-stop] [INFO ] org.apache.tinkerpop.gremlin.server.GremlinServer [] - Executed once at shutdown of Gremlin Server.
2021-05-20 14:23:49 6903  [gremlin-server-stop] [INFO ] com.baidu.hugegraph.HugeGraph [] - Close graph standardhugegraph[hugegraph]
2021-05-20 14:23:49 6919  [gremlin-server-stop] [WARN ] org.apache.tinkerpop.gremlin.server.GremlinServer [] - Exception while closing Graph instance [hugegraph]
java.lang.IllegalStateException: Ensure tx closed in all threads when closing graph 'hugegraph'
        at com.google.common.base.Preconditions.checkState(Preconditions.java:531) ~[guava-25.1-jre.jar:?]
        at com.baidu.hugegraph.util.E.checkState(E.java:68) ~[hugegraph-common-1.8.1.jar:1.8.1.0]
        at com.baidu.hugegraph.StandardHugeGraph.close(StandardHugeGraph.java:800) ~[hugegraph-core-0.11.2.jar:0.11.2.0]
        at org.apache.tinkerpop.gremlin.server.GremlinServer.lambda$null$7(GremlinServer.java:298) ~[gremlin-server-3.4.3.jar:3.4.3]
        at java.util.concurrent.ConcurrentHashMap$KeySetView.forEach(ConcurrentHashMap.java:4649) ~[?:1.8.0_292]
        at org.apache.tinkerpop.gremlin.server.GremlinServer.lambda$stop$8(GremlinServer.java:295) ~[gremlin-server-3.4.3.jar:3.4.3]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_292]
2021-05-20 14:23:49 6919  [gremlin-server-stop] [INFO ] org.apache.tinkerpop.gremlin.server.GremlinServer [] - Closed Graph instance [hugegraph]
2021-05-20 14:23:49 6920  [gremlin-server-stop] [INFO ] com.baidu.hugegraph.HugeGraph [] - Close graph standardhugegraph[wscgraph]
main dict load finished, time elapsed 604 ms
model load finished, time elapsed 130 ms.
2021-05-20 14:23:50 7995  [gremlin-server-stop] [INFO ] org.apache.tinkerpop.gremlin.server.GremlinServer [] - Closed Graph instance [wscgraph]
2021-05-20 14:23:50 7996  [gremlin-server-stop] [INFO ] org.apache.tinkerpop.gremlin.server.GremlinServer [] - Gremlin Server - shutdown complete
Exception in thread "main" java.lang.IllegalArgumentException: The server with name 'server-1' already in cluster
        at com.google.common.base.Preconditions.checkArgument(Preconditions.java:163)
        at com.baidu.hugegraph.util.E.checkArgument(E.java:56)
        at com.baidu.hugegraph.task.ServerInfoManager.initServerInfo(ServerInfoManager.java:142)
        at com.baidu.hugegraph.StandardHugeGraph.serverStarted(StandardHugeGraph.java:220)
        at com.baidu.hugegraph.core.GraphManager.serverStarted(GraphManager.java:237)
        at com.baidu.hugegraph.core.GraphManager.<init>(GraphManager.java:78)
        at com.baidu.hugegraph.server.ApplicationConfig$GraphManagerFactory$1.onEvent(ApplicationConfig.java:108)
        at org.glassfish.jersey.server.internal.monitoring.CompositeApplicationEventListener.onEvent(CompositeApplicationEventListener.java:74)
        at org.glassfish.jersey.server.internal.monitoring.MonitoringContainerListener.onStartup(MonitoringContainerListener.java:81)
        at org.glassfish.jersey.server.ApplicationHandler.onStartup(ApplicationHandler.java:1180)
        at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.start(GrizzlyHttpContainer.java:357)
        at org.glassfish.grizzly.http.server.HttpHandlerChain.start(HttpHandlerChain.java:398)
        at org.glassfish.grizzly.http.server.HttpServer.setupHttpHandler(HttpServer.java:293)
        at org.glassfish.grizzly.http.server.HttpServer.start(HttpServer.java:269)
        at com.baidu.hugegraph.server.RestServer.start(RestServer.java:64)
        at com.baidu.hugegraph.server.RestServer.start(RestServer.java:133)
        at com.baidu.hugegraph.dist.HugeRestServer.start(HugeRestServer.java:58)
        at com.baidu.hugegraph.dist.HugeGraphServer.<init>(HugeGraphServer.java:55)
        at com.baidu.hugegraph.dist.HugeGraphServer.main(HugeGraphServer.java:100)
2021-05-20 14:23:50 7999  [Thread-1] [INFO ] com.baidu.hugegraph.HugeGraph [] - HugeGraph is shutting down
imbajin commented 3 years ago

这个提示是说, 你现在连接的后端里, 存在多个 图server 同时连接它, 并且 ID 相同.

最简单的排除办法就是你把现在报错的 server 的 rest-server.properties 里 server.id=server-1 的值改一下, 然后看看是否不报错了. 再去排查一下是不是有多个 server 都配置了同一个 id 启动.

cdshuaijun commented 3 years ago

感谢回复,但是依然不行,试过 server-2 server-3 server-999,都是这样的错误 java.lang.IllegalArgumentException: The server with name 'server-999' already in cluster

服务器是才买的,下载了hugegraph-0.11.2,解压以后 修改了默认的hugegraph图为内存存储,添加了存储类型为mysqlwscgraph图,我不太明白我就是简单的执行了 start-hugegraph.sh,怎么会有多个server?我试过把所有图逗调整为内存存储 依然是这样的错误

cdshuaijun commented 3 years ago

另外一个操作,wscgraph 最开始设置的是hbase存储,但是启动不成功,kber认证报错,然后调整为mysql存储

cdshuaijun commented 3 years ago

@imbajin 问题已经解决,是你说的情况,原因是我在rest-server.properties里面配置的2个图的配置文件都指向了hugegraph.properties