Skip to content
Developer Edition runs on one host and does not require a product license file. Need multi-host deployment or performance testing at scale? Explore Enterprise Edition

NebulaGraph 3.x configurations

This topic introduces the configuration options for importing data from a NebulaGraph 3.x data source. For information about the complete configuration file and options, see Data import configurations.

Data source configurations

The following table lists the configuration options specific to the NebulaGraph 3.x data source.

Option Description Type Required Default value
type The type of the data source. In this case, set the value to "nebula3". String Yes N/A
metaAddress The address and port of the Meta service. String Yes N/A
user The username of the Meta service. String No N/A
password The current password for the account used to connect to the source instance. String No N/A
spaceName The name of the graph space from which data is retrieved. String Yes N/A
labelName The name of the tag or edge type from which data is retrieved. String Yes N/A
returnColumns The list of names of properties from which data is retrieved. If not specified, the value of sourceFields set in node mapping configurations or edge mapping configurations is used. List No null
fetchSize The number of vertexes or edges to fetch in each read request. Int No 1000

Common source configurations

The following configuration options can also be specified as global settings in the section sourcesCommon of the configuration file:

  • type
  • metaAddress
  • user
  • password
  • spaceName
  • fetchSize

Note that the configurations on specific data sources override the global settings.

Data source configuration example

Replace <source-password> and <current-password> with the current passwords for the source and target accounts, respectively. If a password has changed, use the new password.

NebulaGraph 3.x source configurations
sources: [
  {
      type:"nebula3"
      metaAddress: "192.168.15.2:9559"
      user: root
      password: "<source-password>"
      spaceName: movie 
      labelName: person
      returnColumns: [people_id,name]
      fetchSize: 20
//      nodetypes: []
//      edgetypes: []
  }
]  

Complete configuration example

{
  taskType: import
  nebula: {
    graphAddr: "127.0.0.1:9669"
    graphName: "movie"
    user: "root"
    passwd: "<current-password>"
  }

  error: {
    path: "/tmp/errors"
    maxRecords: 10000
  }

  checkPoint: {
    path: "/tmp/checkpoint"
    resume: false
  } 

  sourcesCommon:{
    type:"nebula3"
    metaAddress: "192.168.15.2:9559"
    user: root
    password: "<source-password>"
    spaceName: movie
    fetchSize: 1000
  }

  writeCommon:{
    batchSize: 2000
    enableRealTimeQPSLog: true
    mode: "INSERT IGNORE"
  }

  sources: [
    # node type Actor
    {
      labelName: actor
      pre_processes: {
          filter: ["birth_date!='\\N'"]
          concatConstant: [
            {
              field: "name"
              prefixValue: "test_"
              suffixValue: ""
            }
          ]
      }

      nodetypes: [
        {
          name: "Actor"
          sourceFields: [people_id,name,birth_date]
          nebulaFields: [id,name,birthDate]
        }
      ]
    }

    # node type Movie
    {
      labelName: movie
      nodetypes: [
        {
          name: "Movie"
          sourceFields: [movie_id,name]
          nebulaFields: [id,name]
        }
      ]
    }

   # edge type Act
    {
      labelName: act
      edgetypes: [
        {
          name: "Act"
          sourceKeys: [people_id]
          nebulaSrcKeys: [id]
          targetKeys: [movie_id]
          nebulaDstKeys: [id]
          sourceFields: []
          nebulaFields: []
        }
      ]
    }

  ]
}