denglei0712 opened a new issue, #2160: URL: https://github.com/apache/incubator-hugegraph/issues/2160
### Problem Type (问题类型) None ### Before submit - [X] 我已经确认现有的 [Issues](https://github.com/apache/hugegraph/issues) 与 [FAQ](https://hugegraph.apache.org/docs/guides/faq/) 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents) ### Environment (环境信息) - CentOS7 x64 - hugegraph-0.12.0 - hbase-2.4.15 - JDK8 ### Your Question (问题描述) ### 配置信息: HugeGraph 相关配置 > empty-sample.groovy ```groovy import org.apache.tinkerpop.gremlin.server.util.LifeCycleHook // an init script that returns a Map allows explicit setting of global bindings. def globals = [:] // defines a sample LifeCycleHook that prints some output to the Gremlin Server console. // note that the name of the key in the "global" map is unimportant. globals << [hook: [ onStartUp : { ctx -> ctx.logger.info("Executed once at startup of Gremlin Server.") }, onShutDown: { ctx -> ctx.logger.info("Executed once at shutdown of Gremlin Server.") } ] as LifeCycleHook] // define schema manger for hugegraph schema = hugegraph.schema() // define the default TraversalSource to bind queries to - this one will be named "g". g = hugegraph.traversal() ``` > gremlin-server.yaml ```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 # don't set graph at here, this happens after support for dynamically adding graph graphs: { } scriptEngines: { gremlin-groovy: { plugins: { com.baidu.hugegraph.plugin.HugeGraphGremlinPlugin: {}, org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: { classImports: [ java.lang.Math, com.baidu.hugegraph.backend.id.IdGenerator, com.baidu.hugegraph.type.define.Directions, com.baidu.hugegraph.type.define.NodeRole, com.baidu.hugegraph.traversal.algorithm.CollectionPathsTraverser, com.baidu.hugegraph.traversal.algorithm.CountTraverser, com.baidu.hugegraph.traversal.algorithm.CustomizedCrosspointsTraverser, com.baidu.hugegraph.traversal.algorithm.CustomizePathsTraverser, com.baidu.hugegraph.traversal.algorithm.FusiformSimilarityTraverser, com.baidu.hugegraph.traversal.algorithm.HugeTraverser, com.baidu.hugegraph.traversal.algorithm.JaccardSimilarTraverser, com.baidu.hugegraph.traversal.algorithm.KneighborTraverser, com.baidu.hugegraph.traversal.algorithm.KoutTraverser, com.baidu.hugegraph.traversal.algorithm.MultiNodeShortestPathTraverser, com.baidu.hugegraph.traversal.algorithm.NeighborRankTraverser, com.baidu.hugegraph.traversal.algorithm.PathsTraverser, com.baidu.hugegraph.traversal.algorithm.PersonalRankTraverser, com.baidu.hugegraph.traversal.algorithm.SameNeighborTraverser, com.baidu.hugegraph.traversal.algorithm.ShortestPathTraverser, com.baidu.hugegraph.traversal.algorithm.SingleSourceShortestPathTraverser, com.baidu.hugegraph.traversal.algorithm.SubGraphTraverser, com.baidu.hugegraph.traversal.algorithm.TemplatePathsTraverser, com.baidu.hugegraph.traversal.algorithm.steps.EdgeStep, com.baidu.hugegraph.traversal.algorithm.steps.RepeatEdgeStep, com.baidu.hugegraph.traversal.algorithm.steps.WeightedEdgeStep, com.baidu.hugegraph.traversal.optimize.Text, com.baidu.hugegraph.traversal.optimize.TraversalUtil, com.baidu.hugegraph.util.DateUtil ], methodImports: [java.lang.Math#*] }, org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: { files: [scripts/empty-sample.groovy] } } } } serializers: - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1, config: { serializeResultToString: false, ioRegistries: [com.baidu.hugegraph.io.HugeGraphIoRegistry] } } - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0, config: { serializeResultToString: false, ioRegistries: [com.baidu.hugegraph.io.HugeGraphIoRegistry] } } - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV2d0, config: { serializeResultToString: false, ioRegistries: [com.baidu.hugegraph.io.HugeGraphIoRegistry] } } - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, config: { serializeResultToString: false, ioRegistries: [com.baidu.hugegraph.io.HugeGraphIoRegistry] } } metrics: { consoleReporter: {enabled: false, interval: 180000}, csvReporter: {enabled: false, interval: 180000, fileName: ./metrics/gremlin-server-metrics.csv}, jmxReporter: {enabled: false}, slf4jReporter: {enabled: false, interval: 180000}, gangliaReporter: {enabled: false, interval: 180000, addressingMode: MULTICAST}, graphiteReporter: {enabled: false, interval: 180000} } maxInitialLineLength: 4096 maxHeaderSize: 8192 maxChunkSize: 8192 maxContentLength: 65536 maxAccumulationBufferComponents: 1024 resultIterationBatchSize: 64 writeBufferLowWaterMark: 32768 writeBufferHighWaterMark: 65536 ssl: { enabled: false } ``` > rest-server.properties ```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://127.0.0.1:8182 graphs=./conf/graphs # The maximum thread ratio for batch writing, only take effect if the batch.max_write_threads is 0 batch.max_write_ratio=80 batch.max_write_threads=0 # authentication configs # choose 'com.baidu.hugegraph.auth.StandardAuthenticator' or 'com.baidu.hugegraph.auth.ConfigAuthenticator' #auth.authenticator= # for StandardAuthenticator mode #auth.graph_store=hugegraph # auth client config #auth.remote_url=127.0.0.1:8899,127.0.0.1:8898,127.0.0.1:8897 # for ConfigAuthenticator mode #auth.admin_token= #auth.user_tokens=[] # rpc group configs of multi graph servers # rpc server configs rpc.server_host=127.0.0.1 rpc.server_port=8090 #rpc.server_timeout=30 # rpc client configs (like enable to keep cache consistency) rpc.remote_url=127.0.0.1:8090 #rpc.client_connect_timeout=20 #rpc.client_reconnect_period=10 #rpc.client_read_timeout=40 #rpc.client_retries=3 #rpc.client_load_balancer=consistentHash # lightweight load balancing (beta) server.id=server-1 server.role=master ``` > hugegraph.properties ```properties # gremlin entrance to create graph # auth config: com.baidu.hugegraph.auth.HugeFactoryAuthProxy gremlin.graph=com.baidu.hugegraph.HugeFactory # cache config #schema.cache_capacity=100000 # vertex-cache default is 1000w, 10min expired vertex.cache_type=l2 #vertex.cache_capacity=10000000 #vertex.cache_expire=600 # edge-cache default is 100w, 10min expired edge.cache_type=l2 #edge.cache_capacity=1000000 #edge.cache_expire=600 # schema illegal name template #schema.illegal_name_regex=\s+|~.* #vertex.default_label=vertex backend=hbase serializer=hbase store=hugegraph raft.mode=false raft.safe_read=false raft.use_snapshot=false raft.endpoint=127.0.0.1:8281 raft.group_peers=127.0.0.1:8281,127.0.0.1:8282,127.0.0.1:8283 raft.path=./raft-log raft.use_replicator_pipeline=true raft.election_timeout=10000 raft.snapshot_interval=3600 raft.backend_threads=48 raft.read_index_threads=8 raft.read_strategy=ReadOnlyLeaseBased raft.queue_size=16384 raft.queue_publish_timeout=60 raft.apply_batch=1 raft.rpc_threads=80 raft.rpc_connect_timeout=5000 raft.rpc_timeout=60000 search.text_analyzer=jieba search.text_analyzer_mode=INDEX # rocksdb backend config #rocksdb.data_path=/path/to/disk #rocksdb.wal_path=/path/to/disk # cassandra backend config cassandra.host=localhost cassandra.port=9042 cassandra.username= cassandra.password= #cassandra.connect_timeout=5 #cassandra.read_timeout=20 #cassandra.keyspace.strategy=SimpleStrategy #cassandra.keyspace.replication=3 # hbase backend config hbase.hosts=localhost hbase.port=2181 #hbase.znode_parent=/hbase #hbase.threads_max=64 # mysql backend config #jdbc.driver=com.mysql.jdbc.Driver #jdbc.url=jdbc:mysql://127.0.0.1:3306 #jdbc.username=root #jdbc.password= #jdbc.reconnect_max_times=3 #jdbc.reconnect_interval=3 #jdbc.sslmode=false # postgresql & cockroachdb backend config #jdbc.driver=org.postgresql.Driver #jdbc.url=jdbc:postgresql://localhost:5432/ #jdbc.username=postgres #jdbc.password= #jdbc.postgresql.connect_database=template1 # palo backend config #palo.host=127.0.0.1 #palo.poll_interval=10 #palo.temp_dir=./palo-data #palo.file_limit_size=32 ``` ### 下面是Java连接代码: ```xml <dependency> <groupId>org.apache.tinkerpop</groupId> <artifactId>gremlin-driver</artifactId> <version>3.6.2</version> </dependency> ``` ```java GraphTraversalSource g = traversal().withRemote( DriverRemoteConnection.using("192.168.xxx.xxx", 8182, "hugegraph") ); g.V().addV("Student").property("name", "小明").next(); ``` > 异常 Caused by: org.apache.tinkerpop.gremlin.driver.exception.ResponseException: The traversal source [hugegraph] for alias [g] is not configured on the server. ### Vertex/Edge example (问题点 / 边数据举例) _No response_ ### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构) _No response_ -- 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]
