br 备份报错

nebula 版本:3.1.0
部署方式:单机
安装方式:RPM
是否为线上版本:Y

br 下载的 是官网 → br 资源

问题描述:启动 graph meta storage
启动agent: ./agent --agent=“127.0.0.1:8888” --meta=“127.0.0.1:9559”
数据备份:./bin/br backup full --meta “192.168.1.195:9559” --storage “local:///mnt/hgfs/Vmware_Share_Dir/nebulagraph/centros7/br/bakup” 报错

相关的日志:
{“file”:“github.com/vesoft-inc/nebula-br/pkg/clients/utils.go:20",“func”:“github.com/vesoft-inc/nebula-br/pkg/clients.connect”,“level”:“info”,"meta address”:“192.168.1.195:9559”,“msg”:“Try to connect meta service.”,“time”:“2022-07-06T01:28:36.849Z”}
{“file”:“github.com/vesoft-inc/nebula-br/pkg/clients/utils.go:44",“func”:“github.com/vesoft-inc/nebula-br/pkg/clients.connect”,“level”:“info”,"meta address”:“192.168.1.195:9559”,“msg”:“Connect meta server successfully.”,“time”:“2022-07-06T01:28:36.862Z”}
{“file”:“github.com/vesoft-inc/nebula-br/pkg/clients/utils.go:20",“func”:“github.com/vesoft-inc/nebula-br/pkg/clients.connect”,“level”:“info”,"meta address”:“127.0.0.1:9559”,“msg”:“Try to connect meta service.”,“time”:“2022-07-06T01:28:36.872Z”}
{“file”:“github.com/vesoft-inc/nebula-br/pkg/clients/utils.go:44",“func”:“github.com/vesoft-inc/nebula-br/pkg/clients.connect”,“level”:“info”,"meta address”:“127.0.0.1:9559”,“msg”:“Connect meta server successfully.”,“time”:“2022-07-06T01:28:36.875Z”}
{“file”:“github.com/vesoft-inc/nebula-br/pkg/utils/hosts.go:76",“func”:"github.com/vesoft-inc/nebula-br/pkg/utils.(*NebulaHosts).LoadFrom”,“host info”:“map[127.0.0.1:127.0.0.1:9779[STORAGE]: (data: /mnt/hgfs/Vmware_Share_Dir/nebulagraph/centros7/install_dir/nebula/data/storage, root: /mnt/hgfs/Vmware_Share_Dir/nebulagraph/centros7/install_dir/nebula) | 127.0.0.1:8888[AGENT]: (data: , root: ) | 127.0.0.1:9669[GRAPH]: (data: , root: /mnt/hgfs/Vmware_Share_Dir/nebulagraph/centros7/install_dir/nebula) | 127.0.0.1:9559[META]: (data: /mnt/hgfs/Vmware_Share_Dir/nebulagraph/centros7/install_dir/nebula/data/meta, root: /mnt/hgfs/Vmware_Share_Dir/nebulagraph/centros7/install_dir/nebula)]”,“level”:“info”,“msg”:“Get cluster topology from the nebula.”,“time”:“2022-07-06T01:28:36.876Z”}
Start to backup cluster…
{“backup info”:“map[all spaces:false backup name: backups: created time:1969-12-31 16:00:00 -0800 PST full backup:false meta files:]”,“file”:“github.com/vesoft-inc/nebula-br/pkg/backup/backup.go:161",“func”:"github.com/vesoft-inc/nebula-br/pkg/backup.(*Backup).Backup”,“level”:“info”,“msg”:“Create backup in nebula machine’s local.”,“name”:"",“time”:“2022-07-06T01:28:36.983Z”}
{“file”:“github.com/vesoft-inc/nebula-br/pkg/backup/backup.go:172",“func”:"github.com/vesoft-inc/nebula-br/pkg/backup.(*Backup).Backup”,“level”:“info”,“msg”:“Ensure backup root dir.”,“name”:"",“root”:“local:///mnt/hgfs/Vmware_Share_Dir/nebulagraph/centros7/br/bakup”,“time”:“2022-07-06T01:28:36.986Z”}
Backup failed, will try to clean the remaining garbage…
Error: there is no meta files in backup info
Usage:
br backup full [flags]

Flags:
-h, --help help for full

Global Flags:
–debug Output log in debug level or not
–log string Specify br detail log path (default “br.log”)
–meta string Specify meta server
–s3.access_key string S3 Option: set access key id
–s3.endpoint string S3 Option: set the S3 endpoint URL, please specify the http or https scheme explicitly
–s3.region string S3 Option: set region or location to upload or download backup
–s3.secret_key string S3 Option: set secret key for access id
–spaces stringArray (EXPERIMENTAL)space names.
By this option, user can specify which spaces to backup. Now this feature is still experimental.
If not specified, will backup all spaces.

  --storage string         backup target url, format: <SCHEME>://<PATH>.
                               <SCHEME>: a string indicating which backend type. optional: local, s3.
                               now only s3-compatible is supported.
                               example:
                               for local - "local:///the/local/path/to/backup"
                               for s3  - "s3://example/url/to/the/backup"

panic: there is no meta files in backup info

goroutine 1 [running]:
main.main()
./main.go:16 +0x105

这里做了一个隐含的假设 agent 的 host 和 服务要匹配,这里 meta 用的 192 的网段,agent 也要用这个网段哈。

弄好之后确定

show hosts meta
show hosts graph
show hosts storage

这三个结果的所有host 的 host 部分在

show hosts agent 里都有才行,比如一个是127.0.0.1 另一个是192.x.y.z 就不行了哈。

三个服务的配置文件相关的ip 我把127.0.0.1 都改成了 192.168.x.x, agent 启动也改成了实际192.168.x.x
还是报同样的错误


日志信息:

show agent 那个 里面有个 127.0.0.1 不知道那个是不是有问题, drop hosts drop 不掉

卸载了重新安装了一下, 全都统一成 192.168.x.x 这样的了, 还是不行





执行日志

你好,看日志这是另外一个错误了,想问下集群上存在space吗,如果没有的话可以先创建一个再执行backup

有了

执行还是报错

那个 --storage 的local path 是正确存在的路径的哈?看你写成了 bakup,meta文件不存在的报错我还不熟悉,好像是 meta 创建备份完了还是空的造成的? @kqzh

	if len(backupInfo.GetMetaFiles()) == 0 {
		return backupName, fmt.Errorf("there is no meta files in backup info")
	}
func (m *NebulaMeta) CreateBackup(spaces []string) (*meta.CreateBackupResp, error) {
	req := meta.NewCreateBackupReq()

	req.Spaces = make([][]byte, 0, len(spaces))
	for _, space := range spaces {
		req.Spaces = append(req.Spaces, []byte(space))
	}

	for {
		resp, err := m.client.CreateBackup(req)
		if err != nil {
			return nil, err
		}

		if resp.GetCode() == nebula.ErrorCode_E_LEADER_CHANGED {
			err := m.reconnect(resp.GetLeader())
			if err != nil {
				return nil, err
			}
			continue
		}

		return resp, nil
	}

}

这个问题一般是space没创建导致的,我之前遇到过一次特殊的,可能是进程权限问题导致的,可以查看下meta 和 storage服务,是什么用户启动的

1 个赞

奥奥 对 进程没有写权限也可能

看了一下, 是root 用户启动的

我的再我的虚拟机里安装 配置的路径 我都整到一个文件夹下面了, 我看那个系统运行日志 可以正常刷新, 备份的那个目录 , 进程对他 读写应该没问题吧, 备份的那个还是 空文件夹

目前我看还是在包同样的 错

Error: there is no meta files in backup info

我看你给的路径还是 bakup 不是 backup

Screen Shot 2022-07-13 at 5.24.16 PM

而你创建的目录是 backup

- bakup
+ backup

那个也改过了, 路径复制粘贴过去的

@kqzh 有更多思路么?存在space,backupInfo.GetMetaFiles()) 还是空的:sob:

@lipinbo 可以把旧的space删了,重新创建一个space试一试哈,我怀疑是那个space有点问题,如果还是不行,可以请存储的同学帮忙看一下

1 个赞

删除所有图空间,

重新创建

重新br 备份, 还是同样的报错信息