nebula-exchange会自动处理,从而避免出现悬挂边的问题吗?
配置:
{
# Spark 相关配置
spark: {
app: {
name: Nebula Exchange 3.0.0
}
driver: {
cores: 1
maxResultSize: 1G
}
cores: {
max: 16
}
}
# Nebula Graph 相关配置
nebula: {
address:{
# 以下为 Nebula Graph 的 Graph 服务和 Meta 服务所在机器的 IP 地址及端口。
# 如果有多个地址,格式为 "ip1:port","ip2:port","ip3:port"。
# 不同地址之间以英文逗号 (,) 隔开。
graph:["127.0.0.1:9669"]
meta:["127.0.0.1:9559"]
}
# 填写的账号必须拥有 Nebula Graph 相应图空间的写数据权限。
user: root
pswd: nebula
# 填写 Nebula Graph 中需要写入数据的图空间名称。
space: basketballplayer
connection: {
timeout: 3000
retry: 3
}
execution: {
retry: 3
}
error: {
max: 32
output: /tmp/errors
}
rate: {
limit: 1024
timeout: 1000
}
}
# 处理点
tags: [
# 设置 Tag player 相关信息。
{
# Nebula Graph 中对应的 Tag 名称。
name: player
type: {
# 指定数据源文件格式,设置为 Kafka。
source: kafka
# 指定如何将点数据导入 Nebula Graph:Client 或 SST。
sink: client
}
# Kafka 服务器地址。
service: "127.0.0.1:9092"
# 消息类别。
topic: "topic_name1"
# 在 fields 里指定 Kafka value 中的字段名称,多个字段用英文逗号(,)隔开。Spark Structured Streaming 读取 Kafka 数据后会将其以 JSON 格式存储于 value 字段中,而这里的 fields 要配置 JSON 的 key 名。示例如下:
fields: [personName, personAge]
# 设置与 fields 中的 key 对应的 Nebula Graph 属性名,key 的 value 将保存为相应的属性值。下方设置会将 personName 的 value 保存到 Nebula Graph 中的 name 属性,personAge 的 value 则保存到 age 属性。
nebula.fields: [name, age]
# 指定表中某一列数据为 Nebula Graph 中点 VID 的来源。
# 这里的值 key 和上面的 key 重复,表示 key 既作为 VID,也作为属性 name。
vertex:{
field:personId
}
# 单批次写入 Nebula Graph 的数据条数。
batch: 10
# Spark 分区数量
partition: 10
# 读取消息的间隔。单位:秒。
interval.seconds: 10
}
# 设置 Tag team 相关信息。
{
name: team
type: {
source: kafka
sink: client
}
service: "127.0.0.1:9092"
topic: "topic_name2"
fields: [key]
nebula.fields: [name]
vertex:{
field:teamId
}
batch: 10
partition: 10
interval.seconds: 10
}
]
# 处理边数据
edges: [
# 设置 Edge type follow 相关信息
{
# Nebula Graph 中对应的 Edge type 名称。
name: follow
type: {
# 指定数据源文件格式,设置为 Kafka。
source: kafka
# 指定边数据导入 Nebula Graph 的方式,
# 指定如何将点数据导入 Nebula Graph:Client 或 SST。
sink: client
}
# Kafka 服务器地址。
service: "127.0.0.1:9092"
# 消息类别。
topic: "topic_name3"
# 在 fields 里指定 Kafka value 中的字段名称,多个字段用英文逗号(,)隔开。Spark Structured Streaming 读取 Kafka 数据后会将其以 JSON 格式存储于 value 字段中,而这里的 fields 要配置 JSON 的 key 名。示例如下:
fields: [degree]
# 设置与 fields 中的 key 对应的 Nebula Graph 属性名,key 的 value 将保存为相应的属性值。下方设置会将 degree 的 value 保存到 Nebula Graph 中的 degree 属性。
nebula.fields: [degree]
# 在 source 里,将 topic 中某一列作为边的起始点数据源。
# 在 target 里,将 topic 中某一列作为边的目的点数据源。
source:{
field:srcPersonId
}
target:{
field:dstPersonId
}
# 指定一个列作为 rank 的源(可选)。
#ranking: rank
# 单批次写入 Nebula Graph 的数据条数。
batch: 10
# Spark 分区数量
partition: 10
# 读取消息的间隔。单位:秒。
interval.seconds: 10
}
# 设置 Edge type serve 相关信息
{
name: serve
type: {
source: kafka
sink: client
}
service: "127.0.0.1:9092"
topic: "topic_name4"
fields: [startYear,endYear]
nebula.fields: [start_year,end_year]
source:{
field:personId
}
target:{
field:teamId
}
# 指定一个列作为 rank 的源(可选)。
#ranking: rank
batch: 10
partition: 10
interval.seconds: 10
}
]
}