Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

同步到99的时候redis-port报错了 #505

Closed
kmephistoh opened this issue Nov 2, 2015 · 5 comments
Closed

同步到99的时候redis-port报错了 #505

kmephistoh opened this issue Nov 2, 2015 · 5 comments

Comments

@kmephistoh
Copy link

2015/11/02 15:23:28 [INFO] total=4629937435 - 4627702533 [ 99%] entry=10023795
2015/11/02 15:23:29 [PANIC] select command error
[error]: ERR invalid DB index, only accept DB 0
[stack]:
1 /data/gowork/src/github.com/wandoulabs/redis-port/cmd/utils.go:187
main.selectDB
0 /data/gowork/src/github.com/wandoulabs/redis-port/cmd/sync.go:210
main.(_cmdSync).SyncRDBFile.func1.1
... ...
2015/11/02 15:23:29 [PANIC] select command error
[error]: ERR invalid DB index, only accept DB 0
[stack]:
1 /data/gowork/src/github.com/wandoulabs/redis-port/cmd/utils.go:187
main.selectDB
0 /data/gowork/src/github.com/wandoulabs/redis-port/cmd/sync.go:210
main.(_cmdSync).SyncRDBFile.func1.1
... ...
大概看了以前的issue,说是只能用db 0的,我们旧redis上有:

Keyspace

db0:keys=10038797,expires=9130,avg_ttl=104147533484
db8:keys=7,expires=7,avg_ttl=7526589

@spinlock
Copy link
Member

spinlock commented Nov 2, 2015

参考 CodisLabs/redis-port#9

这个需要你自己修改 redis-port 过滤掉有关 select db 的操作。

@kmephistoh
Copy link
Author

--filterdb=DB                     Filter db = DB, default is *.

这个参数不是用来选定待要同步的db的吗?假设我要同步db0,不同步db8:
nohup ./redis-port sync --ncpu=12 --filter=0 --from=192.168.1.227:6381 --target=192.168.1.73:19005 > 19005.log 2>&1 &
对吗?

@spinlock
Copy link
Member

spinlock commented Nov 2, 2015

这个参数用来选择db,忽略掉其他的db,如果你只同步 db = 0 这么做是 ok 的。

如果你打算将 db=8 选出来,并同步到 codis 的 db 0 中去,是需要改代码的。因为 --filterdb 这个参数只过滤,不替换 dbnum

@kmephistoh
Copy link
Author

我只用db0 ,db8是其它项目组的,这次不用导入。感谢的解答!

@spinlock
Copy link
Member

spinlock commented Nov 2, 2015

给个好评!谢谢 😄

@spinlock spinlock closed this as completed Nov 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants