nebula-exchange 导入数据少了

  • nebula 版本:2.5.1
  • 部署方式:分布式
  • 安装方式:源码编译
  • 是否为线上版本:Y
  • 硬件信息
    • 磁盘( 推荐使用 SSD)
    • CPU、内存信息
  • 问题的具体描述
  • 相关的 meta / storage / graph info 日志信息(尽量使用文本形式方便检索)

使用Nebula Exchange把数据从hive导入nebula,发现数据量少了。已经排查,点的名称是唯一,也没有看到脏数据或者报错。哪位大佬能指点一下

看下导入时Exchange的日志,是否有写入失败的数据。
如果日志找不到了,也可以看下配置文件中配的error.output路径,看该路径下是否有{tag}.0类似的文件。(本地路径和hdfs路径都确认下)

如下图所示,表中是有数据的,

但是导入图数据后nebula找不到该数据

之后单独导入该条数据

再次查询改数据会有了

在本台机器和hdfs也没有看到脏数据信息

你少的数据是边还是点
你的单条导入语句发一下,exchange的配置文件也发一下

都有少,这个上面展示的数据是边的例子

{

Spark相关配置

spark: {
app: {
name: Nebula Exchange 2.5.1
}
driver: {
cores: 1
maxResultSize: 1G
}
cores {
max: 16
}
}

如果Spark和Hive部署在不同集群,才需要配置连接Hive的参数,否则请忽略这些配置。

#hive: {

waredir: “hdfs://NAMENODE_IP:9000/apps/svr/hive-xxx/warehouse/”

connectionURL: “jdbc:mysql://your_ip:3306/hive_spark?characterEncoding=UTF-8”

connectionDriverName: “com.mysql.jdbc.Driver”

connectionUserName: “user”

connectionPassword: “password”

#}

Nebula Graph相关配置

nebula: {
address:{
# 以下为Nebula Graph的Graph服务和Meta服务所在机器的IP地址及端口。
# 如果有多个地址,格式为 “ip1:port”,“ip2:port”,“ip3:port”。
# 不同地址之间以英文逗号 (,) 隔开。
graph:[""]
meta:[""]
}
# 填写的账号必须拥有Nebula Graph相应图空间的写数据权限。
user: q
pswd: f4
# 填写Nebula Graph中需要写入数据的图空间名称。
space: bigdata_space_prd
connection {
timeout: 300000
retry: 5
}
execution {
retry: 5
}
error: {
max: 32
output: /tmp/nebula/errors
}
rate: {
limit: 1024
timeout: 10000
}
}

处理边数据

edges: [
# 设置Edge type follow相关信息
{
# Nebula Graph中对应的Edge type名称。
name: qzd_kg_sh_list_v2

  type: {
    # 指定数据源文件格式,设置为hive。
    source: hive

    # 指定边数据导入Nebula Graph的方式,
    # 指定如何将点数据导入Nebula Graph:Client或SST。
    sink: client
  }

  # 设置读取数据库basketball中follow表数据的SQL语句。
  exec: "select id,company_name,company_code,enterprise_code,enterprise_eid,enterprise_kg_code,equity_ratio,invest_sum,invest_currency,hold_sum,capital,actul_capital,capital_date,sh_attribute,sh_name,sh_id,sh_kg_code,end_date,insert_time,update_time,jsid,is_history from bigdata_application_dev.dwd_hsjy_qzd_kg_sh_list"

  # 在fields里指定follow表中的列名称,其对应的value会作为Nebula Graph中指定属性。
  # fields和nebula.fields里的配置必须一一对应。
  # 如果需要指定多个列名称,用英文逗号(,)隔开。
  fields: [id,company_name,company_code,enterprise_code,enterprise_eid,enterprise_kg_code,equity_ratio,invest_sum,invest_currency,hold_sum,capital,actul_capital,capital_date,sh_attribute,sh_name,sh_id,sh_kg_code,end_date,insert_time,update_time,jsid,is_history]
  nebula.fields: [id,company_name,company_code,enterprise_code,enterprise_eid,enterprise_kg_code,equity_ratio,invest_sum,invest_currency,hold_sum,capital,actul_capital,capital_date,sh_attribute,sh_name,sh_id,sh_kg_code,end_date,insert_time,update_time,jsid,is_history]

  # 在source里,将follow表中某一列作为边的起始点数据源。
  # 在target里,将follow表中某一列作为边的目的点数据源。
  source: {
    field: enterprise_eid
  }

  target: {
    field: sh_kg_code
  }

  # 单批次写入 Nebula Graph 的最大数据条数。
  batch: 256

  # Spark 分区数量
  partition: 32
}

]
}

你手动插入的ngql语句发一下

也是使用的脚本,只是查hive数据有做过滤。
select id,company_name,company_code,enterprise_code,enterprise_eid,enterprise_kg_code,equity_ratio,invest_sum,invest_currency,hold_sum,capital,actul_capital,capital_date,sh_attribute,sh_name,sh_eid,sh_id,sh_kg_code,end_date,insert_time,update_time,jsid,is_history from bigdata_application_dev.dwd_hsjy_qzd_kg_sh_list where id = ‘658583368375’;

是发ngql语句,不是从hive里面查出来的hive sql。

我是直接更改脚本里面的语句,也是通过nebula-exchange ,不是单独插入的

没有配rank的话,会不会存在相同的src dst导致数据被覆盖掉了

不会的,这个有排查过,只有一条数据,而且我单独插入的时候就可以了,也不知道为啥

确认下,你导入过程中 exchange的日志里面没有出现batchFailure 的值大于0吗,担心批量导入时因为网络原因或者发生leaderchange 出现偶发性的导入失败。

嗯嗯,好的,谢谢。我再排查一下日志

此话题已在最后回复的 30 天后被自动关闭。不再允许新回复。