Giter Site home page Giter Site logo

qedis's Introduction

 _____     _____   _____   _   ______                  
/  _  \   | ____| |  _  \ | | /  ___/                        
| | | |   | |__   | | | | | | | |____
| | | |   |  __|  | | | | | |  \__   \
| |_| |_  | |___  | |_| | | |  ___|  |
\_______| |_____| |_____/ |_| /_____/

Build Status

看中文说明请点我

A C++11 implementation of distributed redis server, use Leveldb for persist storage.(including cluster)

Requirements

  • C++11 & CMake
  • Linux or OS X

Cluster Features

Use zookeeper for leader election, to reach high availability.

Of course you can also use redis-sentinel.

See details in cluster Readme, still in development.

Fully compatible with redis

You can test Qedis with redis-cli, redis-benchmark, or use redis as master with Qedis as slave or conversely, it also can work with redis sentinel. In a word, Qedis is full compatible with Redis.

Support module for write your own extensions

Qedis supports module now, still in progress, much work to do. I added three commands(ldel, skeys, hgets) for demonstration.

Persistence: Not limited to memory

Leveldb can be configured as backend for Qedis.

High Performance

  • Qedis is approximately 20-25% faster than redis if run benchmark with pipeline requests(set -P = 50 or higher).
  • Average 80K requests per seconds for write, and 90K requests per seconds for read.
  • Before run test, please ensure that std::list::size() is O(1), obey the C++11 standards.

Run this command, compare with redis use pipeline commands, try it.

./redis-benchmark -q -n 1000000 -P 50 -c 50

image

Support LRU cache

When memory is low, you can make Qedis to free memory by evict some key according to LRU.

Master-slave Replication, transaction, RDB/AOF, slow log, publish-subscribe

Qedis supports them all :-)

Command List

show all supported commands list, about 140 commands

  • cmdlist

TODO

  • Support lua
  • Golang Cluster client

qedis's People

Contributors

lliujj avatar loveyacper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qedis's Issues

sentinel create node failed

got errors deserialize_CreateResponse failed from gedis-server and Error:KeeperErrorCode = NoNode for /servers/set-1 from zookeeper.

config file:

logdir stdout
bind 127.0.0.1
port 8001
loglevel debug

cluster on
clustercenters 127.0.0.1:2181
setid 1

logs:

2019-12-05[15:07:15.240][USR]:ListenSocket.cc:66 Success: listen on (127.0.0.1:8001)
2019-12-05[15:07:15.240][DBG]:QAOF.cc:63 start aof thread
2019-12-05[15:07:15.240][INF]:ClientSocket.cc:59 EINPROGRESS: ClientSocket connected to (127.0.0.1:2181)
2019-12-05[15:07:15.241][INF]:ClientSocket.cc:105 Success: ClientSocket connected to (127.0.0.1:2181)
2019-12-05[15:07:15.241][DBG]:Server.cc:161 Server::NewConnection()
2019-12-05[15:07:15.241][DBG]:Qedis.cc:145 Connect success to cluster 127.0.0.1:2181
2019-12-05[15:07:15.241][INF]:StreamSocket.cc:33 Init peer address (127.0.0.1:2181), local socket is 6
2019-12-05[15:07:15.241][DBG]:Server.cc:179 NetThreadPool::Instance().AddSocket succeed. tasks_.AddTask()
2019-12-05[15:07:15.241][DBG]:TaskManager.cc:17 TaskManager::AddTask | socket 127.0.0.1:2181, id = 3
2019-12-05[15:07:15.242][INF]:TaskManager.cc:70 New connection from 127.0.0.1:2181, id = 3, invalid = 0
2019-12-05[15:07:15.244][DBG]:ZookeeperConn.cc:241 Expired old session 103252631870701580
2019-12-05[15:07:15.244][DBG]:Socket.cc:45 Socket::OnError | invalid = 0
2019-12-05[15:07:15.244][ERR]:StreamSocket.cc:208 OnError peer address (127.0.0.1:2181), local socket is 6
2019-12-05[15:07:15.244][WRN]:Qedis.cc:243 Connect cluster failed 127.0.0.1:2181
2019-12-05[15:07:15.244][INF]:StreamSocket.cc:129 OnReadable failed, peer address (127.0.0.1:2181), local socket is 6
2019-12-05[15:07:15.244][DBG]:Socket.cc:45 Socket::OnError | invalid = 1
2019-12-05[15:07:15.244][DBG]:Socket.cc:51 Socket::OnError | invalid = 1
2019-12-05[15:07:15.245][INF]:TaskManager.cc:90 Close connection from 127.0.0.1:2181, id = 3
2019-12-05[15:07:15.273][INF]:StreamSocket.cc:19 ~StreamSocket peer (127.0.0.1:2181)
2019-12-05[15:07:15.273][DBG]:Socket.cc:67 CloseSocket 6
2019-12-05[15:07:17.244][USR]:Qedis.cc:250 OnTimer connect to 127.0.0.1:2181
2019-12-05[15:07:17.258][INF]:ClientSocket.cc:59 EINPROGRESS: ClientSocket connected to (127.0.0.1:2181)
2019-12-05[15:07:17.259][INF]:TaskManager.cc:70 New connection from 127.0.0.1:2181, id = 5, invalid = 0
2019-12-05[15:07:17.258][INF]:ClientSocket.cc:105 Success: ClientSocket connected to (127.0.0.1:2181)
2019-12-05[15:07:17.258][DBG]:Server.cc:161 Server::NewConnection()
2019-12-05[15:07:17.258][DBG]:Qedis.cc:145 Connect success to cluster 127.0.0.1:2181
2019-12-05[15:07:17.258][INF]:StreamSocket.cc:33 Init peer address (127.0.0.1:2181), local socket is 6
2019-12-05[15:07:17.258][DBG]:Server.cc:179 NetThreadPool::Instance().AddSocket succeed. tasks_.AddTask()
2019-12-05[15:07:17.258][DBG]:TaskManager.cc:17 TaskManager::AddTask | socket 127.0.0.1:2181, id = 5
2019-12-05[15:07:17.263][DBG]:ZookeeperConn.cc:249 new session Id:103252631870701581
2019-12-05[15:07:17.263][INF]:ZookeeperConn.cc:209 _RunForMaster, setid 1, value 127.0.0.1:8001
2019-12-05[15:07:17.265][INF]:ZookeeperConn.cc:364 got req.type 1
2019-12-05[15:07:17.265][ERR]:ZookeeperConn.cc:384 deserialize_CreateResponse failed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.