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

请问可以在readme里写下安装过程吗 #9

Closed
tydldd opened this issue Oct 9, 2015 · 24 comments
Closed

请问可以在readme里写下安装过程吗 #9

tydldd opened this issue Oct 9, 2015 · 24 comments

Comments

@tydldd
Copy link

tydldd commented Oct 9, 2015

网上很少写如何安装redis-port的。希望可一附加安装过程。

@yangzhe1991
Copy link
Member

https://golang.org/dl/
直接下载安装即可

@tydldd
Copy link
Author

tydldd commented Oct 10, 2015

我不是说go安装,是说redis-port

@yangzhe1991
Copy link
Member

不需要安装,编译完执行对应命令就行

2015年10月10日星期六,tydldd notifications@github.com 写道:

我不是说go安装,是说redis-port


Reply to this email directly or view it on GitHub
#9 (comment)
.

Thanks,
Phil Yang

@tydldd
Copy link
Author

tydldd commented Oct 10, 2015

@yangzhe1991 ,我是用go get 把redis-port下载下来,自动放到了/usr/local/codis/src/github.com/wandoulabs/redis-port这个路径下。
然后我用进入目录下执行make就报错:
go build -o bin/redis-port ./cmd
pkg/rdb/decoder.go:9:2: cannot find package "github.com/cupcake/rdb" in any of:
/usr/local/go/src/github.com/cupcake/rdb (from $GOROOT)
/usr/local/codis/src/github.com/cupcake/rdb (from $GOPATH)
pkg/rdb/decoder.go:10:2: cannot find package "github.com/cupcake/rdb/nopdecoder" in any of:
/usr/local/go/src/github.com/cupcake/rdb/nopdecoder (from $GOROOT)
/usr/local/codis/src/github.com/cupcake/rdb/nopdecoder (from $GOPATH)
make: *** [build] Error 1

错误里说的cupcake/rdb这个目录是怎么产生?现在没有。

@yangzhe1991
Copy link
Member

缺少github.com/cupcake/rdb 这个库,用go get github.com/cupcake/rdb 来下载

2015-10-10 13:44 GMT+08:00 tydldd notifications@github.com:

@yangzhe1991 https://github.com/yangzhe1991 ,我是用go get
把redis-port下载下来,自动放到了/usr/local/codis/src/github.com/wandoulabs/redis-port
这个路径下。
然后我用进入目录下执行make就报错:
go build -o bin/redis-port ./cmd
pkg/rdb/decoder.go:9:2: cannot find package "github.com/cupcake/rdb" in
any of:
/usr/local/go/src/github.com/cupcake/rdb (from $GOROOT)
/usr/local/codis/src/github.com/cupcake/rdb (from $GOPATH)
pkg/rdb/decoder.go:10:2: cannot find package "
github.com/cupcake/rdb/nopdecoder" in any of:
/usr/local/go/src/github.com/cupcake/rdb/nopdecoder (from $GOROOT)
/usr/local/codis/src/github.com/cupcake/rdb/nopdecoder (from $GOPATH)
make: *** [build] Error 1

错误里说的cupcake/rdb这个目录是怎么产生?现在没有。


Reply to this email directly or view it on GitHub
#9 (comment)
.

Thanks,
Phil Yang

@tydldd
Copy link
Author

tydldd commented Oct 10, 2015

@yangzhe1991
Copy link
Member

就是缺啥都用go get下载依赖的库就行

@tydldd
Copy link
Author

tydldd commented Oct 10, 2015

嗯,装好了,我试了一下。是不是必须指定--filterdb这个属性啊,指定的话,只能指定0吧,当时 原来的redis数据放在1里了。那样就不能同步了吧。
第二个问题:数据命名导完了。还在一直:
image
这是什么情况呢

@spinlock
Copy link
Member

  1. filterdb 是指将 master 中的对应 db 下的数据同步到 slave 的 db,所以你这种情况,应该用 --filterdb=1,参见 多 DB 的 port #8
  2. 为什么不停止,可以看这个 redis-port导入数据报错 codis#318

@tydldd
Copy link
Author

tydldd commented Oct 10, 2015

原生redis导入到codis
./redis-port sync --ncpu 2 --from=c-api.chinacloudapp.cn:6388 --password=Simple --filterdb=1 --target localhost:9000 --auth=Simple

提示:
2015/10/10 08:27:31 [INFO] rdb file = 274095
2015/10/10 08:27:31 [PANIC] select command error
[error]: ERR invalid DB index, only accept DB 0
[stack]:
1 /usr/local/codis/src/github.com/wandoulabs/redis-port/cmd/utils.go:187
main.selectDB
0 /usr/local/codis/src/github.com/wandoulabs/redis-port/cmd/sync.go:210
main.(*cmdSync).SyncRDBFile.func1.1
... ...

@spinlock
Copy link
Member

@tydldd 对不起,我自己都给乱了。。我修改了刚刚的回答。很抱歉。

你可以修改 redis-port 代码,注释掉下面这行,就可以了。
https://github.com/wandoulabs/redis-port/blob/master/cmd/sync.go#L210

很抱歉。

@tydldd
Copy link
Author

tydldd commented Oct 10, 2015

那其实从master的1同步到codis中的0是不能实现的是吗。codis只支持0

@spinlock
Copy link
Member

是的,需要你注释掉 L210 那行,然后重新 make 生成可执行文件,原因在 #8 里面讲了。

@tydldd
Copy link
Author

tydldd commented Oct 10, 2015

@spinlock 重新make后成功了。多谢

@heroliy
Copy link

heroliy commented Oct 14, 2015

有支持 redis cluster 迁移到codis的方法吗?貌似这个不支持

@heroliy
Copy link

heroliy commented Oct 14, 2015

@spinlock 有支持 redis cluster 迁移到codis的方法吗?貌似这个不支持, 好像可以修改redis port 连接方式,把redis 连接方式改成 redis cluster 就可以,但是我不熟悉go

@yangzhe1991
Copy link
Member

绕开cluster层,把里面的节点逐个执行迁移操作?

@yangzhe1991
Copy link
Member

另外,如果还有问题的话,建议开个新的issue,因为和本话题无关了

@heroliy
Copy link

heroliy commented Oct 14, 2015

我就是一个节点执行的,不OK

@yangzhe1991
Copy link
Member

#10 那讨论吧

@qinming23
Copy link

make报如下错误是什么原因?
make
go build -i -o bin/redis-port ./cmd

_/opt/src/redis-port/cmd

cmd/decode.go:30: cmd.rbytes.Get undefined (type "github.com/CodisLabs/codis/pkg/utils/sync2/atomic2".Int64 has no field or method Get)
cmd/decode.go:31: cmd.wbytes.Get undefined (type "github.com/CodisLabs/codis/pkg/utils/sync2/atomic2".Int64 has no field or method Get)
cmd/decode.go:32: cmd.nentry.Get undefined (type "github.com/CodisLabs/codis/pkg/utils/sync2/atomic2".Int64 has no field or method Get)
cmd/dump.go:78: nread.Get undefined (type "github.com/CodisLabs/codis/pkg/utils/sync2/atomic2".Int64 has no field or method Get)
cmd/dump.go:79: nread.Get undefined (type "github.com/CodisLabs/codis/pkg/utils/sync2/atomic2".Int64 has no field or method Get)
cmd/dump.go:92: nread.Get undefined (type "github.com/CodisLabs/codis/pkg/utils/sync2/atomic2".Int64 has no field or method Get)
cmd/dump.go:112: nread.Get undefined (type "github.com/CodisLabs/codis/pkg/utils/sync2/atomic2".Int64 has no field or method Get)
cmd/restore.go:34: cmd.rbytes.Get undefined (type "github.com/CodisLabs/codis/pkg/utils/sync2/atomic2".Int64 has no field or method Get)
cmd/restore.go:35: cmd.ebytes.Get undefined (type "github.com/CodisLabs/codis/pkg/utils/sync2/atomic2".Int64 has no field or method Get)
cmd/restore.go:36: cmd.nentry.Get undefined (type "github.com/CodisLabs/codis/pkg/utils/sync2/atomic2".Int64 has no field or method Get)
cmd/restore.go:36: too many errors
make: *** [redis-port] Error 2
我的系统是centos 7.2 ,go安装的是go version go1.8.1 linux/amd64
go get github.com/cupcake
go get github.com/CodisLabs
go get github.com/docopt/docopt-go
go get github.com/garyburd/redigo/redis
安装了以上这些依赖包,依赖包自动安装在root家目录下了。redis-port放在/usr/local/codis/src/github.com/wandoulabs/redis-port/

@BingerCoder
Copy link

楼上说的是什么问题

@snailshen2014
Copy link

pkg/rdb/cgo_redis.h:1:10: fatal error: 'redis/src/server.h' file not found
编译包这个错误,

@code-less-hub
Copy link

pkg/rdb/cgo_redis.h:1:10: fatal error: 'redis/src/server.h' file not found
编译包同样这个错误

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

8 participants