incubator-hugegraph icon indicating copy to clipboard operation
incubator-hugegraph copied to clipboard

cockroachdb集群的hugegraph.properties配置

Open 2867021781 opened this issue 3 years ago • 8 comments

Problem Type (问题类型)

No response

Before submit

  • [X] 我已经确认现有的 IssuesFAQ 中没有相同 / 重复问题

Environment (环境信息)

  • Server Version: v0.12.x
  • Backend: RocksDB x nodes, HDD or SSD
  • OS: xx CPUs, xx G RAM, Centos 7.x
  • Data Size: xx vertices, xx edges

Your Question (问题描述)

求 使用cockroachdb做后端集群存储的 hugegraph.properties配置文件

Vertex/Edge example (问题点 / 边数据举例)

No response

Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)

No response

2867021781 avatar Jul 20 '22 12:07 2867021781

另外是否需要先创建数据库

2867021781 avatar Jul 20 '22 12:07 2867021781

请参考文档:https://hugegraph.apache.org/docs/config/config-option/#postgresql-%E5%90%8E%E7%AB%AF%E9%85%8D%E7%BD%AE%E9%A1%B9

javeme avatar Jul 21 '22 05:07 javeme

https://hugegraph.apache.org/docs/config/config-option/#postgresql-%E5%90%8E%E7%AB%AF%E9%85%8D%E7%BD%AE%E9%A1%B9

多谢,我上个问题 使用ScyllaDB的集群搭建,gremlin语句有问题是bug还是?https://github.com/apache/incubator-hugegraph/issues/1934

2867021781 avatar Jul 21 '22 06:07 2867021781

请参考文档:https://hugegraph.apache.org/docs/config/config-option/#postgresql-%E5%90%8E%E7%AB%AF%E9%85%8D%E7%BD%AE%E9%A1%B9

用的cockroachdb后端存储,hugegraph.properties配置文件如下:

backend=postgresql
serializer=postgresql
...
postgresql & cockroachdb backend config
jdbc.driver=org.postgresql.Driver
jdbc.url=jdbc:postgresql://172.30.15.151:26257/
jdbc.username=postgres
jdbc.password=
#jdbc.postgresql.connect_database=

报错:

2022-07-21 19:43:47 [main] [INFO] c.b.h.u.ConfigUtil - Scaning option 'graphs' directory './conf/graphs'
2022-07-21 19:43:47 [main] [INFO] c.b.h.c.InitStore - Init graph with config file: ./conf/graphs/hugegraph.properties
2022-07-21 19:43:47 [main] [INFO] c.b.h.b.s.m.MysqlStore - Connect to the jdbc url: 'jdbc:postgresql://172.30.15.151:26257/template1?loggerLevel=OFF&socketTimeout=0&useSSL=false'
2022-07-21 19:43:47 [main] [ERROR] c.b.h.HugeGraph - Failed to open schema transaction
com.baidu.hugegraph.backend.BackendException: Failed to obtain database info
at com.baidu.hugegraph.backend.store.postgresql.PostgresqlSessions.existsDatabase(PostgresqlSessions.java:61) ~[hugegraph-postgresql-0.12.0.jar:?]
at com.baidu.hugegraph.backend.store.mysql.MysqlStore.open(MysqlStore.java:122) ~[hugegraph-mysql-0.12.0.jar:?]
at com.baidu.hugegraph.backend.tx.AbstractTransaction.(AbstractTransaction.java:82) ~[hugegraph-core-0.12.0.jar:0.12.0.0]
at com.baidu.hugegraph.backend.tx.IndexableTransaction.(IndexableTransaction.java:30) ~[hugegraph-core-0.12.0.jar:0.12.0.0]
at com.baidu.hugegraph.backend.tx.SchemaTransaction.(SchemaTransaction.java:75) ~[hugegraph-core-0.12.0.jar:0.12.0.0]
at com.baidu.hugegraph.backend.cache.CachedSchemaTransaction.(CachedSchemaTransaction.java:54) ~[hugegraph-core-0.12.0.jar:0.12.0.0]
at com.baidu.hugegraph.StandardHugeGraph.openSchemaTransaction(StandardHugeGraph.java:413) ~[hugegraph-core-0.12.0.jar:0.12.0.0]
at com.baidu.hugegraph.StandardHugeGraph.access$2600(StandardHugeGraph.java:112) ~[hugegraph-core-0.12.0.jar:0.12.0.0]
at com.baidu.hugegraph.StandardHugeGraph$TinkerPopTransaction.getOrNewTransaction(StandardHugeGraph.java:1387) ~[hugegraph-core-0.12.0.jar:0.12.0.0]
at com.baidu.hugegraph.StandardHugeGraph$TinkerPopTransaction.schemaTransaction(StandardHugeGraph.java:1363) ~[hugegraph-core-0.12.0.jar:0.12.0.0]
at com.baidu.hugegraph.StandardHugeGraph$TinkerPopTransaction.access$100(StandardHugeGraph.java:1233) ~[hugegraph-core-0.12.0.jar:0.12.0.0]
at com.baidu.hugegraph.StandardHugeGraph.schemaTransaction(StandardHugeGraph.java:470) ~[hugegraph-core-0.12.0.jar:0.12.0.0]
at com.baidu.hugegraph.StandardHugeGraph.backendStoreSystemInfo(StandardHugeGraph.java:249) ~[hugegraph-core-0.12.0.jar:0.12.0.0]
at com.baidu.hugegraph.cmd.InitStore.initGraph(InitStore.java:94) ~[hugegraph-dist-0.12.0.jar:?]
at com.baidu.hugegraph.cmd.InitStore.main(InitStore.java:79) ~[hugegraph-dist-0.12.0.jar:?]
Caused by: com.baidu.hugegraph.backend.BackendException: Failed to access jdbc:postgresql://172.30.15.151:26257/template1?loggerLevel=OFF&socketTimeout=0&useSSL=false
at com.baidu.hugegraph.backend.store.mysql.MysqlSessions.openWithoutDB(MysqlSessions.java:196) ~[hugegraph-mysql-0.12.0.jar:?]
at com.baidu.hugegraph.backend.store.postgresql.PostgresqlSessions.existsDatabase(PostgresqlSessions.java:57) ~[hugegraph-postgresql-0.12.0.jar:?]
... 14 more
Caused by: org.postgresql.util.PSQLException: ERROR: cleartext connections are not permitted
at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:438) ~[postgresql-42.1.4.jar:42.1.4]
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:222) ~[postgresql-42.1.4.jar:42.1.4]
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49) ~[postgresql-42.1.4.jar:42.1.4]
at org.postgresql.jdbc.PgConnection.(PgConnection.java:194) ~[postgresql-42.1.4.jar:42.1.4]
at org.postgresql.Driver.makeConnection(Driver.java:450) ~[postgresql-42.1.4.jar:42.1.4]
at org.postgresql.Driver.connect(Driver.java:252) ~[postgresql-42.1.4.jar:42.1.4]
at java.sql.DriverManager.getConnection(DriverManager.java:664) ~[?:1.8.0_181]
at java.sql.DriverManager.getConnection(DriverManager.java:247) ~[?:1.8.0_181]
at com.baidu.hugegraph.backend.store.mysql.MysqlSessions.connect(MysqlSessions.java:291) ~[hugegraph-mysql-0.12.0.jar:?]
at com.baidu.hugegraph.backend.store.mysql.MysqlSessions.openWithoutDB(MysqlSessions.java:194) ~[hugegraph-mysql-0.12.0.jar:?]
at com.baidu.hugegraph.backend.store.postgresql.PostgresqlSessions.existsDatabase(PostgresqlSessions.java:57) ~[hugegraph-postgresql-0.12.0.jar:?]
... 14 more
2022-07-21 19:46:57 [hugegraph-shutdown] [INFO] c.b.h.HugeGraph - HugeGraph is shutting down

2867021781 avatar Jul 21 '22 11:07 2867021781

从错误信息来看PSQLException: ERROR: cleartext connections are not permitted,可能需要启用加密传输,请尝试启用jdbc.ssl_mode(默认为false):

jdbc.ssl_mode=true

javeme avatar Jul 21 '22 12:07 javeme

从错误信息来看PSQLException: ERROR: cleartext connections are not permitted,可能需要启用加密传输,请尝试启用jdbc.ssl_mode(默认为false):

jdbc.ssl_mode=true

好像是我的cockroachdb版本太低了导致的,我先重新搭建一下

2867021781 avatar Jul 21 '22 15:07 2867021781

从错误信息来看PSQLException: ERROR: cleartext connections are not permitted,可能需要启用加密传输,请尝试启用jdbc.ssl_mode(默认为false):

jdbc.ssl_mode=true

image 使用高版本配置成功了,这个配置对吗?cockroachdb的,然后jdbc.url这块怎么配置,我这边cockroach是集群的,这块就配一个吗?其他两台机器也是这个ip,还是各自的ip

2867021781 avatar Jul 29 '22 05:07 2867021781

Due to the lack of activity, the current issue is marked as stale and will be closed after 20 days, any update will remove the stale label

github-actions[bot] avatar Aug 13 '22 21:08 github-actions[bot]