Source: https://dev-docs.yueshu.com.cn/v5.3.2/utilities/exchange/config/sources/nebula3/ Documentation version: v5.3.2 # NebulaGraph 3.x 配置 本文介绍从 NebulaGraph 3.x 数据源导入数据的配置项。关于完整配置文件和配置项的信息,请参见[数据导入配置](https://dev-docs.yueshu.com.cn/v5.3.2/utilities/exchange/config/)。 ## 数据源配置 []() 下表列出了 NebulaGraph 3.x 数据源特定的配置项: | 选项 | 描述 | 类型 | 是否必选 | 默认值 | `type` | 数据源的类型。设置为`"nebula3"`。 | String | 是 | 无 | `metaAddress` | Meta 服务的地址和端口。 | String | 是 | 无 | `user` | Meta 服务的用户名。 | String | 否 | 无 | `password` | 登录源实例所用账号的当前密码。 | String | 否 | 无 | `spaceName` | 从中检索数据的图空间的名称。 | String | 是 | 无 | `labelName` | 从中检索数据的标签或边类型的名称。 | String | 是 | 无 | `returnColumns` | 从中检索数据的属性的名称列表。若未指定,则使用[点映射配置](https://dev-docs.yueshu.com.cn/v5.3.2/utilities/exchange/config/sources/mapping/#_2) 或[边映射配置](https://dev-docs.yueshu.com.cn/v5.3.2/utilities/exchange/config/sources/mapping/#_6)中`sourceFields`的取值。 | List | 否 | null | `fetchSize` | 每次读请求中要获取的点或边的数量。 | Int | 否 | `1000` ## 通用源配置 下列配置项也可以作为全局设置在配置文件的`sourcesCommon`一节指定: - `type` - `metaAddress` - `user` - `password` - `spaceName` - `fetchSize` 请注意,针对特定数据源的配置会覆盖全局设置。 ## 数据源配置示例 将``和``分别替换为登录源实例和目标实例所用账号的当前密码。若已修改密码,请使用修改后的密码。 NebulaGraph 3.x 源配置 ```` sources: [ { type:"nebula3" metaAddress: "192.168.15.2:9559" user: root password: "" spaceName: movie labelName: person returnColumns: [people_id,name] fetchSize: 20 // nodetypes: [] // edgetypes: [] } ] ```` ## 完整配置示例 ```` { taskType: import nebula: { graphAddr: "127.0.0.1:9669" graphName: "movie" user: "root" passwd: "" } error: { path: "/tmp/errors" maxRecords: 10000 } checkPoint: { path: "/tmp/checkpoint" resume: false } sourcesCommon:{ type:"nebula3" metaAddress: "192.168.15.2:9559" user: root 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: [] } ] } ] } ````