vesoft-inc / nebula-br

Backup and restore utility for Nebula Graph
Apache License 2.0
14 stars 11 forks source link

Restore assumed br-cli execution user to be root? #17

Open wey-gu opened 3 years ago

wey-gu commented 3 years ago

It seems br-cli assumed br-cli execution user to be root, otherwise, it failed during the phase of scp -r files_to_cluster_node.

I am not 100% sure if this is the root cause while when I was trying to reproduce the same scp call from the error(1), the only error I could reproduce is when I do it w/o root user and it complained permission was denied. And after I switch to the root user, it succeeded.

If this is the case, it could be improved by calling scp -r <backup> {user}@node:foo instead of the current scp -r <backup> node:foo, right as --user was specified already?

If this is not the case, please ignore it and close it, thanks :)

1:

{"level":"info","ts":1629268056.5679834,"caller":"remote/ssh.go:104","msg":"ssh will exec","addr":"127.0.0.1","cmd":"scp -r  192.168.8.127:/home/wei.gu/br-test/BACKUP_2021_08_18_06_15_17/meta/__indexes__.sst 192.168.8.127:/home/wei.gu/br-test/BACKUP_2021_08_18_06_15_17/meta/__tags__.sst 192.168.8.127:/home/wei.gu/br-test/BACKUP_2021_08_18_06_15_17/meta/__parts__.sst 192.168.8.127:/home/wei.gu/br-test/BACKUP_2021_08_18_06_15_17/meta/__edges__.sst 192.168.8.127:/home/wei.gu/br-test/BACKUP_2021_08_18_06_15_17/meta/__spaces__.sst 192.168.8.127:/home/wei.gu/br-test/BACKUP_2021_08_18_06_15_17/meta/__configs__.sst 192.168.8.127:/home/wei.gu/br-test/BACKUP_2021_08_18_06_15_17/meta/__id__.sst 192.168.8.127:/home/wei.gu/br-test/BACKUP_2021_08_18_06_15_17/meta/__users__.sst 192.168.8.127:/home/wei.gu/br-test/BACKUP_2021_08_18_06_15_17/meta/__index__.sst  /usr/local/nebula/data/meta","user":"root"}

2:

# ./bin/br restore full --meta "192.168.8.127:9559" --storage "local:///home/wei.gu/br-test" --name "BACKUP_2021_08_18_06_15_17" --user "root"