nebula-importer导入报错

  • nebula 版本:2.5.1.100

  • 部署方式:分布式

  • 是否为线上版本:Y

  • 问题的具体描述
    使用nebula-importer导入csv文件报如下错误:

2022/03/11 20:45:12 --- START OF NEBULA IMPORTER ---
2022/03/11 20:45:12 [INFO] config.go:467: files[0].schema.vertex is nil
2022/03/11 20:45:12 [INFO] connection_pool.go:79: [nebula-clients] connection pool is initialized successfully
2022/03/11 20:45:12 [INFO] clientmgr.go:28: Create 10 Nebula Graph clients
2022/03/11 20:45:12 [WARN] session.go:100: [nebula-clients] Sign out failed, short write
2022/03/11 20:45:12 [ERROR] clientpool.go:156: Client(0) fails to execute commands (USE `test_space_1`;), error: failed to execute: Session has been released
2022/03/11 20:45:12 [ERROR] session.go:72: [nebula-clients] Error info: short write
2022/03/11 20:45:12 [ERROR] clientpool.go:156: Client(3) fails to execute commands (USE `test_space_1`;), error: short write
2022/03/11 20:45:12 [ERROR] clientpool.go:156: Client(9) fails to execute commands (USE `test_space_1`;), error: failed to execute: Session has been released
2022/03/11 20:45:12 [ERROR] session.go:72: [nebula-clients] Error info: read tcp 10.32.106.106:56611->10.32.106.106:9669: use of closed network connection
2022/03/11 20:45:12 [ERROR] clientpool.go:156: Client(1) fails to execute commands (USE `test_space_1`;), error: read tcp 10.32.106.106:56611->10.32.106.106:9669: use of closed network connection
2022/03/11 20:45:12 [ERROR] session.go:72: [nebula-clients] Error info: read tcp 10.32.106.106:56613->10.32.106.106:9669: use of closed network connection
2022/03/11 20:45:12 [ERROR] clientpool.go:156: Client(2) fails to execute commands (USE `test_space_1`;), error: read tcp 10.32.106.106:56613->10.32.106.106:9669: use of closed network connection
2022/03/11 20:45:12 [ERROR] session.go:72: [nebula-clients] Error info: read tcp 10.32.106.106:56617->10.32.106.106:9669: use of closed network connection
2022/03/11 20:45:12 [ERROR] clientpool.go:156: Client(4) fails to execute commands (USE `test_space_1`;), error: read tcp 10.32.106.106:56617->10.32.106.106:9669: use of closed network connection
2022/03/11 20:45:12 [ERROR] clientpool.go:156: Client(5) fails to execute commands (USE `test_space_1`;), error: execute failed: out of sequence response
2022/03/11 20:45:12 [ERROR] clientpool.go:156: Client(8) fails to execute commands (USE `test_space_1`;), error: execute failed: out of sequence response
2022/03/11 20:45:12 [ERROR] clientpool.go:156: Client(7) fails to execute commands (USE `test_space_1`;), error: execute failed: out of sequence response
2022/03/11 20:45:12 [ERROR] session.go:72: [nebula-clients] Error info: read tcp 10.32.106.106:56621->10.32.106.106:9669: use of closed network connection
2022/03/11 20:45:12 [ERROR] clientpool.go:156: Client(6) fails to execute commands (USE `test_space_1`;), error: read tcp 10.32.106.106:56621->10.32.106.106:9669: use of closed network connection
2022/03/11 20:45:13 runtime error: invalid memory address or nil pointer dereference
2022/03/11 20:45:14 --- END OF NEBULA IMPORTER —

– 配置YAML文件

# 连接的Nebula Graph版本,连接2.x时设置为v2。
version: v2

description: example

# 是否删除临时生成的日志和错误数据文件。
removeTempFiles: false

clientSettings:

  # nGQL语句执行失败的重试次数。
  retry: 3

  # Nebula Graph客户端并发数。
  concurrency: 10 

  # 每个Nebula Graph客户端的缓存队列大小。
  channelBufferSize: 128

  # 指定数据要导入的Nebula Graph图空间。
  space: test_space_1

  # 连接信息。
  connection:
    user: username
    password: password
    address: 127.0.0.1:3699

# 错误等日志信息输出的文件路径。    
logPath: ./err/test.log

# CSV文件相关设置。
files:

    # 数据文件的存放路径,如果使用相对路径,则会将路径和当前配置文件的目录拼接。本示例第一个数据文件为点的数据。
  - path: ./vertex.csv

    # 插入失败的数据文件存放路径,以便后面补写数据。
    failDataPath: ./err/vertex.csv

    # 单批次插入数据的语句数量。
    batchSize: 10

    # 读取数据的行数限制。
    limit: 10

    # 是否按顺序在文件中插入数据行。如果为false,可以避免数据倾斜导致的导入速率降低。
    inOrder: true

    # 文件类型,当前仅支持csv。
    type: csv

    csv:
      # 是否有表头。
      withHeader: false

      # 是否有LABEL。
      withLabel: false

      # 指定csv文件的分隔符。只支持一个字符的字符串分隔符。
      delimiter: ","

    schema:
      # Schema的类型,可选值为vertex和edge。
      type: vertex

    # 本示例第二个数据文件为边的数据。
  - path: ./edge.csv
    failDataPath: ./err/edge.csv
    batchSize: 10
    limit: 10
    inOrder: true
    type: csv
    csv:
      withHeader: false
      withLabel: false
    schema:
      # Schema的类型为edge。
      type: edge
      edge:
        name: relation
        withRanking: false

辛苦大神帮忙解答

帮你把帖子的日志和 yaml 用代码块格式了一下,推荐下次用代码块格式哈,否则一些字符会被解析成 markdown ,比如yaml里的注释#变成标题什么的。

你的报错的关键词我在论坛搜索了,建议下次提完之前搜索一下(这里关键词是 out of sequence response ),我找到这个 importer的一个错误 - #2,来自 HarrisChu

应该是你的配置写有问题

好的,谢谢

如果您是 2.5 的话,那时候还不支持没有 tag 的 vertex 插入哈,应该至少需要指定 tag 的名字。

ref: https://github.com/vesoft-inc/nebula-importer/blob/master/examples/v2/example.yaml

1 个赞