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

使用postgres存储,配置项不能指定database,这样不好吧

Open dyhyao6 opened this issue 6 years ago • 7 comments

Expected behavior 期望表现

{type something here...} @javeme jdbc.driver=org.postgresql.Driver jdbc.url=jdbc:postgresql://localhost:5432/database

Actual behavior 实际表现

{type something here...} jdbc.driver=org.postgresql.Driver jdbc.url=jdbc:postgresql://localhost:5432/ jdbc.username= jdbc.password= @Linary

Steps to reproduce the problem 复现步骤

  1. {step 1}
  2. {step 2}
  3. {step 3}

Status of loaded data 数据状态

Vertex/Edge summary 数据量

  • loaded vertices amount: {like 10 million}
  • loaded edges amount: {like 20 million}
  • loaded time: {like 200s}

Vertex/Edge example 数据示例

{type something here...}

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

{type something here...}

Specifications of environment 环境信息

  • hugegraph version: {like v0.7.4}
  • operating system: {like centos 7.4, 32 CPUs, 64G RAM}
  • hugegraph backend: {like cassandra 3.10, cluster with 20 nodes, 3 x 1TB HDD disk each node}

dyhyao6 avatar Dec 02 '20 02:12 dyhyao6

为什么要自己指定database呢?默认就是连当前这个图对应的database啊。

Linary avatar Dec 03 '20 02:12 Linary

@dyhyao6 目前的设计是每个图实例对应的会创建一个database,创建多个图就有多个pg的database。

javeme avatar Dec 04 '20 11:12 javeme

为什么要自己指定database呢?默认就是连当前这个图对应的database啊。

抱歉,我表述有误。 问题是这样的: 我在pg里创建了huge用户,创建了名为hugegraph的database,配置用户名huge密码password。初始化时提示没有名为huge的database。于是我另外新建了名为huge的database,这是才初始化成功。我的问题就是,为啥需要创建和用户名一样的数据库。此问题没有截图,抱歉。 @ @javeme @Linary

dyhyao6 avatar Dec 04 '20 13:12 dyhyao6

你的配置文件hugegraph.properties中的store配置的值是什么?hugegraph执行init-store.sh时会在你的数据库中创建一个database,这个database的名字就是store的值,跟用户名没有关系的。

Linary avatar Dec 07 '20 09:12 Linary

你的配置文件hugegraph.properties中的store配置的值是什么?hugegraph执行init-store.sh时会在你的数据库中创建一个database,这个database的名字就是store的值,跟用户名没有关系的。

企业微信截图_20201207183159 企业微信截图_20201207183143 这是我的配置文件,值是hugegraeph。可是普通用户没有建库的权限呀。能按照我这样的配置初始化话吗?

dyhyao6 avatar Dec 07 '20 10:12 dyhyao6

@dyhyao6 指定database是通过store,而不是jdbc.url

PostgreSQL连接必须指定database,如果没有指定(我们代码里建库之前建立连接没有指定database),就会尝试连接跟user相同的database。这是出错的原因。

我在 #1293 中改进了下,只要指定的user具有createDB的权限,就可以init-store和start-hugegraph。

zhoney avatar Dec 09 '20 12:12 zhoney

@dyhyao6 指定database是通过store,而不是jdbc.url

PostgreSQL连接必须指定database,如果没有指定(我们代码里建库之前建立连接没有指定database),就会尝试连接跟user相同的database。这是出错的原因。

我在 #1293 中改进了下,只要指定的user具有createDB的权限,就可以init-store和start-hugegraph。

谢谢,这样讲我就明白了

dyhyao6 avatar Dec 09 '20 13:12 dyhyao6