diff --git a/.travis.yml b/.travis.yml index d1fff13b4..a3c781dad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,12 @@ language: go +env: + - GO15VENDOREXPERIMENT=0 + go: - - 1.4.2 - - 1.5.1 + - 1.4.3 + - 1.5.3 + - 1.6 install: - make diff --git a/Dockerfile b/Dockerfile index 6edd98360..14fe18b78 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,12 +4,12 @@ MAINTAINER goroutine@126.com RUN apt-get update -y # Add codis -Add . /go/src/github.com/wandoulabs/codis/ -WORKDIR /go/src/github.com/wandoulabs/codis/ +Add . /go/src/github.com/CodisLabs/codis/ +WORKDIR /go/src/github.com/CodisLabs/codis/ # Install dependency RUN ./bootstrap.sh -WORKDIR /go/src/github.com/wandoulabs/codis/sample +WORKDIR /go/src/github.com/CodisLabs/codis/sample # Expose ports EXPOSE 19000 diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index be4849312..2c7e90501 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -1,5 +1,5 @@ { - "ImportPath": "github.com/wandoulabs/codis", + "ImportPath": "github.com/CodisLabs/codis", "GoVersion": "go1.4.2", "Packages": [ "./..." diff --git a/MIT-LICENSE.txt b/MIT-LICENSE.txt index 23320dcb4..c0ca99188 100644 --- a/MIT-LICENSE.txt +++ b/MIT-LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014 Wandoujia Inc. +Copyright (c) 2016 CodisLabs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Makefile b/Makefile index 66c02fd6c..a1374f809 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ build: build-version godep build-proxy build-config build-server godep: @go get -u github.com/tools/godep - GOPATH=`godep path` godep restore + GO15VENDOREXPERIMENT=0 GOPATH=`godep path` godep restore build-version: @bash genver.sh diff --git a/README.md b/README.md index 78bf14db9..937522f74 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -#Codis - Redis cluster solution supporting pipeline and scaling dynamically + -[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/wandoulabs/codis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -[![Build Status](https://travis-ci.org/wandoulabs/codis.svg)](https://travis-ci.org/wandoulabs/codis) +[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/CodisLabs/codis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![Build Status](https://travis-ci.org/CodisLabs/codis.svg)](https://travis-ci.org/CodisLabs/codis) -Codis is a proxy based high performance Redis cluster solution written in Go. It is production-ready and widely used at [wandoujia.com](http://wandoujia.com) and many companies. You can see [Codis Releases](https://github.com/wandoulabs/codis/releases) for latest and most stable realeases. +Codis is a proxy based high performance Redis cluster solution written in Go. It is production-ready and widely used at [wandoujia.com](http://wandoujia.com) and many companies. You can see [Codis Releases](https://github.com/CodisLabs/codis/releases) for latest and most stable realeases. ##Compared with Twemproxy and Redis Cluster @@ -23,18 +23,18 @@ Codis is a proxy based high performance Redis cluster solution written in Go. It ## Tutorial -[简体中文](https://github.com/wandoulabs/codis/blob/master/doc/tutorial_zh.md) -[English](https://github.com/wandoulabs/codis/blob/master/doc/tutorial_en.md) +[简体中文](doc/tutorial_zh.md) +[English](doc/tutorial_en.md) ## FAQ -[简体中文](https://github.com/wandoulabs/codis/blob/master/doc/FAQ_zh.md) -[English (WIP) ](https://github.com/wandoulabs/codis/blob/master/doc/FAQ_en.md) +[简体中文](doc/FAQ_zh.md) +[English (WIP) ](doc/FAQ_en.md) ## High Availability -[简体中文](https://github.com/wandoulabs/codis/blob/master/doc/tutorial_zh.md#ha) -[English](https://github.com/wandoulabs/codis/blob/master/doc/tutorial_en.md#ha) +[简体中文](doc/tutorial_zh.md#ha) +[English](doc/tutorial_en.md#ha) ## Architecture diff --git a/cmd/cconfig/action.go b/cmd/cconfig/action.go index 2ec0a6c1b..89b1ccfeb 100644 --- a/cmd/cconfig/action.go +++ b/cmd/cconfig/action.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main @@ -9,8 +9,8 @@ import ( "github.com/docopt/docopt-go" - "github.com/wandoulabs/codis/pkg/utils/errors" - "github.com/wandoulabs/codis/pkg/utils/log" + "github.com/CodisLabs/codis/pkg/utils/errors" + "github.com/CodisLabs/codis/pkg/utils/log" ) func cmdAction(argv []string) (err error) { diff --git a/cmd/cconfig/dashboard.go b/cmd/cconfig/dashboard.go index f79941c6e..fa74b25d9 100644 --- a/cmd/cconfig/dashboard.go +++ b/cmd/cconfig/dashboard.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main @@ -20,10 +20,10 @@ import ( "github.com/martini-contrib/cors" "github.com/wandoulabs/zkhelper" - "github.com/wandoulabs/codis/pkg/models" - "github.com/wandoulabs/codis/pkg/utils" - "github.com/wandoulabs/codis/pkg/utils/errors" - "github.com/wandoulabs/codis/pkg/utils/log" + "github.com/CodisLabs/codis/pkg/models" + "github.com/CodisLabs/codis/pkg/utils" + "github.com/CodisLabs/codis/pkg/utils/errors" + "github.com/CodisLabs/codis/pkg/utils/log" ) func cmdDashboard(argv []string) (err error) { diff --git a/cmd/cconfig/dashboard_apis.go b/cmd/cconfig/dashboard_apis.go index ad1138932..1a44028fe 100644 --- a/cmd/cconfig/dashboard_apis.go +++ b/cmd/cconfig/dashboard_apis.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main @@ -15,9 +15,9 @@ import ( "github.com/wandoulabs/go-zookeeper/zk" "github.com/wandoulabs/zkhelper" - "github.com/wandoulabs/codis/pkg/models" - "github.com/wandoulabs/codis/pkg/utils" - "github.com/wandoulabs/codis/pkg/utils/log" + "github.com/CodisLabs/codis/pkg/models" + "github.com/CodisLabs/codis/pkg/utils" + "github.com/CodisLabs/codis/pkg/utils/log" ) var globalMigrateManager *MigrateManager diff --git a/cmd/cconfig/env.go b/cmd/cconfig/env.go index 1f79b6cae..d04c1c32f 100644 --- a/cmd/cconfig/env.go +++ b/cmd/cconfig/env.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main @@ -11,8 +11,8 @@ import ( "github.com/wandoulabs/zkhelper" - "github.com/wandoulabs/codis/pkg/utils/errors" - "github.com/wandoulabs/codis/pkg/utils/log" + "github.com/CodisLabs/codis/pkg/utils/errors" + "github.com/CodisLabs/codis/pkg/utils/log" ) type Env interface { diff --git a/cmd/cconfig/main.go b/cmd/cconfig/main.go index 75ecef01c..b36788100 100644 --- a/cmd/cconfig/main.go +++ b/cmd/cconfig/main.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main @@ -16,9 +16,9 @@ import ( "github.com/c4pt0r/cfg" "github.com/docopt/docopt-go" - "github.com/wandoulabs/codis/pkg/utils/errors" - "github.com/wandoulabs/codis/pkg/utils/log" - "github.com/wandoulabs/codis/pkg/utils" + "github.com/CodisLabs/codis/pkg/utils/errors" + "github.com/CodisLabs/codis/pkg/utils/log" + "github.com/CodisLabs/codis/pkg/utils" ) // global objects diff --git a/cmd/cconfig/migrate_manager.go b/cmd/cconfig/migrate_manager.go index 37c2863a7..84e4cf7d2 100644 --- a/cmd/cconfig/migrate_manager.go +++ b/cmd/cconfig/migrate_manager.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main @@ -13,7 +13,7 @@ import ( "github.com/wandoulabs/go-zookeeper/zk" "github.com/wandoulabs/zkhelper" - "github.com/wandoulabs/codis/pkg/utils/log" + "github.com/CodisLabs/codis/pkg/utils/log" ) const ( diff --git a/cmd/cconfig/migrate_task.go b/cmd/cconfig/migrate_task.go index eb887978d..6d71f86da 100644 --- a/cmd/cconfig/migrate_task.go +++ b/cmd/cconfig/migrate_task.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main @@ -10,10 +10,10 @@ import ( "github.com/wandoulabs/zkhelper" - "github.com/wandoulabs/codis/pkg/models" - "github.com/wandoulabs/codis/pkg/utils" - "github.com/wandoulabs/codis/pkg/utils/errors" - "github.com/wandoulabs/codis/pkg/utils/log" + "github.com/CodisLabs/codis/pkg/models" + "github.com/CodisLabs/codis/pkg/utils" + "github.com/CodisLabs/codis/pkg/utils/errors" + "github.com/CodisLabs/codis/pkg/utils/log" ) type MigrateTaskInfo struct { diff --git a/cmd/cconfig/proxy.go b/cmd/cconfig/proxy.go index 50f439631..7816e2058 100644 --- a/cmd/cconfig/proxy.go +++ b/cmd/cconfig/proxy.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main @@ -8,8 +8,8 @@ import ( "github.com/docopt/docopt-go" - "github.com/wandoulabs/codis/pkg/models" - "github.com/wandoulabs/codis/pkg/utils/log" + "github.com/CodisLabs/codis/pkg/models" + "github.com/CodisLabs/codis/pkg/utils/log" ) func cmdProxy(argv []string) (err error) { diff --git a/cmd/cconfig/rebalancer.go b/cmd/cconfig/rebalancer.go index c939e1a94..76ada8595 100644 --- a/cmd/cconfig/rebalancer.go +++ b/cmd/cconfig/rebalancer.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main @@ -9,10 +9,10 @@ import ( "github.com/wandoulabs/zkhelper" - "github.com/wandoulabs/codis/pkg/models" - "github.com/wandoulabs/codis/pkg/utils" - "github.com/wandoulabs/codis/pkg/utils/errors" - "github.com/wandoulabs/codis/pkg/utils/log" + "github.com/CodisLabs/codis/pkg/models" + "github.com/CodisLabs/codis/pkg/utils" + "github.com/CodisLabs/codis/pkg/utils/errors" + "github.com/CodisLabs/codis/pkg/utils/log" ) type NodeInfo struct { @@ -114,7 +114,7 @@ func Rebalance() error { for _, node := range livingNodes { for len(node.CurSlots) > targetQuota[node.GroupId] { for _, dest := range livingNodes { - if dest.GroupId != node.GroupId && len(dest.CurSlots) < targetQuota[dest.GroupId] { + if dest.GroupId != node.GroupId && len(dest.CurSlots) < targetQuota[dest.GroupId] && len(node.CurSlots) > targetQuota[node.GroupId] { slot := node.CurSlots[len(node.CurSlots)-1] // create a migration task info := &MigrateTaskInfo{ diff --git a/cmd/cconfig/server_group.go b/cmd/cconfig/server_group.go index 54ad28adb..c448890c7 100644 --- a/cmd/cconfig/server_group.go +++ b/cmd/cconfig/server_group.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main @@ -9,8 +9,8 @@ import ( "github.com/docopt/docopt-go" - "github.com/wandoulabs/codis/pkg/models" - "github.com/wandoulabs/codis/pkg/utils/log" + "github.com/CodisLabs/codis/pkg/models" + "github.com/CodisLabs/codis/pkg/utils/log" ) // codis redis instance manage tool diff --git a/cmd/cconfig/slot.go b/cmd/cconfig/slot.go index fb265af46..2e438f0f9 100644 --- a/cmd/cconfig/slot.go +++ b/cmd/cconfig/slot.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main @@ -9,8 +9,8 @@ import ( "github.com/docopt/docopt-go" - "github.com/wandoulabs/codis/pkg/utils/errors" - "github.com/wandoulabs/codis/pkg/utils/log" + "github.com/CodisLabs/codis/pkg/utils/errors" + "github.com/CodisLabs/codis/pkg/utils/log" ) func cmdSlot(argv []string) (err error) { diff --git a/cmd/cconfig/utils.go b/cmd/cconfig/utils.go index 6bae2df6f..1694b7079 100644 --- a/cmd/cconfig/utils.go +++ b/cmd/cconfig/utils.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main @@ -9,8 +9,8 @@ import ( "net/http" "strings" - "github.com/wandoulabs/codis/pkg/utils/errors" - "github.com/wandoulabs/codis/pkg/utils/log" + "github.com/CodisLabs/codis/pkg/utils/errors" + "github.com/CodisLabs/codis/pkg/utils/log" ) const ( diff --git a/cmd/proxy/main.go b/cmd/proxy/main.go index aa9dfb2e9..8bc89c80e 100644 --- a/cmd/proxy/main.go +++ b/cmd/proxy/main.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main @@ -19,11 +19,11 @@ import ( "github.com/docopt/docopt-go" "github.com/ngaut/gostats" - "github.com/wandoulabs/codis/pkg/proxy" - "github.com/wandoulabs/codis/pkg/proxy/router" - "github.com/wandoulabs/codis/pkg/utils" - "github.com/wandoulabs/codis/pkg/utils/bytesize" - "github.com/wandoulabs/codis/pkg/utils/log" + "github.com/CodisLabs/codis/pkg/proxy" + "github.com/CodisLabs/codis/pkg/proxy/router" + "github.com/CodisLabs/codis/pkg/utils" + "github.com/CodisLabs/codis/pkg/utils/bytesize" + "github.com/CodisLabs/codis/pkg/utils/log" ) var ( diff --git a/config.ini b/config.ini index 42526918d..5ccf41245 100644 --- a/config.ini +++ b/config.ini @@ -31,7 +31,7 @@ session_max_pipeline=1024 # If proxy don't send a heartbeat in timeout millisecond which is usually because proxy has high load or even no response, zk will mark this proxy offline. # A higher timeout will recude the possibility of "session expired" but clients will not know the proxy has no response in time if the proxy is down indeed. -# So we highly recommend you not to change this default timeout and use Jodis(https://github.com/wandoulabs/codis/tree/master/extern/jodis) +# So we highly recommend you not to change this default timeout and use Jodis(https://github.com/CodisLabs/jodis) # which watches the available proxies and will skip the offline proxy or add new online proxy automatically. # If you are not using Java in client, you can DIY a zk watcher accourding to Jodis source code. zk_session_timeout=30000 diff --git a/doc/FAQ_zh.md b/doc/FAQ_zh.md index 7e52194e3..59acdaace 100644 --- a/doc/FAQ_zh.md +++ b/doc/FAQ_zh.md @@ -16,7 +16,7 @@ Codis支持水平扩容/缩容,扩容可以直接界面的 "Auto Rebalance" 可以, 使用codis项目内的redis-port工具, 可以实时的同步 twemproxy 底下的 redis 数据到你的 codis 集群上. 搞定了以后, 只需要你修改一下你的配置, 将 twemproxy 的地址改成 codis 的地址就好了. 除此之外, 你什么事情都不用做. 2) 原来使用 Redis 的用户: -如果你使用了[doc/unsupported_cmds](https://github.com/wandoulabs/codis/blob/master/doc/unsupported_cmds.md)中提到的命令,是无法直接迁移到 Codis 上的. 你需要修改你的代码, 用其他的方式实现. +如果你使用了[doc/unsupported_cmds](https://github.com/CodisLabs/codis/blob/master/doc/unsupported_cmds.md)中提到的命令,是无法直接迁移到 Codis 上的. 你需要修改你的代码, 用其他的方式实现. ###相对于twemproxy的优劣? codis和twemproxy最大的区别有两个:一个是codis支持动态水平扩展,对client完全透明不影响服务的情况下可以完成增减redis实例的操作;一个是codis是用go语言写的并支持多线程而twemproxy用C并只用单线程。 @@ -58,7 +58,7 @@ CAS 暂时不支持, 目前只支持eval的方式来跑lua脚本,需要配合T ###Codis的性能如何? -见Readme中的[Benchmark一节](https://github.com/wandoulabs/codis#performance-benchmark)。 +见Readme中的[Benchmark一节](https://github.com/CodisLabs/codis#performance-benchmark)。 ###我的数据在 Codis 上是安全的吗? @@ -75,11 +75,11 @@ CAS 暂时不支持, 目前只支持eval的方式来跑lua脚本,需要配合T 支持,请参考使用教程,需要将配置文件中的coordinator=zookeeper改为etcd。 -但是需要注意:请使用codis2.0.10或更新的版本,旧版对etcd的支持有一些问题;由于etcd在2.2引入了一个与旧版不兼容的坑爹改动,导致如果使用etcd的版本>=2.2.0,暂时需要手动改一处代码,详情见[相关issue](https://github.com/wandoulabs/codis/issues/488)。 +但是需要注意:请使用codis2.0.10或更新的版本,旧版对etcd的支持有一些问题;由于etcd在2.2引入了一个与旧版不兼容的坑爹改动,导致如果使用etcd的版本>=2.2.0,暂时需要手动改一处代码,详情见[相关issue](https://github.com/CodisLabs/codis/issues/488)。 ###现有redis集群上有上T的数据,如何迁移到Codis上来? -为了提高 Codis 推广和部署上的效率,我们为数据迁移提供了一个叫做 [redis-port](https://github.com/wandoulabs/redis-port) 的命令行工具,它能够: +为了提高 Codis 推广和部署上的效率,我们为数据迁移提供了一个叫做 [redis-port](https://github.com/CodisLabs/redis-port) 的命令行工具,它能够: + 静态分析 RDB 文件,包括解析以及恢复 RDB 数据到 redis + 从 redis 上 dump RDB 文件以及从 redis 和 codis 之间动态同步数据 @@ -110,7 +110,7 @@ CAS 暂时不支持, 目前只支持eval的方式来跑lua脚本,需要配合T + redis-port 本质是以 slave 的形式挂载到现有 redis 服务上去的 1. redis 会生成 RDB DUMP 文件给作为 slave 的 redis-port - 2. redis-port 分析 RDB 文件,并拆分成 key-value 对,通过 [slotsrestore](https://github.com/wandoulabs/codis/blob/master/doc/redis_change_zh.md#slotsrestore-key1-ttl1-val1-key2-ttl2-val2-) 指令发给 codis + 2. redis-port 分析 RDB 文件,并拆分成 key-value 对,通过 [slotsrestore](https://github.com/CodisLabs/codis/blob/master/doc/redis_change_zh.md#slotsrestore-key1-ttl1-val1-key2-ttl2-val2-) 指令发给 codis 3. 迁移过程中发生的修改,redis 会将这些指令在 RDB DUMP 发送完成后,再发给 redis-port,而 redis-port 收到这些指令后不作处理,而直接转发给 Codis + redis-port 处理还是很快的,参考: @@ -127,7 +127,7 @@ CAS 暂时不支持, 目前只支持eval的方式来跑lua脚本,需要配合T 因此关闭服务的时候直接用`kill {pid}`不要-9,同时如果无法启动并且确认没有其他运行中的进程占用zk上的节点,可以在zk上手动删除/zk/codis/db_test/dashboard 或/zk/codis/db_test/fence/{host:port}. ### 编译报错 undefined: utils.Version -说明没有正确的设置go项目路径导致生成的文件找不到。见[安装教程](https://github.com/wandoulabs/codis/blob/master/doc/tutorial_zh.md#build-codis-proxy--codis-config)来正确配置环境变量并用正确的方式下载代码。 +说明没有正确的设置go项目路径导致生成的文件找不到。见[安装教程](https://github.com/CodisLabs/codis/blob/master/doc/tutorial_zh.md#build-codis-proxy--codis-config)来正确配置环境变量并用正确的方式下载代码。 ### zk: session has been expired by the server 因为使用的go-zookeeper库代码注释里写的session超时时间参数单位是秒,但实际上该参数的单位是毫秒,所以<=2.0.7的版本错误的将默认配置设成30。因此请将配置文件修改为30000。此外2.0.8起如果配置文件中的参数过小则自动将秒转化为毫秒。 @@ -135,8 +135,8 @@ CAS 暂时不支持, 目前只支持eval的方式来跑lua脚本,需要配合T Codis的proxy会注册在zk上并监听新的zk事件。因为涉及到数据一致性的问题,所有proxy必须能尽快知道slot状态的改变,因此一旦和zk的连接出了问题就无法知道最新的slot信息从而可能不得不阻塞一些请求以防止数据错误或丢失。 Proxy会每几秒给zk发心跳,proxy的load太高可能导致timeout时间内(默认30秒,配置文件中可以修改)没有成功发心跳导致zk认为proxy已经挂了(当然也可能proxy确实挂了), -这时如果client用了我们修改的Jedis, [Jodis](https://github.com/wandoulabs/jodis),是会监控到zk节点上proxy少了一个从而自动避开请求这个proxy以保证客户端业务的可用性。如果用非Java语言可以根据Jodis代码DIY一个监听zk的客户端。 -另外,如果需要异步请求,可以使用我们基于Netty开发的[Nedis](https://github.com/wandoulabs/nedis)。 +这时如果client用了我们修改的Jedis, [Jodis](https://github.com/CodisLabs/jodis),是会监控到zk节点上proxy少了一个从而自动避开请求这个proxy以保证客户端业务的可用性。如果用非Java语言可以根据Jodis代码DIY一个监听zk的客户端。 +另外,如果需要异步请求,可以使用我们基于Netty开发的[Nedis](https://github.com/CodisLabs/nedis)。 当然,proxy收到session expired的错误也不意味着proxy一定要强制退出,但是这是最方便、安全的实现方式。而且实际使用中出现错误的情况通常是zk或proxy的load过高导致的,即使这时不退出可能业务的请求也会受影响,因此出现这个问题通常意味着需要加机器了。 diff --git a/doc/pictures/logo-1.png b/doc/pictures/logo-1.png new file mode 100644 index 000000000..f1014306c Binary files /dev/null and b/doc/pictures/logo-1.png differ diff --git a/doc/pictures/logo-2.png b/doc/pictures/logo-2.png new file mode 100644 index 000000000..584e608bc Binary files /dev/null and b/doc/pictures/logo-2.png differ diff --git a/doc/pictures/logo-3.png b/doc/pictures/logo-3.png new file mode 100644 index 000000000..e697910bd Binary files /dev/null and b/doc/pictures/logo-3.png differ diff --git a/doc/pictures/logo.png b/doc/pictures/logo.png new file mode 100644 index 000000000..6d2eb684f Binary files /dev/null and b/doc/pictures/logo.png differ diff --git a/doc/tutorial_en.md b/doc/tutorial_en.md index 14b27f757..e68ef21d4 100644 --- a/doc/tutorial_en.md +++ b/doc/tutorial_en.md @@ -1,6 +1,6 @@ # Codis Tutorial -Codes is a distributed Redis solution, there is no obvious difference between connecting to a Codis proxy and an original Redis server(?), top layer application can connect to Codis as normal standalone Redis, Codis will forward low layer requests. Hot data migration and all things in the shadow are transparent to client. Simply treat Coids as a Redis service with unlimited RAM. +Codis is a distributed Redis solution, there is no obvious difference between connecting to a Codis proxy and an original Redis server(?), top layer application can connect to Codis as normal standalone Redis, Codis will forward low layer requests. Hot data migration and all things in the shadow are transparent to client. Simply treat Codis as a Redis service with unlimited RAM. Codis has four parts: * Codis Proxy(proxy) @@ -10,7 +10,7 @@ Codis has four parts: `codis-proxy` is the proxy service of client connections, `codis-proxy` is a Redis protocol implementation, perform as an original Redis(just like Twemproxy). You can deploy multiple `codis-proxy` for one business, `codis-proxy` is none-stateful. -`codis-config` is the configuration to for Codis, support actions like add/remove Redis node, add/remove Proxy node and start data migaration, etc. `codis-config` has a built-in http server which can start a dashboard for user to monitor the status of Codis cluster in browser. +`codis-config` is the configuration to for Codis, support actions like add/remove Redis node, add/remove Proxy node and start data migration, etc. `codis-config` has a built-in http server which can start a dashboard for user to monitor the status of Codis cluster in browser. `codis-server` is a branch of Redis maintain by Codis project, based on 2.8.13, add support for slot and atomic data migration. `codis-proxy` and `codis-config` can only work properly with this specific version of Redis. @@ -23,8 +23,8 @@ Codis support namespace, configs of products with different name won’t be con * install go [see official doc](https://golang.org/doc/install) * set $GOPATH correctly and set PATH=$GOPATH/bin:$PATH to execute commands installed by `go get` -* execute `go get -u -d github.com/wandoulabs/codis` to download codis -* change directory to `$GOPATH/src/github.com/wandoulabs/codis` and execute `make` to compile, execute `make gotest` to run unit test +* execute `go get -u -d github.com/CodisLabs/codis` to download codis +* change directory to `$GOPATH/src/github.com/CodisLabs/codis` and execute `make` to compile, execute `make gotest` to run unit test Two executable file `codas-config` and `codis-proxy` should be generated in `codis/bin`(`bin/assets` is the resources for `codis-config` dashboard, should be placed at same directory with `codis-config`). @@ -66,7 +66,7 @@ options: ### Configuration file `codis-config` and `codis-proxy` will take `config.ini` in current directory by default without a specific `-c`. -See [config.ini](https://github.com/wandoulabs/codis/blob/master/config.ini)'s comments. +See [config.ini](https://github.com/CodisLabs/codis/blob/master/config.ini)'s comments. ### Workflow 0. Execute `codis-config dashboard` , start dashboard. @@ -108,7 +108,7 @@ $ bin/codis-config server add 2 localhost:6480 slave 4. Config slot range of server group -Codes implement data segmentation with Pre-sharding mechanism, 1024 slots will be segmented by default,a single key use following formula to determine which slot to resident, each slot has a server group id represents the server group which will provide service. +Codis implement data segmentation with Pre-sharding mechanism, 1024 slots will be segmented by default,a single key use following formula to determine which slot to resident, each slot has a server group id represents the server group which will provide service. ``` $ bin/codis-config slot -h @@ -177,11 +177,11 @@ Requirements: Codis's proxy is stateless so you can run more than one proxies to get high availability and horizontal scalability. -For Java users, you can use a modified Jedis, [Jodis](https://github.com/wandoulabs/jodis). It will watch the ZooKeeper to get the real-time available proxies, then query via them using a round robin policy to balance load and detect proxy online and offline automatically. -If asynchronous request is required, you can use [Nedis](https://github.com/wandoulabs/nedis) which is implemented based on Netty. +For Java users, you can use a modified Jedis, [Jodis](https://github.com/CodisLabs/jodis). It will watch the ZooKeeper to get the real-time available proxies, then query via them using a round robin policy to balance load and detect proxy online and offline automatically. +If asynchronous request is required, you can use [Nedis](https://github.com/CodisLabs/nedis) which is implemented based on Netty. For redis instances, the designers of codis think when a master down, system administrator should know about it and promote a slave to master by hand, not automatically. Because a crashed master may result in the data in this group not consistent. But we also offer a solution: [codis-ha](https://github.com/ngaut/codis-ha)。It is a tool using codis rest api to promote a slave to master when it find the master down. -When codis promote one slave instantce to master, other slaves will not change there status. These slaves will still try to sync from the old crashed master, so the data in this group is not consistent. +When codis promote one slave instance to master, other slaves will not change there status. These slaves will still try to sync from the old crashed master, so the data in this group is not consistent. Because the `slave of` command in redis will let a slave drop its data and sync from the new master, it will make the master a little slow on handling queries.So you should change the status by hand after your acknowledgement by using `codis-config server add slave` to refresh the status of remain slaves. Codis-ha won't do this. diff --git a/doc/tutorial_zh.md b/doc/tutorial_zh.md index dcf7fc66f..8f20ad60e 100644 --- a/doc/tutorial_zh.md +++ b/doc/tutorial_zh.md @@ -24,8 +24,8 @@ Codis 支持按照 Namespace 区分不同的产品, 拥有不同的 product name * 安装go[参考这里](https://golang.org/doc/install) * 根据教程正确设置$GOPATH环境变量。注意$GOPATH是本机所有go项目(包括项目依赖的第三方库)的所在目录,而非单纯codis的所在目录。 * 将$GOPATH/bin设为$PATH的其中一个目录,例如直接PATH=$GOPATH/bin:$PATH,方便执行通过go get安装的命令 -* 执行`go get -u -d github.com/wandoulabs/codis`下载codis代码 -* 切换到`$GOPATH/src/github.com/wandoulabs/codis`目录执行`make`命令编译代码,并执行`make gotest`来跑测试 +* 执行`go get -u -d github.com/CodisLabs/codis`下载codis代码 +* 切换到`$GOPATH/src/github.com/CodisLabs/codis`目录执行`make`命令编译代码,并执行`make gotest`来跑测试 建议只通过go get命令来下载codis,除非你非常熟悉go语言的目录引用形式从而不会导致代码放错地方。该命令会下载master分支的最新版,我们会确保master分支的稳定。 @@ -184,7 +184,7 @@ $ bin/codis-config slot rebalance 因为codis的proxy是无状态的,可以比较容易的搭多个proxy来实现高可用性并横向扩容。 -对Java用户来说,可以使用经过我们修改过的Jedis,[Jodis](https://github.com/wandoulabs/jodis) ,来实现proxy层的HA。它会通过监控zk上的注册信息来实时获得当前可用的proxy列表,既可以保证高可用性,也可以通过轮流请求所有的proxy实现负载均衡。如果需要异步请求,可以使用我们基于Netty开发的[Nedis](https://github.com/wandoulabs/nedis)。 +对Java用户来说,可以使用经过我们修改过的Jedis,[Jodis](https://github.com/CodisLabs/jodis) ,来实现proxy层的HA。它会通过监控zk上的注册信息来实时获得当前可用的proxy列表,既可以保证高可用性,也可以通过轮流请求所有的proxy实现负载均衡。如果需要异步请求,可以使用我们基于Netty开发的[Nedis](https://github.com/CodisLabs/nedis)。 对下层的redis实例来说,当一个group的master挂掉的时候,应该让管理员清楚,并手动的操作,因为这涉及到了数据一致性等问题(redis的主从同步是最终一致性的)。因此codis不会自动的将某个slave升级成master。 不过我们也提供一种解决方案:[codis-ha](https://github.com/ngaut/codis-ha)。这是一个通过codis开放的api实现自动切换主从的工具。该工具会在检测到master挂掉的时候将其下线并选择其中一个slave提升为master继续提供服务。 diff --git a/docker/mkproxy.sh b/docker/mkproxy.sh index 6b2599861..b8f02695a 100755 --- a/docker/mkproxy.sh +++ b/docker/mkproxy.sh @@ -35,7 +35,7 @@ RUN echo 'codis:codis' | chpasswd ENV GOPATH /tmp/gopath ${ADDGODEPS} -ADD pkg \${GOPATH}/src/github.com/wandoulabs/codis/pkg +ADD pkg \${GOPATH}/src/github.com/CodisLabs/codis/pkg ENV BUILDDIR /tmp/codis RUN mkdir -p \${BUILDDIR} diff --git a/extern/redis-test/basic_hash.go b/extern/redis-test/basic_hash.go index 44f96637d..40a5f15b8 100644 --- a/extern/redis-test/basic_hash.go +++ b/extern/redis-test/basic_hash.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main diff --git a/extern/redis-test/basic_incr.go b/extern/redis-test/basic_incr.go index efb558b7b..f21d0ec72 100644 --- a/extern/redis-test/basic_incr.go +++ b/extern/redis-test/basic_incr.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main diff --git a/extern/redis-test/basic_mgrt.go b/extern/redis-test/basic_mgrt.go index df8bb72f6..b87493cad 100644 --- a/extern/redis-test/basic_mgrt.go +++ b/extern/redis-test/basic_mgrt.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main diff --git a/extern/redis-test/bench/benchmark.go b/extern/redis-test/bench/benchmark.go index f01a3d4e7..72af328b2 100644 --- a/extern/redis-test/bench/benchmark.go +++ b/extern/redis-test/bench/benchmark.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main diff --git a/extern/redis-test/extra_del.go b/extern/redis-test/extra_del.go index ae3ba759d..134be8036 100644 --- a/extern/redis-test/extra_del.go +++ b/extern/redis-test/extra_del.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main diff --git a/extern/redis-test/extra_incr.go b/extern/redis-test/extra_incr.go index 000f04888..8849ff1f7 100644 --- a/extern/redis-test/extra_incr.go +++ b/extern/redis-test/extra_incr.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main diff --git a/extern/redis-test/extra_memleak.go b/extern/redis-test/extra_memleak.go index a1149efd2..17a3b75c9 100644 --- a/extern/redis-test/extra_memleak.go +++ b/extern/redis-test/extra_memleak.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main diff --git a/extern/redis-test/extra_mget.go b/extern/redis-test/extra_mget.go index b4b413a03..71ae2635a 100644 --- a/extern/redis-test/extra_mget.go +++ b/extern/redis-test/extra_mget.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main diff --git a/extern/redis-test/test_hset.go b/extern/redis-test/test_hset.go index 9cfb3a5b0..2127a2f5d 100644 --- a/extern/redis-test/test_hset.go +++ b/extern/redis-test/test_hset.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main diff --git a/extern/redis-test/test_incr1.go b/extern/redis-test/test_incr1.go index 1bbc12f57..c4984a58c 100644 --- a/extern/redis-test/test_incr1.go +++ b/extern/redis-test/test_incr1.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main diff --git a/extern/redis-test/test_incr2.go b/extern/redis-test/test_incr2.go index e3aa37a4a..d9c8fa579 100644 --- a/extern/redis-test/test_incr2.go +++ b/extern/redis-test/test_incr2.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main diff --git a/extern/redis-test/test_list.go b/extern/redis-test/test_list.go index bed6d89db..db228bcdf 100644 --- a/extern/redis-test/test_list.go +++ b/extern/redis-test/test_list.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main diff --git a/extern/redis-test/test_mget.go b/extern/redis-test/test_mget.go index c477fb8e4..6bdadd6ac 100644 --- a/extern/redis-test/test_mget.go +++ b/extern/redis-test/test_mget.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main diff --git a/extern/redis-test/test_mset.go b/extern/redis-test/test_mset.go index fca8963cc..022e22ffb 100644 --- a/extern/redis-test/test_mset.go +++ b/extern/redis-test/test_mset.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main diff --git a/extern/redis-test/test_pttl.go b/extern/redis-test/test_pttl.go index 7148f5282..98ca6c6a0 100644 --- a/extern/redis-test/test_pttl.go +++ b/extern/redis-test/test_pttl.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main diff --git a/extern/redis-test/test_string.go b/extern/redis-test/test_string.go index 4baa6cdfe..acfd7440c 100644 --- a/extern/redis-test/test_string.go +++ b/extern/redis-test/test_string.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main diff --git a/extern/redis-test/utils.go b/extern/redis-test/utils.go index 7a74b324e..ab5edc2e8 100644 --- a/extern/redis-test/utils.go +++ b/extern/redis-test/utils.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main diff --git a/extern/scala-client/project/Build.scala b/extern/scala-client/project/Build.scala index 05c729643..fcf2622fe 100644 --- a/extern/scala-client/project/Build.scala +++ b/extern/scala-client/project/Build.scala @@ -4,7 +4,7 @@ import sbt._ object CodisScalaClientBuild extends Build { val basicSettings = Seq( - organization := "com.wandoulabs.codis", + organization := "com.CodisLabs.codis", version := "0.0.1-SNAPSHOT", scalaVersion := "2.10.5", publishMavenStyle := true, diff --git a/extern/scala-client/src/main/scala/codis/CodisClient.scala b/extern/scala-client/src/main/scala/codis/CodisClient.scala index 1678a5516..6e261a466 100644 --- a/extern/scala-client/src/main/scala/codis/CodisClient.scala +++ b/extern/scala-client/src/main/scala/codis/CodisClient.scala @@ -19,7 +19,7 @@ import scala.concurrent.{ExecutionContext, Future} /** * A codis client based on {@code CuratorFramework} and {@code rediscala}. - * Majority implementation are adopted from Jodis. + * Majority implementation are adopted from Jodis. * * This implementation can be considered as two components. * One uses {@code ZooKeeper} to keep sync the list of proxy addresses by watching certain type of diff --git a/pkg/models/action.go b/pkg/models/action.go index 405711167..0bcf28cc6 100644 --- a/pkg/models/action.go +++ b/pkg/models/action.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package models @@ -13,8 +13,8 @@ import ( "strconv" "time" - "github.com/wandoulabs/codis/pkg/utils/errors" - "github.com/wandoulabs/codis/pkg/utils/log" + "github.com/CodisLabs/codis/pkg/utils/errors" + "github.com/CodisLabs/codis/pkg/utils/log" "github.com/wandoulabs/go-zookeeper/zk" "github.com/wandoulabs/zkhelper" ) diff --git a/pkg/models/action_test.go b/pkg/models/action_test.go index f0e51681f..95468ee9b 100644 --- a/pkg/models/action_test.go +++ b/pkg/models/action_test.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package models @@ -11,10 +11,10 @@ import ( "testing" "time" - "github.com/wandoulabs/codis/pkg/utils" - "github.com/wandoulabs/codis/pkg/utils/assert" - "github.com/wandoulabs/codis/pkg/utils/errors" - "github.com/wandoulabs/codis/pkg/utils/log" + "github.com/CodisLabs/codis/pkg/utils" + "github.com/CodisLabs/codis/pkg/utils/assert" + "github.com/CodisLabs/codis/pkg/utils/errors" + "github.com/CodisLabs/codis/pkg/utils/log" "github.com/wandoulabs/zkhelper" ) diff --git a/pkg/models/consts.go b/pkg/models/consts.go index 28a0bb60f..1e261ca2e 100644 --- a/pkg/models/consts.go +++ b/pkg/models/consts.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package models diff --git a/pkg/models/proxy.go b/pkg/models/proxy.go index 875110efb..83e217430 100644 --- a/pkg/models/proxy.go +++ b/pkg/models/proxy.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package models @@ -10,8 +10,8 @@ import ( "net/http" "path" - "github.com/wandoulabs/codis/pkg/utils/errors" - "github.com/wandoulabs/codis/pkg/utils/log" + "github.com/CodisLabs/codis/pkg/utils/errors" + "github.com/CodisLabs/codis/pkg/utils/log" "github.com/wandoulabs/go-zookeeper/zk" "github.com/wandoulabs/zkhelper" ) diff --git a/pkg/models/proxy_test.go b/pkg/models/proxy_test.go index 1a1ddd0ff..4e1b52b92 100644 --- a/pkg/models/proxy_test.go +++ b/pkg/models/proxy_test.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package models @@ -6,7 +6,7 @@ package models import ( "testing" - "github.com/wandoulabs/codis/pkg/utils/assert" + "github.com/CodisLabs/codis/pkg/utils/assert" "github.com/wandoulabs/zkhelper" ) diff --git a/pkg/models/server_group.go b/pkg/models/server_group.go index 8c86b0220..18039999b 100644 --- a/pkg/models/server_group.go +++ b/pkg/models/server_group.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package models @@ -9,9 +9,9 @@ import ( "strconv" "strings" - "github.com/wandoulabs/codis/pkg/utils" - "github.com/wandoulabs/codis/pkg/utils/errors" - "github.com/wandoulabs/codis/pkg/utils/log" + "github.com/CodisLabs/codis/pkg/utils" + "github.com/CodisLabs/codis/pkg/utils/errors" + "github.com/CodisLabs/codis/pkg/utils/log" "github.com/wandoulabs/zkhelper" ) @@ -302,6 +302,9 @@ func (self *ServerGroup) AddServer(zkConn zkhelper.Conn, s *Server, passwd strin zkPath := fmt.Sprintf("/zk/codis/db_%s/servers/group_%d/%s", self.ProductName, self.Id, s.Addr) _, err = zkhelper.CreateOrUpdate(zkConn, zkPath, string(val), 0, zkhelper.DefaultFileACLs(), true) + if err != nil { + return errors.Trace(err) + } // update servers servers, err = self.GetServers(zkConn) diff --git a/pkg/models/server_group_test.go b/pkg/models/server_group_test.go index 67c06f212..0df6e252b 100644 --- a/pkg/models/server_group_test.go +++ b/pkg/models/server_group_test.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package models @@ -10,7 +10,7 @@ import ( "testing" "time" - "github.com/wandoulabs/codis/pkg/utils/assert" + "github.com/CodisLabs/codis/pkg/utils/assert" "github.com/wandoulabs/zkhelper" ) diff --git a/pkg/models/slot.go b/pkg/models/slot.go index af2e18929..3fec572e1 100644 --- a/pkg/models/slot.go +++ b/pkg/models/slot.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package models @@ -8,7 +8,7 @@ import ( "fmt" "path" - "github.com/wandoulabs/codis/pkg/utils/errors" + "github.com/CodisLabs/codis/pkg/utils/errors" "github.com/wandoulabs/zkhelper" ) diff --git a/pkg/models/slots_test.go b/pkg/models/slots_test.go index ff56c1e50..bcf09e888 100644 --- a/pkg/models/slots_test.go +++ b/pkg/models/slots_test.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package models @@ -6,7 +6,7 @@ package models import ( "testing" - "github.com/wandoulabs/codis/pkg/utils/assert" + "github.com/CodisLabs/codis/pkg/utils/assert" "github.com/wandoulabs/zkhelper" ) diff --git a/pkg/proxy/config.go b/pkg/proxy/config.go index f09525842..51a94328c 100644 --- a/pkg/proxy/config.go +++ b/pkg/proxy/config.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package proxy @@ -7,7 +7,7 @@ import ( "strings" "github.com/c4pt0r/cfg" - "github.com/wandoulabs/codis/pkg/utils/log" + "github.com/CodisLabs/codis/pkg/utils/log" ) type Config struct { diff --git a/pkg/proxy/proxy.go b/pkg/proxy/proxy.go index 79cd50b6b..6b6a522e7 100644 --- a/pkg/proxy/proxy.go +++ b/pkg/proxy/proxy.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package proxy @@ -16,9 +16,9 @@ import ( "sync" "time" - "github.com/wandoulabs/codis/pkg/models" - "github.com/wandoulabs/codis/pkg/proxy/router" - "github.com/wandoulabs/codis/pkg/utils/log" + "github.com/CodisLabs/codis/pkg/models" + "github.com/CodisLabs/codis/pkg/proxy/router" + "github.com/CodisLabs/codis/pkg/utils/log" "github.com/wandoulabs/go-zookeeper/zk" topo "github.com/wandoulabs/go-zookeeper/zk" ) @@ -140,6 +140,12 @@ func (s *Server) handleConns() { for { c, err := s.listener.Accept() if err != nil { + if ne, ok := err.(net.Error); ok && ne.Temporary() { + log.WarnErrorf(err, "[%p] proxy accept new connection failed, get temporary error", s) + time.Sleep(time.Millisecond*10) + continue + } + log.WarnErrorf(err, "[%p] proxy accept new connection failed, get non-temporary error, must shutdown", s) return } else { ch <- c diff --git a/pkg/proxy/proxy_test.go b/pkg/proxy/proxy_test.go index 51e8a62ee..a65728793 100644 --- a/pkg/proxy/proxy_test.go +++ b/pkg/proxy/proxy_test.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package proxy @@ -13,8 +13,8 @@ import ( "github.com/garyburd/redigo/redis" "github.com/wandoulabs/zkhelper" - "github.com/wandoulabs/codis/pkg/models" - "github.com/wandoulabs/codis/pkg/utils/assert" + "github.com/CodisLabs/codis/pkg/models" + "github.com/CodisLabs/codis/pkg/utils/assert" ) var ( diff --git a/pkg/proxy/redis/conn.go b/pkg/proxy/redis/conn.go index aa486fd6d..5e89cb483 100644 --- a/pkg/proxy/redis/conn.go +++ b/pkg/proxy/redis/conn.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package redis @@ -7,7 +7,7 @@ import ( "net" "time" - "github.com/wandoulabs/codis/pkg/utils/errors" + "github.com/CodisLabs/codis/pkg/utils/errors" ) type Conn struct { diff --git a/pkg/proxy/redis/conn_test.go b/pkg/proxy/redis/conn_test.go index 390eda181..6c6f78b1b 100644 --- a/pkg/proxy/redis/conn_test.go +++ b/pkg/proxy/redis/conn_test.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package redis @@ -10,9 +10,9 @@ import ( "testing" "time" - "github.com/wandoulabs/codis/pkg/utils/assert" - "github.com/wandoulabs/codis/pkg/utils/atomic2" - "github.com/wandoulabs/codis/pkg/utils/errors" + "github.com/CodisLabs/codis/pkg/utils/assert" + "github.com/CodisLabs/codis/pkg/utils/atomic2" + "github.com/CodisLabs/codis/pkg/utils/errors" ) func newConnPair() (*Conn, *Conn) { diff --git a/pkg/proxy/redis/decoder.go b/pkg/proxy/redis/decoder.go index 0239497c2..ebb718181 100644 --- a/pkg/proxy/redis/decoder.go +++ b/pkg/proxy/redis/decoder.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package redis @@ -9,7 +9,7 @@ import ( "io" "strconv" - "github.com/wandoulabs/codis/pkg/utils/errors" + "github.com/CodisLabs/codis/pkg/utils/errors" ) var ( diff --git a/pkg/proxy/redis/decoder_test.go b/pkg/proxy/redis/decoder_test.go index 9864b6754..0e4e8f013 100644 --- a/pkg/proxy/redis/decoder_test.go +++ b/pkg/proxy/redis/decoder_test.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package redis @@ -7,7 +7,7 @@ import ( "bytes" "testing" - "github.com/wandoulabs/codis/pkg/utils/assert" + "github.com/CodisLabs/codis/pkg/utils/assert" ) func TestBtoi(t *testing.T) { diff --git a/pkg/proxy/redis/encoder.go b/pkg/proxy/redis/encoder.go index bcbc03860..601f59cde 100644 --- a/pkg/proxy/redis/encoder.go +++ b/pkg/proxy/redis/encoder.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package redis @@ -9,7 +9,7 @@ import ( "io" "strconv" - "github.com/wandoulabs/codis/pkg/utils/errors" + "github.com/CodisLabs/codis/pkg/utils/errors" ) var ( diff --git a/pkg/proxy/redis/encoder_test.go b/pkg/proxy/redis/encoder_test.go index 88ee2e015..ba1b92e7f 100644 --- a/pkg/proxy/redis/encoder_test.go +++ b/pkg/proxy/redis/encoder_test.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package redis @@ -9,7 +9,7 @@ import ( "strconv" "testing" - "github.com/wandoulabs/codis/pkg/utils/assert" + "github.com/CodisLabs/codis/pkg/utils/assert" ) var tmap = make(map[int64][]byte) diff --git a/pkg/proxy/redis/resp.go b/pkg/proxy/redis/resp.go index 9dfa900d8..05951b703 100644 --- a/pkg/proxy/redis/resp.go +++ b/pkg/proxy/redis/resp.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package redis diff --git a/pkg/proxy/router/backend.go b/pkg/proxy/router/backend.go index f2db00d9b..b24efc53f 100644 --- a/pkg/proxy/router/backend.go +++ b/pkg/proxy/router/backend.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package router @@ -8,9 +8,9 @@ import ( "sync" "time" - "github.com/wandoulabs/codis/pkg/proxy/redis" - "github.com/wandoulabs/codis/pkg/utils/errors" - "github.com/wandoulabs/codis/pkg/utils/log" + "github.com/CodisLabs/codis/pkg/proxy/redis" + "github.com/CodisLabs/codis/pkg/utils/errors" + "github.com/CodisLabs/codis/pkg/utils/log" ) type BackendConn struct { diff --git a/pkg/proxy/router/backend_test.go b/pkg/proxy/router/backend_test.go index 15396818a..679585fd0 100644 --- a/pkg/proxy/router/backend_test.go +++ b/pkg/proxy/router/backend_test.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package router @@ -10,8 +10,8 @@ import ( "testing" "time" - "github.com/wandoulabs/codis/pkg/proxy/redis" - "github.com/wandoulabs/codis/pkg/utils/assert" + "github.com/CodisLabs/codis/pkg/proxy/redis" + "github.com/CodisLabs/codis/pkg/utils/assert" ) func TestBackend(t *testing.T) { diff --git a/pkg/proxy/router/mapper.go b/pkg/proxy/router/mapper.go index 2b6cb98a4..66e6bcbfa 100644 --- a/pkg/proxy/router/mapper.go +++ b/pkg/proxy/router/mapper.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package router @@ -8,8 +8,8 @@ import ( "hash/crc32" "strings" - "github.com/wandoulabs/codis/pkg/proxy/redis" - "github.com/wandoulabs/codis/pkg/utils/errors" + "github.com/CodisLabs/codis/pkg/proxy/redis" + "github.com/CodisLabs/codis/pkg/utils/errors" ) var charmap [128]byte diff --git a/pkg/proxy/router/mapper_test.go b/pkg/proxy/router/mapper_test.go index fa7d3b26b..bdecbc902 100644 --- a/pkg/proxy/router/mapper_test.go +++ b/pkg/proxy/router/mapper_test.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package router @@ -6,8 +6,8 @@ package router import ( "testing" - "github.com/wandoulabs/codis/pkg/proxy/redis" - "github.com/wandoulabs/codis/pkg/utils/assert" + "github.com/CodisLabs/codis/pkg/proxy/redis" + "github.com/CodisLabs/codis/pkg/utils/assert" ) func TestGetOpStr(t *testing.T) { diff --git a/pkg/proxy/router/request.go b/pkg/proxy/router/request.go index 754e04713..77995cdd7 100644 --- a/pkg/proxy/router/request.go +++ b/pkg/proxy/router/request.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package router @@ -6,8 +6,8 @@ package router import ( "sync" - "github.com/wandoulabs/codis/pkg/proxy/redis" - "github.com/wandoulabs/codis/pkg/utils/atomic2" + "github.com/CodisLabs/codis/pkg/proxy/redis" + "github.com/CodisLabs/codis/pkg/utils/atomic2" ) type Dispatcher interface { diff --git a/pkg/proxy/router/router.go b/pkg/proxy/router/router.go index 2e5c1d1d5..0143d07e4 100644 --- a/pkg/proxy/router/router.go +++ b/pkg/proxy/router/router.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package router @@ -7,9 +7,9 @@ import ( "strings" "sync" - "github.com/wandoulabs/codis/pkg/models" - "github.com/wandoulabs/codis/pkg/utils/errors" - "github.com/wandoulabs/codis/pkg/utils/log" + "github.com/CodisLabs/codis/pkg/models" + "github.com/CodisLabs/codis/pkg/utils/errors" + "github.com/CodisLabs/codis/pkg/utils/log" ) const MaxSlotNum = models.DEFAULT_SLOT_NUM diff --git a/pkg/proxy/router/session.go b/pkg/proxy/router/session.go index dbb4fec62..b81eec6a4 100644 --- a/pkg/proxy/router/session.go +++ b/pkg/proxy/router/session.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package router @@ -11,10 +11,10 @@ import ( "sync" "time" - "github.com/wandoulabs/codis/pkg/proxy/redis" - "github.com/wandoulabs/codis/pkg/utils/atomic2" - "github.com/wandoulabs/codis/pkg/utils/errors" - "github.com/wandoulabs/codis/pkg/utils/log" + "github.com/CodisLabs/codis/pkg/proxy/redis" + "github.com/CodisLabs/codis/pkg/utils/atomic2" + "github.com/CodisLabs/codis/pkg/utils/errors" + "github.com/CodisLabs/codis/pkg/utils/log" ) type Session struct { diff --git a/pkg/proxy/router/slots.go b/pkg/proxy/router/slots.go index f53b2c6eb..62a881bf6 100644 --- a/pkg/proxy/router/slots.go +++ b/pkg/proxy/router/slots.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package router @@ -7,9 +7,9 @@ import ( "fmt" "sync" - "github.com/wandoulabs/codis/pkg/proxy/redis" - "github.com/wandoulabs/codis/pkg/utils/errors" - "github.com/wandoulabs/codis/pkg/utils/log" + "github.com/CodisLabs/codis/pkg/proxy/redis" + "github.com/CodisLabs/codis/pkg/utils/errors" + "github.com/CodisLabs/codis/pkg/utils/log" ) type Slot struct { diff --git a/pkg/proxy/router/slots_test.go b/pkg/proxy/router/slots_test.go index 51211614f..0a1761675 100644 --- a/pkg/proxy/router/slots_test.go +++ b/pkg/proxy/router/slots_test.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package router diff --git a/pkg/proxy/router/stats.go b/pkg/proxy/router/stats.go index 367741e9a..a4b4af577 100644 --- a/pkg/proxy/router/stats.go +++ b/pkg/proxy/router/stats.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package router @@ -7,7 +7,7 @@ import ( "encoding/json" "sync" - "github.com/wandoulabs/codis/pkg/utils/atomic2" + "github.com/CodisLabs/codis/pkg/utils/atomic2" ) type OpStats struct { diff --git a/pkg/proxy/topology.go b/pkg/proxy/topology.go index 332817ffd..bc4e6dd42 100644 --- a/pkg/proxy/topology.go +++ b/pkg/proxy/topology.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package proxy @@ -9,9 +9,9 @@ import ( topo "github.com/wandoulabs/go-zookeeper/zk" - "github.com/wandoulabs/codis/pkg/models" - "github.com/wandoulabs/codis/pkg/utils/errors" - "github.com/wandoulabs/codis/pkg/utils/log" + "github.com/CodisLabs/codis/pkg/models" + "github.com/CodisLabs/codis/pkg/utils/errors" + "github.com/CodisLabs/codis/pkg/utils/log" "github.com/wandoulabs/zkhelper" ) diff --git a/pkg/utils/assert/assert.go b/pkg/utils/assert/assert.go index 55ce7820f..34b2d7dbf 100644 --- a/pkg/utils/assert/assert.go +++ b/pkg/utils/assert/assert.go @@ -1,9 +1,9 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package assert -import "github.com/wandoulabs/codis/pkg/utils/log" +import "github.com/CodisLabs/codis/pkg/utils/log" func Must(b bool) { if b { diff --git a/pkg/utils/atomic2/atomic64.go b/pkg/utils/atomic2/atomic64.go index 47dfb90a4..7834587df 100644 --- a/pkg/utils/atomic2/atomic64.go +++ b/pkg/utils/atomic2/atomic64.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package atomic2 diff --git a/pkg/utils/atomic2/bool.go b/pkg/utils/atomic2/bool.go index 71bba0f4a..170902a9f 100644 --- a/pkg/utils/atomic2/bool.go +++ b/pkg/utils/atomic2/bool.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package atomic2 diff --git a/pkg/utils/bytesize/bytesize.go b/pkg/utils/bytesize/bytesize.go index a615c3d49..d880cf6b2 100644 --- a/pkg/utils/bytesize/bytesize.go +++ b/pkg/utils/bytesize/bytesize.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package bytesize @@ -8,8 +8,8 @@ import ( "strconv" "strings" - "github.com/wandoulabs/codis/pkg/utils/errors" - "github.com/wandoulabs/codis/pkg/utils/log" + "github.com/CodisLabs/codis/pkg/utils/errors" + "github.com/CodisLabs/codis/pkg/utils/log" ) const ( diff --git a/pkg/utils/bytesize/bytesize_test.go b/pkg/utils/bytesize/bytesize_test.go index 8d9cd2c6c..51df7d735 100644 --- a/pkg/utils/bytesize/bytesize_test.go +++ b/pkg/utils/bytesize/bytesize_test.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package bytesize_test @@ -6,9 +6,9 @@ package bytesize_test import ( "testing" - "github.com/wandoulabs/codis/pkg/utils/assert" - . "github.com/wandoulabs/codis/pkg/utils/bytesize" - "github.com/wandoulabs/codis/pkg/utils/errors" + "github.com/CodisLabs/codis/pkg/utils/assert" + . "github.com/CodisLabs/codis/pkg/utils/bytesize" + "github.com/CodisLabs/codis/pkg/utils/errors" ) func TestBytesize(t *testing.T) { diff --git a/pkg/utils/errors/errors.go b/pkg/utils/errors/errors.go index dd640d3ad..153af04e3 100644 --- a/pkg/utils/errors/errors.go +++ b/pkg/utils/errors/errors.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package errors @@ -7,7 +7,7 @@ import ( "errors" "fmt" - "github.com/wandoulabs/codis/pkg/utils/trace" + "github.com/CodisLabs/codis/pkg/utils/trace" ) var TraceEnabled = true diff --git a/pkg/utils/errors/list.go b/pkg/utils/errors/list.go index 195cee17f..40c44493e 100644 --- a/pkg/utils/errors/list.go +++ b/pkg/utils/errors/list.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package errors diff --git a/pkg/utils/log/log.go b/pkg/utils/log/log.go index 991dfefd1..c453cc826 100644 --- a/pkg/utils/log/log.go +++ b/pkg/utils/log/log.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package log @@ -12,8 +12,8 @@ import ( "sync" "sync/atomic" - "github.com/wandoulabs/codis/pkg/utils/errors" - "github.com/wandoulabs/codis/pkg/utils/trace" + "github.com/CodisLabs/codis/pkg/utils/errors" + "github.com/CodisLabs/codis/pkg/utils/trace" ) const ( diff --git a/pkg/utils/log/rolling.go b/pkg/utils/log/rolling.go index acff8e048..c63108abc 100644 --- a/pkg/utils/log/rolling.go +++ b/pkg/utils/log/rolling.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package log @@ -10,7 +10,7 @@ import ( "path" "sync" - "github.com/wandoulabs/codis/pkg/utils/errors" + "github.com/CodisLabs/codis/pkg/utils/errors" ) type rollingFile struct { diff --git a/pkg/utils/redis.go b/pkg/utils/redis.go index 24598cd17..4ca67d1d5 100644 --- a/pkg/utils/redis.go +++ b/pkg/utils/redis.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package utils @@ -10,7 +10,7 @@ import ( "github.com/garyburd/redigo/redis" - "github.com/wandoulabs/codis/pkg/utils/errors" + "github.com/CodisLabs/codis/pkg/utils/errors" ) func DialToTimeout(addr string, passwd string, readTimeout, writeTimeout time.Duration) (redis.Conn, error) { diff --git a/pkg/utils/trace/trace.go b/pkg/utils/trace/trace.go index 738b212f6..c48314be5 100644 --- a/pkg/utils/trace/trace.go +++ b/pkg/utils/trace/trace.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package trace diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index c61935b9c..b769cd4a3 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -1,4 +1,4 @@ -// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package utils @@ -11,8 +11,8 @@ import ( "github.com/c4pt0r/cfg" "github.com/wandoulabs/zkhelper" - "github.com/wandoulabs/codis/pkg/utils/errors" - "github.com/wandoulabs/codis/pkg/utils/log" + "github.com/CodisLabs/codis/pkg/utils/errors" + "github.com/CodisLabs/codis/pkg/utils/log" ) func InitConfig() (*cfg.Cfg, error) { diff --git a/pkg/utils/zk.go b/pkg/utils/zk.go index 580aa4a8e..950658e69 100644 --- a/pkg/utils/zk.go +++ b/pkg/utils/zk.go @@ -9,8 +9,7 @@ import ( "github.com/wandoulabs/go-zookeeper/zk" "github.com/wandoulabs/zkhelper" - - "github.com/wandoulabs/codis/pkg/utils/log" + "github.com/CodisLabs/codis/pkg/utils/log" ) const retryMaxOnOps = 10 diff --git a/wandoujia_licese.txt b/wandoujia_licese.txt new file mode 100644 index 000000000..23320dcb4 --- /dev/null +++ b/wandoujia_licese.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Wandoujia Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE.