zerotier / ZeroTierOne

A Smart Ethernet Switch for Earth
https://zerotier.com
Other
14.16k stars 1.65k forks source link

Can not orbit self-hosted moon node at latest ZerotierOne release version(1.12.2) #2197

Closed LiaoGuoYin closed 8 months ago

LiaoGuoYin commented 8 months ago
(base) mini:/Users/leocoin % sudo zerotier-cli listmoons               
[]
(base) mini:/Users/leocoin % sudo zerotier-cli orbit 0000006ac314xxx 0000006ac314xxx
404 orbit 
(base) mini:/Users/leocoin % sudo zerotier-cli status                                 
200 info f1b17b4xxx 1.12.1 ONLINE
(base) mini:/Users/leocoin % sudo zerotier-cli orbit 0000006ac314xxx 0000006ac314xxx
Password:
200 orbit OK
(base) mini:/Users/leocoin % sudo zerotier-cli status                                 
200 info f1b17bxxx 1.10.6 ONLINE
(base) mini:/Users/leocoin % sudo zerotier-cli listmoons                              
[
 {
  "id": "0000006axxx9a29",
  "roots": [
   {
    "identity": "6ac3149a29:0:706ceebfxxxfd7cc61141364767171cb5d100a18ab797c77e2751582a3c75e145d85313557eb19cf0356e1515c4e2f891805e0e5ed21abf5a60a797fd968f",
    "stableEndpoints": [
     "1.15.154.84/9993"
    ]
   }
  ],
  "signature": "35b6b5a14416eb7f6076661e28ab5cfef21171faa91c978397d4feb246efe77c245babfeb0461eb386850514e9281766bd2bf1e2e7b5dc7de3d516daaaf1c0xxx3f17031cd774fa85b1ef06bad44fd114b01cd79e822b40d48b3d2a267744",
  "timestamp": 1647928875152,
  "updatesMustBeSignedBy": "926b4f04b669af765bxxx6f6a080a5bbe40fa25aa8b7877c2aba2b98f7ce0b65d0e266b0036802f496afee1d0af04b02ed6b918922a111f9dc4b98c50ca36a",
  "waiting": false
 }
]
livelazily commented 8 months ago

Try to use this command: sudo zerotier-cli orbit (10bit-node-id) (10bit-node-id) The 10bit-node-id is the last 10 char of the moon id, such as 06ac314xxx

LiaoGuoYin commented 8 months ago

Try to use this command: sudo zerotier-cli orbit (10bit-node-id) (10bit-node-id) The 10bit-node-id is the last 10 char of the moon id, such as 06ac314xxx

Thanks for you reply.

I have already using the right moon-id, and I can confirm the moon-id I am using is right(see picture 1).

Because I can orbit it in old version ZeroTierOne(v1.10.6), But can not orbit in version(v1.12.2)

livelazily commented 8 months ago

Because I can orbit it in old version ZeroTierOne(v1.10.6), But can not orbit in version(v1.12.2)

The command line arguments seem to have changed, in v1.10.6 it can orbit the moon id(15 char long), but in v1.12.2, only the node id(10 char long) works

LiaoGuoYin commented 8 months ago

Thanks for your help!

I can orbit moon with the latest ZeroTierOne now by striming all '0' in moon-id, How did you know this?

In Docs didn't claim that, It only say:

"The first argument is the world ID (which we can shorten by removing the two leading zeroes) and the second is the address of any of its roots."

thjw81 commented 7 months ago

我今天运行sudo zerotier-cli orbit 000000f55755d5xxx.moon 000000f55755dxxx.moon同样出现了404 orbit的错误提示,而我使用的是最新的客户端,在openwrt和ubuntu上面的客户端加入moon的时候,都出现了同样的错误提示,使用的1.12.2版本。又上面网友提示去掉前面的6个前导0,依旧出现404 orbit,最后,只好把moon文件,直接复制到客户端/var/lib/zerotier-one/moods.d

thjw81 commented 7 months ago

又反复试验了几次,新的1.12.2版本,命令行应该这样写sudo zerotier-cli orbit f55755dxxx f55755dxxx ,也就是说,不要扩展名moon,也不要加000000。但是,我用旧的命令行,带000000和扩展名,zerotier-cli orbit 000000f55755dxxx.moon 000000f55755dxxx.moon 在旧版本zerotier-ver-1.10.2的vps中,仍然是成功的。

wufei-png commented 7 months ago

This error kan doesn't seem to have any effect on my normal use..

XinArkh commented 6 months ago

我今天运行sudo zerotier-cli orbit 000000f55755d5xxx.moon 000000f55755dxxx.moon同样出现了404 orbit的错误提示,而我使用的是最新的客户端,在openwrt和ubuntu上面的客户端加入moon的时候,都出现了同样的错误提示,使用的1.12.2版本。又上面网友提示去掉前面的6个前导0,依旧出现404 orbit,最后,只好把moon文件,直接复制到客户端/var/lib/zerotier-one/moods.d

openwrt中加入moon节点和普通linux系统不太一样,直接使用zerotier-cli orbit命令会报错404 orbit,而像前面的讨论那样在命令参数中去掉moon地址前面的0后,表面上看起来可以正常返回200 orbit OK了,但实际上并没有添加,不管使用zerotier-cli listmoons命令查看还是直接到/var/lib/zerotier-one/下都会发现并没有moon被添加进来。

正确做法应该是(参考这篇文章):

  1. vim /etc/config/zerotier,增加一行配置option config_path '/etc/zerotier',含义是声明配置文件地址在/etc/zerotier
  2. 在/etc下面新建两个嵌套的文件夹zerotier/moons.d/,并将moon配置文件手动复制到该路径下
  3. service zerotier restart

猜测openwrt中这么做的原因可能跟overlay的机制有关,如果直接复制moon文件到/var/lib/zerotier-one/,下次重启机器后配置可能就会丢失,所以通过这样的方式规避了一下