当前位置:网站首页>Nebula Importer 数据导入实践
Nebula Importer 数据导入实践
2022-07-04 17:29:00 【InfoQ】
前言
- 需要将来自 Kafka、Pulsar 平台的流式数据, 导入 Nebula Graph 数据库
- 需要从关系型数据库(如 MySQL)或者分布式文件系统(如 HDFS)中读取批式数据
- 需要将大批量数据生成 Nebula Graph 能识别的 SST 文件
- Importer 适用于将本地 CSV 文件的内容导入至 Nebula Graph 中
- 在不同的 Nebula Graph 集群之间迁移数据
- 在同一个 Nebula Graph 集群内不同图空间之间迁移数据
- Nebula Graph 与其他数据源之间迁移数据
- 结合 Nebula Algorithm 进行图计算
- 在不同的 Nebula Graph 集群之间迁移数据
- 在同一个 Nebula Graph 集群内不同图空间之间迁移数据
- Nebula Graph 与其他数据源之间迁移数据

Nebula Importer 的使用
[[email protected] importer]# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 16
On-line CPU(s) list: 0-15
Thread(s) per core: 2
Core(s) per socket: 8
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 85
Model name: Intel(R) Xeon(R) Platinum 8269CY CPU @ 2.50GHz
Stepping: 7
CPU MHz: 2499.998
BogoMIPS: 4999.99
Hypervisor vendor: KVM
Virtualization type: full
L1d cache: 32K
L1i cache: 32K
L2 cache: 1024K
L3 cache: 36608K
NUMA node0 CPU(s): 0-15
Disk:SSD
Memory: 128G
集群环境
- Nebula Version:v2.6.1
- 部署方式:RPM
- 集群规模:三副本,六节点
数据规模
---------+--------------------------+-----------+
| "Space" | "vertices" | 559191827 |
+---------+--------------------------+-----------+
| "Space" | "edges" | 722490436 |
+---------+--------------------------+-----------+Importer 配置
# Graph版本,连接2.x时设置为v2。
version: v2
description: Relation Space import data
# 是否删除临时生成的日志和错误数据文件。
removeTempFiles: false
clientSettings:
# nGQL语句执行失败的重试次数。
retry: 3
# Nebula Graph客户端并发数。
concurrency: 5
# 每个Nebula Graph客户端的缓存队列大小。
channelBufferSize: 1024
# 指定数据要导入的Nebula Graph图空间。
space: Relation
# 连接信息。
connection:
user: root
password: ******
address: 10.0.XXX.XXX:9669,10.0.XXX.XXX:9669
postStart:
# 配置连接Nebula Graph服务器之后,在插入数据之前执行的一些操作。
commands: |
# 执行上述命令后到执行插入数据命令之间的间隔。
afterPeriod: 1s
preStop:
# 配置断开Nebula Graph服务器连接之前执行的一些操作。
commands: |
# 错误等日志信息输出的文件路径。
logPath: /mnt/csv_file/prod_relation/err/test.log
....50 03 15 * * /mnt/csv_file/importer/nebula-importer -config /mnt/csv_file/importer/rel.yaml >> /root/rel.log 2022/05/15 03:50:11 [INFO] statsmgr.go:62: Tick: Time(10.00s), Finished(1952500), Failed(0), Read Failed(0), Latency AVG(4232us), Batches Req AVG(4582us), Rows AVG(195248.59/s)
2022/05/15 03:50:16 [INFO] statsmgr.go:62: Tick: Time(15.00s), Finished(2925600), Failed(0), Read Failed(0), Latency AVG(4421us), Batches Req AVG(4761us), Rows AVG(195039.12/s)
2022/05/15 03:50:21 [INFO] statsmgr.go:62: Tick: Time(20.00s), Finished(3927400), Failed(0), Read Failed(0), Latency AVG(4486us), Batches Req AVG(4818us), Rows AVG(196367.10/s)
2022/05/15 03:50:26 [INFO] statsmgr.go:62: Tick: Time(25.00s), Finished(5140500), Failed(0), Read Failed(0), Latency AVG(4327us), Batches Req AVG(4653us), Rows AVG(205619.44/s)
2022/05/15 03:50:31 [INFO] statsmgr.go:62: Tick: Time(30.00s), Finished(6080800), Failed(0), Read Failed(0), Latency AVG(4431us), Batches Req AVG(4755us), Rows AVG(202693.39/s)
2022/05/15 03:50:36 [INFO] statsmgr.go:62: Tick: Time(35.00s), Finished(7087200), Failed(0), Read Failed(0), Latency AVG(4461us), Batches Req AVG(4784us), Rows AVG(202489.00/s)实时性
一些注意点
- 关于并发度,问题中有提到,这个 concurrency 指定为你的 cpu cores 就可以, 表示起多少个 client 连接 Nebula Server。 实际操作中,要去 trade off 导入速度和服务器压力的影响。在我们这边测试,如果并发过高,会导致磁盘 IO 过高,引发设置的一些告警,不建议一下把并发拉太高,可以根据实际业务测试下做权衡。
- Importer 并不能断点续传,如果出现错误,需要手动处理。在实际操作中,我们会程序分析 Importer 的 log,根据情况处理,如果哪部分数据出现了非预期的错误,会告警通知,人工介入,防止出现意外。
- Hive 生成表之后传输到 Nebula Server, 这部分任务 实际耗时是和 Hadoop 资源情况密切相关的,有可能会出现资源不够导致 Hive 和 CSV 表生成时间滞缓,而 Importer 正常在跑的情况,这部分需要提前做好预判。我们这边是根据hive任务结束时间和 Importer 任务开始时间做对比,判断是否需要 Importer 的进程正常运行。
边栏推荐
- Send and receive IBM WebSphere MQ messages
- 其他InterSystems %Net工具
- Is it safe to download the mobile version of Anxin securities and open an account online
- 6.26cf simulation match B: solution to array reduction problem
- ThreadLocal原理与使用
- 力扣刷题日记/day4/6.26
- Thawte通配符SSL证书提供的类型有哪些
- Wanghongru research group of Institute of genomics, Chinese Academy of Agricultural Sciences is cordially invited to join
- 一种将Tree-LSTM的强化学习用于连接顺序选择的方法
- 神经网络物联网应用技术就业前景【欢迎补充】
猜你喜欢

Halcon模板匹配
![[2022 Jiangxi graduate mathematical modeling] curling movement idea analysis and code implementation](/img/63/8d5f875b4409511628faf2914836d3.png)
[2022 Jiangxi graduate mathematical modeling] curling movement idea analysis and code implementation

Mxnet implementation of googlenet (parallel connection network)

Unity makes revolving door, sliding door, cabinet door drawer, click the effect of automatic door opening and closing, and automatically play the sound effect (with editor extension code)

Angry bird design based on unity

力扣刷题日记/day4/6.26

NBA赛事直播超清画质背后:阿里云视频云「窄带高清2.0」技术深度解读

一、C语言入门基础

奥迪AUDI EDI INVOIC发票报文详解

字节跳动Dev Better技术沙龙成功举办,携手华泰分享Web研发效能提升经验
随机推荐
[mathematical basis of machine learning] (I) linear algebra (Part 1 +)
2022 ByteDance daily practice experience (Tiktok)
Scala basic tutorial -- 18 -- set (2)
使用FTP
LD_ LIBRARY_ Path environment variable setting
【机器学习的数学基础】(一)线性代数(Linear Algebra)(上+)
How is the entered query SQL statement executed?
Blue bridge: sympodial plant
神经网络物联网应用技术学什么
【2022年江西省研究生数学建模】水汽过饱和的核化除霾 思路分析及代码实现
Journal des problèmes de brosse à boutons de force / day6 / 6.28
删除二叉搜索树中的节点附图详解
1、 Introduction to C language
[mathematical modeling of graduate students in Jiangxi Province in 2022] analysis and code implementation of haze removal by nucleation of water vapor supersaturation
How is the entered query SQL statement executed?
2022-07-04:以下go语言代码输出什么?A:true;B:false;C:编译错误。 package main import 'fmt' func
Li Kou brush question diary /day1/2022.6.23
File processing examples of fopen, FREAD, fwrite, fseek
Learning path PHP -- phpstudy "hosts file does not exist or is blocked from opening" when creating the project
Android uses sqliteopenhelper to flash back