Public | Automated Build

Last pushed: a year ago
Short Description
all codis
Full Description

#

DZĿɲcodisİװ, Ҫ.

˵

codisҪcentos6.5
codiszookeeper

װ

1.޸codisļconfig.ini

1.1 config.inicodis/codisconf/ 
1.2 ޸ĵ7zk=zookeeperȺĵַ
1.3 ޸ĵ9product=codisname, codisnameԼ, ǸcodisȺһ, ֻдzk
1.4 ޸ĵ14dashboard_addr=ip:port,dashboardipͶ˿, Ҫдlocalhost, ˿ĬΪ18087, ʹĬ϶˿

2.dashboard

cd codis
nohupķʽdashboard
nohup ./bin/codis-config -c ./codisconf/config.ini dashboard > ./codislog/codisname.log 2>&1 &
logļָʵʵcodisname޸
ͨhttp://ip:18087Էdashboard
һcodisȺֻҪһdashboard

3.ʼslots

cd codis
./bin/codis-config -c ./codisconf/config.ini slot init
zookeeperϴslotϢ

4.codis-server

codis-serverredis.
4.1 ޸codis-serverļ
codis/serverconf/confиserverʾļ,Ҫ޸ijЩ.
2̨, 192.168.168.123,192.168.168.124, ÿ2server, ÿserverռõĶ˿Ϊ6900,6901
cp server.conf  server6900.conf
cp server.conf  server6901.conf
vi server6900.conf
޸²
pidfile "./serverconf/pid/server6900.pid"
port 6900
bind 192.168.168.123
logfile "./serverconf/log/server6900.log"
dbfilename "dump6900.rdb"
dir "./serverconf/data"
maxmemory 15gb(ݻʵ޸ĸserverڴ)
4.2 codis-serverò޸
4.3 codis-server
./bin/codis-server ./serverconf/conf/server6900.conf
./bin/codis-server ./serverconf/conf/server6901.conf

5. codis-server group

codis-serverʵӵcodisȺ
ÿһ Server Group Ϊһ server , ֻһ master, ж slave, group id ִ֧ڵ1
:  server group, ÿ group  server ʵgroupidֱΪ12
codis-serverʵΪһһӡ
һgroupgroupidΪ1 һredis mastergroup
./bin/codis-config server add 1 192.168.168.123:6900 master
һredis slavegroup
../bin/codis-config server add 1 192.168.168.124:6901 slave
ƵģgroupgroupidΪ2
../bin/codis-config server add 2 192.168.168.124:6900 master
../bin/codis-config server add 2 192.168.168.123:6901 slave
ע: masterslaveҪͬһ̨, ,ӾͶ

6. server groupslot

Codis  Pre-sharding ļʵݵķƬ, ĬϷֳ 1024  slots (0-1023), ÿkey˵, ͨ¹ʽȷ Slot Id : SlotId = crc32(key) % 1024 ÿһ slot һض server group id ʾ slot ĸ server group ṩ
:
ñΪ[0, 511] slot  server group 1 ṩ,  [512, 1023]  slot  server group 2 ṩ
./bin/codis-config slot range-set 0 511 1 online
./bin/codis-config slot range-set 512 1023 2 online

7. codis-proxy

һcodisȺٿһproxy, Ϊ˸߿, 23
codis-proxyļcodis/proxyconf/
codisconfµļһ, ֻһproxy_id=proxy_1һ, proxy_idǸproxy, Զ, ֻдzk
nohup ./bin/codis-proxy -c proxyconf/config.ini -L ./proxylog/proxyid.log  --cpu=2 --addr=192.168.168.123:19000 --http-addr=192.168.168.123:11000 > ./proxylog/proxyid.log 2>&1 &
proxyidʵ޸
--cpuָproxyռõcpu, Խ,Խǿ

8. codis-ha

codis-haԼdashboard, ijmasterҵ, codis-haԶslaveΪmaster
nohup ./bin/codis-ha --codis-config=ip:18087 --productName=test &
ע:ipΪdashboardip
    productNameΪdashboardconfig.iniļеproductֵ

9. http://ip:18087

鿴codisļ. 鿴proxy״̬ǷΪonline, Ϊoffline, ҲMark Online
Docker Pull Command
Owner
abigbigbird
Source Repository