nebula ssl配置失败

  • nebula 版本:3.2.1
  • 部署方式: 分布式
  • 安装方式:RPM
  • 是否上生产环境 N
  • 硬件信息
    • 磁盘( 推荐使用 SSD)
    • CPU、内存信息
      在分布式集群上配置为了启用ssl,在nebula-graphd.conf中进行以下配置
########## ssl ##########
--cert_path=/data/cloudera/parcels/nebula/nebula-graph-3.2.0.el7.x86_64/ssl/nebula.crt
--key_path=/data/cloudera/parcels/nebula/nebula-graph-3.2.0.el7.x86_64/ssl/nebula.key
--password_path=/data/cloudera/parcels/nebula/nebula-graph-3.2.0.el7.x86_64/ssl/password.txt
--enable_graph_ssl=true

启动nebula之后出现问题,graph info 日志信息如下:

I20230505 16:11:42.536926 29955 GraphServer.cpp:59] Starting nebula-graphd on xxxxxx:9669
E20230505 16:11:42.544649 29955 ThriftServer.cpp:547] Got an exception while setting up the server: Failed to read private key from file: /data/cloudera/parcels/nebula/nebula-graph-3.2.0.el7.x86_64/ssl/nebula.key, password file: /data/cloudera/parcels/nebula/nebula-graph-3.2.0.el7.x86_64/ssl/password.txtFailed to load cert or key at key path /data/cloudera/parcels/nebula/nebula-graph-3.2.0.el7.x86_64/ssl/nebula.key, cert path /data/cloudera/parcels/nebula/nebula-graph-3.2.0.el7.x86_64/ssl/nebula.crt
E20230505 16:11:42.544689 29955 GraphServer.cpp:63] Exception thrown while starting the graph RPC server: Failed to read private key from file: /data/cloudera/parcels/nebula/nebula-graph-3.2.0.el7.x86_64/ssl/nebula.key, password file: /data/cloudera/parcels/nebula/nebula-graph-3.2.0.el7.x86_64/ssl/password.txtFailed to load cert or key at key path /data/cloudera/parcels/nebula/nebula-graph-3.2.0.el7.x86_64/ssl/nebula.key, cert path /data/cloudera/parcels/nebula/nebula-graph-3.2.0.el7.x86_64/ssl/nebula.crt
I20230505 16:11:42.544703 29955 GraphServer.cpp:66] nebula-graphd on xxxxx:9669 has been stopped

检查过了文件路径没有问题,并且文件的读取权限是开放了的,真的找不到问题在哪了,爆哭

求助 @Aiee

另外 ls -l /data/cloudera/parcels/nebula/nebula-graph-3.2.0.el7.x86_64/ssl/ 看看?

(root)[t-qcbj5-hadoop-presto-gw-001]{/data/cloudera/parcels/nebula/nebula-graph-3.2.0.el7.x86_64/ssl}$ ls -all
total 12
drwxr-xr-x 2 root root 62 May 5 14:45 .
drwxr-xr-x 10 root root 121 May 5 14:44 …
-rw-rw-rw- 1 root root 1342 May 5 14:44 nebula.crt
-rw-rw-rw- 1 root root 1834 May 5 14:44 nebula.key
-rw-rw-rw- 1 root root 12 May 5 14:45 password.txt

虽然和报错的说法不同,我感觉可能是权限太高了,你用 644 试试呢?

chmod 644 /data/cloudera/parcels/nebula/nebula-graph-3.2.0.el7.x86_64/ssl/*

参考 repo 里 test cert 的权限

~/dev/nebula master ⇣
❯ ll tests/cert/
total 88
-rw-r--r--@ 1 weyl  staff   1.3K Apr  7 10:59 test.2.crt
-rw-r--r--@ 1 weyl  staff   1.1K Apr  7 10:59 test.2.csr
-rw-r--r--@ 1 weyl  staff   1.8K Apr  7 10:59 test.2.key
-rw-r--r--@ 1 weyl  staff     6B Apr  7 10:59 test.2.password
-rw-r--r--  1 weyl  staff   1.7K Nov  8  2021 test.ca.key
-rw-r--r--  1 weyl  staff     6B Jan 19  2022 test.ca.password
-rw-r--r--  1 weyl  staff   1.4K Nov  8  2021 test.ca.pem
-rw-r--r--  1 weyl  staff    41B Nov  8  2021 test.ca.srl
-rw-r--r--  1 weyl  staff   1.3K Nov  8  2021 test.derive.crt
-rw-r--r--  1 weyl  staff   1.1K Nov  8  2021 test.derive.csr
-rw-r--r--  1 weyl  staff   1.6K Nov  8  2021 test.derive.key

~/dev/nebula master ⇣
❯ ll tests/ | grep cert
drwxr-xr-x  13 weyl  staff   416B Apr  7 10:59 cert

遇到了同样的版本遇到了同样的问题。不知道是不是openssl生成证书的方式不对。社区有相关的用openssl生成可用CA签名证书的指导不?。谢谢。

我写了一个简单的 gist 的 shell,看看你能用不

https://gist.github.com/HarrisChu/04e0ff63b1da42ec6e75ac16fd2adfa1

2 个赞

可以参考 @HarrisChu 的 openssl 的脚步,不限于 openssl 的话可以试试用 https://github.com/FiloSottile/mkcert

1 个赞

感谢大佬,可以启动了。

给像我这样的ssl纯小白一点补充。HarrisChu提供的脚本里
[ dn ]
C = CH
O = test-ca
CN = root

CN(Common Name)的值在生成server 或者client证书时需要修改为其他的值(例如就分别用server ,client)避免与CA 也就是(root.crt)使用的CN冲突导致认证失败。

再次感谢大佬们的指导。

3 个赞

此话题已在最后回复的 7 天后被自动关闭。不再允许新回复。