Pick of the Week'22 |第 12 周看点支持清空 Space 数据

每周看点

每周五 Nebula 为你播报每周看点,每周看点由固定模块:产品动态、社区问答、推荐阅读,和随机模块:本周大事件构成。

本周的产品动态里面“干货”满满,除了大家都能用到的 nGQL 新语句 CLEAR SPACE 清空 Space 数据之外,还有 2 个社区用户贡献的优秀 pr。除了硬核产品动态之外,本周的社区问答非常的柔软——贴近你的使用状态,它将详细带你了解如何进行 Nebula 账号密码的持久化设置。

本周大事件

Nebula Graph 与蓝象智联达成战略合作

近日,国产领先开源分布式图数据库 Nebula Graph 宣布与国内领先隐私计算服务商蓝象智联达成战略合作,联合打造隐私计算与图数据库的融合产品以及解决方案。

每周看点

未来双方将各自发挥在图技术和隐私计算技术上的优势,以高性能算力深化图联邦产品,进一步拓展隐私计算在各细分领域的场景落地能力。共同探索数据价值高效连接、流通、应用机制,助力产业基于数据驱动的数智化转型。

本次合作意味着 Nebula Graph 图数据库将作为隐私计算以及图联邦领域的底层解决方案被应用到金融、智能制造和通信等领域,这符合 Nebula Graph 作为数据智能时代基础设施构建者的定位。

产品动态

本周 Nebula 主要有这些产品动态:

社区问答

Pick of the Week 每周会从官方论坛、知乎、微信群、微信公众号及开源中国等渠道精选问题同你分享。

主题分享

本周分享的主题是【Nebula 账号密码持久化】,由社区用户 icefeng199 提出,Nebula 研发同学负责解答,原贴出自 Nebula 论坛:https://discuss.nebula-graph.com.cn/t/topic/7949

icefeng199:刚开始部署集群的时候修改过 root 密码,重启 Nebula Docker 集群后,root 密码被重置,怎么把密码持久化?有没有具体的配置项或者相关配置文件?

Nebula:在 compose yaml 文件里 cmd 中是配置 --enable_authorizetrue。具体操作如下:

修改配置,开启 auth

diff --git a/docker-compose.yaml b/docker-compose.yaml
index 316a7d9..b369643 100644
--- a/docker-compose.yaml
+++ b/docker-compose.yaml
@@ -230,6 +230,7 @@ services:
       - --log_dir=/logs
       - --v=0
       - --minloglevel=0
+      - --enable_authorize=true
     depends_on:
       - storaged0
       - storaged1
@@ -266,6 +267,7 @@ services:
       - --log_dir=/logs
       - --v=0
       - --minloglevel=0
+      - --enable_authorize=true
     depends_on:
       - storaged0
       - storaged1
@@ -301,6 +303,7 @@ services:
       - --ws_http_port=19669
       - --log_dir=/logs
       - --v=0
+      - --enable_authorize=true
       - --minloglevel=0
     depends_on:
       - storaged0

重启 graphd:

docker-compose up -d
WARNING: The Docker Engine you're using is running in swarm mode.

Compose does not use swarm mode to deploy services to multiple nodes in a swarm. All containers will be scheduled on the current node.

To deploy your application across the swarm, use `docker stack deploy`.

nebula-docker-compose_metad1_1 is up-to-date
nebula-docker-compose_metad2_1 is up-to-date
nebula-docker-compose_metad0_1 is up-to-date
nebula-docker-compose_storaged2_1 is up-to-date
nebula-docker-compose_storaged1_1 is up-to-date
nebula-docker-compose_storaged0_1 is up-to-date
Recreating nebula-docker-compose_graphd2_1 ... done
Recreating nebula-docker-compose_graphd1_1 ... done
Recreating nebula-docker-compose_graphd_1  ... done
Recreating nebula-docker-compose_console_1 ... done

修改密码:

❯ nebula-console-3.0 -addr nebula0 -port 9669 -user root -p nebula

Welcome to Nebula Graph!

(root@nebula) [(none)]> ALTER USER root WITH PASSWORD 'test';
Execution succeeded (time spent 1918/28389 us)

Thu, 17 Mar 2022 14:08:31 CST

(root@nebula) [(none)]>

Bye root!
Thu, 17 Mar 2022 14:08:34 CST

用错误密码登录:

❯ nebula-console-3.0 -addr nebula0 -port 9669 -user root -p nebula
2022/03/17 14:08:36 Fail to create a new session from connection pool, fail to authenticate, error: Invalid password
panic: Fail to create a new session from connection pool, fail to authenticate, error: Invalid password

goroutine 1 [running]:
log.Panicf(0x10518fda3, 0x35, 0x14000105e28, 0x1, 0x1)
	/opt/hostedtoolcache/go/1.16.4/x64/src/log/log.go:361 +0xa8
main.main()
	/home/runner/work/nebula-console/nebula-console/main.go:541 +0x8a4

用正确密码登录:

❯ nebula-console-3.0 -addr nebula0 -port 9669 -user root -p test

Welcome to Nebula Graph!

(root@nebula) [(none)]>

Bye root!
Thu, 17 Mar 2022 14:08:52 CST

杀掉旧的集群(但是数据还在,正常重启指的应该不是 down,而是 stop,我这个做的更大):

docker-compose down
Stopping nebula-docker-compose_console_1   ... done
Stopping nebula-docker-compose_graphd_1    ... done
Stopping nebula-docker-compose_graphd1_1   ... done
Stopping nebula-docker-compose_graphd2_1   ... done
Stopping nebula-docker-compose_storaged0_1 ... done
Stopping nebula-docker-compose_storaged2_1 ... done
Stopping nebula-docker-compose_storaged1_1 ... done
Stopping nebula-docker-compose_metad0_1    ... done
Stopping nebula-docker-compose_metad1_1    ... done
Stopping nebula-docker-compose_metad2_1    ... done
Removing nebula-docker-compose_console_1   ... done
Removing nebula-docker-compose_graphd_1    ... done
Removing nebula-docker-compose_graphd1_1   ... done
Removing nebula-docker-compose_graphd2_1   ... done
Removing nebula-docker-compose_storaged0_1 ... done
Removing nebula-docker-compose_storaged2_1 ... done
Removing nebula-docker-compose_storaged1_1 ... done
Removing nebula-docker-compose_metad0_1    ... done

再起来:

docker-compose up -d
WARNING: The Docker Engine you're using is running in swarm mode.

Compose does not use swarm mode to deploy services to multiple nodes in a swarm. All containers will be scheduled on the current node.

To deploy your application across the swarm, use `docker stack deploy`.

Creating network "nebula-docker-compose_nebula-net" with the default driver
Creating nebula-docker-compose_metad1_1 ... done
Creating nebula-docker-compose_metad2_1 ... done
Creating nebula-docker-compose_metad0_1 ... done
Creating nebula-docker-compose_storaged0_1 ... done
Creating nebula-docker-compose_storaged1_1 ... done
Creating nebula-docker-compose_storaged2_1 ... done
Creating nebula-docker-compose_graphd1_1   ... done
Creating nebula-docker-compose_graphd2_1   ... done
Creating nebula-docker-compose_graphd_1    ... done
Creating nebula-docker-compose_console_1   ... done

测试密码持久化:

❯ nebula-console-3.0 -addr nebula0 -port 9669 -user root -p test

Welcome to Nebula Graph!

(root@nebula) [(none)]>

Bye root!
Thu, 17 Mar 2022 14:09:31 CST


~
❯ nebula-console-3.0 -addr nebula0 -port 9669 -user root -p test1
2022/03/17 14:09:32 Fail to create a new session from connection pool, fail to authenticate, error: Invalid password
panic: Fail to create a new session from connection pool, fail to authenticate, error: Invalid password

goroutine 1 [running]:
log.Panicf(0x100acfda3, 0x35, 0x140000a9e28, 0x1, 0x1)
	/opt/hostedtoolcache/go/1.16.4/x64/src/log/log.go:361 +0xa8
main.main()
	/home/runner/work/nebula-console/nebula-console/main.go:541 +0x8a4

以上。

推荐阅读

星云·小剧场

为什么给图数据库取名 Nebula

Nebula 是星云的意思,很大嘛,也是漫威宇宙里面漂亮的星云小姐姐。对了,Nebula 的发音是:[ˈnɛbjələ]

本文星云图讲解–《NGC 6543》

NGC 6543

并非因猎鹰九号火箭在日落后发射而形成的猫眼星云(NGC 6543),是天空最著名的行星状星云之一。在这张经过特殊处理,以呈现绵延超过 3 光年、庞大但极为昏暗外晕的组合影像里,形状对称且吸睛的星云位在中心。

影像提供与版权:M. Petrasko, M. Evenden, U. Mishra (Insight Obs.)
作者与编辑:Robert Nemiroff (MTU) & Jerry Bonnell (UMCP)


交流图数据库技术?加入 Nebula 交流群请先填写下你的 Nebula 名片,Nebula 小助手会拉你进群~~

关注公众号


这是一个从 https://nebula-graph.com.cn/posts/nebula-graph-weekly-pickup-2022-03-18/ 下的原始话题分离的讨论话题