0.0.9 • Published 10 years ago

redis-sentinel-cluster-client v0.0.9

Weekly downloads
40
License
-
Repository
github
Last release
10 years ago

redis-sentinel-client

redis-sentinel-client

options= clients: {role:"master",name:"mymaster"} sentinels: {host:"10.2.124.205",port:"26379"}, {host:"10.2.124.204",port:"26389"}, {host:"10.2.124.206",port:"26379"} logger:console talkSentinelPingTime:2000 clientPingTime:2000 clientNoSlaveReconnectTime:3000 checkClientTime:10000 noMasterPartnerSentinelReconnectTime:5000

process.on 'uncaughtException', (err)-> console.error((new Date).toUTCString() + ' uncaughtException:', err.message) console.error(err.stack) process.exit(1)

client=new RedisSentinelClient.createClient options c=client.getClient "mymaster" ping=(err)-> if err console.error "ping error:#{err}" else console.info "ping success"

c.on "firstconnect",()-> console.log "firstconnect---------------" lua="local arr=redis.call('zrange',KEYS1,0,999999); for i,v in ipairs(arr) do redis.call('zadd',KEYS1,-0.0000001/i,v) end; return nil;" c.eval lua,1,"rank:a",(err,ret)-> if err console.error err else console.log ret

c.on "connecting",()-> console.log "connecting---------------" c.on "reconnect",()-> console.log "reconnect---------------" c.on "connect",()-> console.log "connect---------------"

ping()

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago