Coder Social home page Coder Social logo

alibaba / apsaracache Goto Github PK

View Code? Open in Web Editor NEW
941.0 114.0 165.0 68.09 MB

archived | ApsaraCache is a Redis branch originated from Alibaba Group.

License: BSD 3-Clause "New" or "Revised" License

Makefile 0.26% Shell 0.43% C 84.11% C++ 0.15% Ruby 1.94% Tcl 13.09% Smarty 0.03%

apsaracache's Introduction

⚠️ This project is archived

What is ApsaraCache ?

ApsaraCache is based on the Redis official release 4.0 and has many features and performance enhancements. ApsaraCache has proven to be very stable and efficient in production environment.

There are many features in ApsaraCache, the following two are included in this release and the other features will be gradually released in the subsequent, so stay tuned.

  • ApsaraCache supports two main protocols of Memcached: the classic ASCII, and the newer binary. You can use ApsaraCache just as Memcached, and no client code need to be modified. You can persist your data by using ApsaraCache in Memcached mode just like Redis.
  • In short connection scenario, ApsaraCache makes 30% performance increase compared with the vanilla version.

Building ApsaraCache

It is as simple as:

% make

Running ApsaraCache

In default, ApsaraCache run in Redis mode. If you want ApsaraCache to run in Memcached mode, just add option

   protocol  memcache

to redis.conf.

To run ApsaraCache with the default configuration just type:

% cd src
% ./redis-server

If you want to provide your redis.conf, you have to run it using an additional parameter (the path of the configuration file):

% cd src
% ./redis-server /path/to/redis.conf

It is possible to alter the ApsaraCache configuration by passing parameters directly as options using the command line. Examples:

% ./redis-server --port 9999 --slaveof 127.0.0.1 6379
% ./redis-server /etc/redis/6379.conf --loglevel debug

All the options in redis.conf are also supported as options using the command line, with exactly the same name.

Playing with ApsaraCache in Redis mode

You can use redis-cli to play with ApsaraCache. Start a redis-server instance, then in another terminal try the following:

% cd src
% ./redis-cli
redis> ping
PONG
redis> set foo bar
OK
redis> get foo
"bar"
redis> incr mycounter
(integer) 1
redis> incr mycounter
(integer) 2
redis>

You can find the list of all the available commands at http://redis.io/commands.

Playing with ApsaraCache in Memcached mode

You can use telnet to visit ApsaraCache(telnet use the classic ASCII protocol).

 % telnet your-host your-port(usually 11211)
 
   set key 10 3600 2
   ok
   STORED
   get key
   VALUE key 10 2
   ok
   END  

Enjoy!

Test new persistence mechanism and PITR

Test log based replication(AOF PSYNC)

Documentation

Contributing

See ApsaraCache Contributing Guide for more information.

apsaracache's People

Contributors

0xtonyxia avatar advance512 avatar antirez avatar anydot avatar badboy avatar catwell avatar charsyam avatar dvirsky avatar erikdubbelboer avatar geoffgarside avatar hampus avatar itamarhaber avatar jbergstroem avatar jokea avatar kingpeterpaule avatar lamby avatar mariano-perez-rodriguez avatar mattsta avatar melo avatar michael-grunder avatar nanxiao avatar oranagra avatar pietern avatar saurabhjha avatar soloestoy avatar soveran avatar sunheehnus avatar yamt avatar yoav-steinberg avatar yossigo 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  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

apsaracache's Issues

为什么不直接向Redis提交PR

看描述是基于Redis的拓展和优化,在存在Redis的情况下,为什么要选择重新造一个轮子,而不是完善现有的Redis?
公司是出于什么方面的考量呢?

memrchr compile error on OSX

can't compile on OSX, cause there is no definition for memrchr.
file : src/memcached_parser.c
function: memcachedBinaryCompleteSaslAuth

passwd = memrchr(challenge + 1, '\0', vlen - 1);

and when run with memcache prococol, default port is still 6379, rather than 11211 as stated

noreply have problem

[root@master ~]# telnet 172.23.129.14 7003
Trying 172.23.129.14...
Connected to 172.23.129.14.
Escape character is '^]'.
set yang 1 1111 2 noreply
bb
get yang
get ya
get yang
get yang

memcache版本,数据迁移失败, ERR operation not permitted, invalid requst. memcache协议是否不支持数据迁移?

[root@master git]# redis-cli -c -h 172.23.129.14 -p 7001
172.23.129.14:7001> cluster nodes
79728c53c851f48065f8454a6c6e509fba404b4d 172.23.129.14:7004@17004 slave 12eeec99bcadfab43980c2bb53035259a6a02424 0 1515415047662 3 connected
011c38512ce0a3efeb69253e972dcaec145fc9ee 172.23.129.14:7005@17005 master - 0 1515415044000 4 connected 10923-16383
177bc4491ea8cb90e00610bc973fb30f94acb6d2 172.23.129.14:7001@17001 myself,master - 0 1515415045000 1 connected 0-5461
fcf68e9ab709dd323df4e216752036d9f5e96f7d 172.23.129.14:7006@17006 slave 011c38512ce0a3efeb69253e972dcaec145fc9ee 0 1515415045000 4 connected
12eeec99bcadfab43980c2bb53035259a6a02424 172.23.129.14:7003@17003 master - 0 1515415046658 3 connected 5462-10922
5e2ff6ca84f25af69f8cb3b15f8933b7750588fb 172.23.129.14:7002@17002 slave 177bc4491ea8cb90e00610bc973fb30f94acb6d2 0 1515415045655 5 connected
172.23.129.14:7001>
172.23.129.14:7001>
172.23.129.14:7001>
172.23.129.14:7001> CLUSTER SETSLOT 3215 migrating 12eeec99bcadfab43980c2bb53035259a6a02424
OK
172.23.129.14:7001> cluster nodes
79728c53c851f48065f8454a6c6e509fba404b4d 172.23.129.14:7004@17004 slave 12eeec99bcadfab43980c2bb53035259a6a02424 0 1515415151893 3 connected
011c38512ce0a3efeb69253e972dcaec145fc9ee 172.23.129.14:7005@17005 master - 0 1515415149000 4 connected 10923-16383
177bc4491ea8cb90e00610bc973fb30f94acb6d2 172.23.129.14:7001@17001 myself,master - 0 1515415150000 1 connected 0-5461 [3215->-12eeec99bcadfab43980c2bb53035259a6a02424]
fcf68e9ab709dd323df4e216752036d9f5e96f7d 172.23.129.14:7006@17006 slave 011c38512ce0a3efeb69253e972dcaec145fc9ee 0 1515415153898 4 connected
12eeec99bcadfab43980c2bb53035259a6a02424 172.23.129.14:7003@17003 master - 0 1515415154901 3 connected 5462-10922
5e2ff6ca84f25af69f8cb3b15f8933b7750588fb 172.23.129.14:7002@17002 slave 177bc4491ea8cb90e00610bc973fb30f94acb6d2 0 1515415154000 5 connected
172.23.129.14:7001> quit

[root@master git]# redis-cli -c -h 172.23.129.14 -p 7003
172.23.129.14:7003> CLUSTER SETSLOT 3215 importing 177bc4491ea8cb90e00610bc973fb30f94acb6d2
OK
172.23.129.14:7003> cluster nodes
fcf68e9ab709dd323df4e216752036d9f5e96f7d 172.23.129.14:7006@17006 slave 011c38512ce0a3efeb69253e972dcaec145fc9ee 0 1515415224000 4 connected
5e2ff6ca84f25af69f8cb3b15f8933b7750588fb 172.23.129.14:7002@17002 slave 177bc4491ea8cb90e00610bc973fb30f94acb6d2 0 1515415225571 5 connected
011c38512ce0a3efeb69253e972dcaec145fc9ee 172.23.129.14:7005@17005 master - 0 1515415224567 4 connected 10923-16383
177bc4491ea8cb90e00610bc973fb30f94acb6d2 172.23.129.14:7001@17001 master - 0 1515415226000 1 connected 0-5461
79728c53c851f48065f8454a6c6e509fba404b4d 172.23.129.14:7004@17004 slave 12eeec99bcadfab43980c2bb53035259a6a02424 0 1515415226573 3 connected
12eeec99bcadfab43980c2bb53035259a6a02424 172.23.129.14:7003@17003 myself,master - 0 1515415225000 3 connected 5462-10922 [3215-<-177bc4491ea8cb90e00610bc973fb30f94acb6d2]
172.23.129.14:7003>
172.23.129.14:7003>
172.23.129.14:7003> cluster nodes
fcf68e9ab709dd323df4e216752036d9f5e96f7d 172.23.129.14:7006@17006 slave 011c38512ce0a3efeb69253e972dcaec145fc9ee 0 1515415260000 4 connected
5e2ff6ca84f25af69f8cb3b15f8933b7750588fb 172.23.129.14:7002@17002 slave 177bc4491ea8cb90e00610bc973fb30f94acb6d2 0 1515415260695 5 connected
011c38512ce0a3efeb69253e972dcaec145fc9ee 172.23.129.14:7005@17005 master - 0 1515415259000 4 connected 10923-16383
177bc4491ea8cb90e00610bc973fb30f94acb6d2 172.23.129.14:7001@17001 master - 0 1515415260000 1 connected 0-5461
79728c53c851f48065f8454a6c6e509fba404b4d 172.23.129.14:7004@17004 slave 12eeec99bcadfab43980c2bb53035259a6a02424 0 1515415260000 3 connected
12eeec99bcadfab43980c2bb53035259a6a02424 172.23.129.14:7003@17003 myself,master - 0 1515415259000 3 connected 5462-10922 [3215-<-177bc4491ea8cb90e00610bc973fb30f94acb6d2]
172.23.129.14:7003>
172.23.129.14:7003> quit

[root@master git]# redis-cli -c -h 172.23.129.14 -p 7001
172.23.129.14:7001> CLUSTER GETKEYSINSLOT 3215 20

  1. "foo_rand000000000000"
    172.23.129.14:7001> MIGRATE 127.0.0.1 7003 foo_rand000000000000 0 10 replace
    (error) ERR operation not permitted, invalid requst.
    172.23.129.14:7001> quit
    [root@master git]# redis-cli -c -h 172.23.129.14 -p 7003
    172.23.129.14:7003> MIGRATE 127.0.0.1 7001 foo_rand000000000000 0 10 replace
    (error) ERR operation not permitted, invalid requst.
    172.23.129.14:7003>
    172.23.129.14:7003>
    172.23.129.14:7003> MIGRATE 127.0.0.1 7001 foo_rand000000000000 0 10
    (error) ERR operation not permitted, invalid requst.
    172.23.129.14:7003>

Is the project dead?

I haven't seen new release for long time, so would be great to know the plans with this.
Thanks

build error in ubuntu 16.04LTS

After upgrade jemalloc to the new version, build error in ubuntu 16.04LTS, next are the information:

cd src && make all
make[1]: Entering directory '/home/longweijin/github.com/ApsaraCache/src'
    LINK redis-server
zmalloc.o: In function `zmalloc':
/home/longweijin/github.com/ApsaraCache/src/zmalloc.c:98: undefined reference to `je_malloc'
/home/longweijin/github.com/ApsaraCache/src/zmalloc.c:102: undefined reference to `je_malloc_usable_size'
/home/longweijin/github.com/ApsaraCache/src/zmalloc.c:102: undefined reference to `je_malloc_usable_size'
zmalloc.o: In function `zcalloc':
/home/longweijin/github.com/ApsaraCache/src/zmalloc.c:130: undefined reference to `je_calloc'
/home/longweijin/github.com/ApsaraCache/src/zmalloc.c:134: undefined reference to `je_malloc_usable_size'
/home/longweijin/github.com/ApsaraCache/src/zmalloc.c:134: undefined reference to `je_malloc_usable_size'
zmalloc.o: In function `zrealloc':
/home/longweijin/github.com/ApsaraCache/src/zmalloc.c:152: undefined reference to `je_malloc_usable_size'
/home/longweijin/github.com/ApsaraCache/src/zmalloc.c:153: undefined reference to `je_realloc'
/home/longweijin/github.com/ApsaraCache/src/zmalloc.c:157: undefined reference to `je_malloc_usable_size'
/home/longweijin/github.com/ApsaraCache/src/zmalloc.c:157: undefined reference to `je_malloc_usable_size'
zmalloc.o: In function `zfree':
/home/longweijin/github.com/ApsaraCache/src/zmalloc.c:194: undefined reference to `je_malloc_usable_size'
/home/longweijin/github.com/ApsaraCache/src/zmalloc.c:194: undefined reference to `je_malloc_usable_size'
/home/longweijin/github.com/ApsaraCache/src/zmalloc.c:195: undefined reference to `je_free'
networking.o: In function `sdsZmallocSize':
/home/longweijin/github.com/ApsaraCache/src/networking.c:43: undefined reference to `je_malloc_usable_size'
networking.o: In function `getStringObjectSdsUsedMemory':
/home/longweijin/github.com/ApsaraCache/src/networking.c:52: undefined reference to `je_malloc_usable_size'
networking.o: In function `sdsZmallocSize':
/home/longweijin/github.com/ApsaraCache/src/networking.c:43: undefined reference to `je_malloc_usable_size'
object.o: In function `objectComputeSize':
/home/longweijin/github.com/ApsaraCache/src/object.c:765: undefined reference to `je_malloc_usable_size'
object.o: In function `getMemoryOverheadData':
/home/longweijin/github.com/ApsaraCache/src/object.c:831: undefined reference to `je_malloc_usable_size'
object.o: In function `memoryCommand':
/home/longweijin/github.com/ApsaraCache/src/object.c:1158: undefined reference to `je_mallctl'
/home/longweijin/github.com/ApsaraCache/src/object.c:1160: undefined reference to `je_mallctl'
/home/longweijin/github.com/ApsaraCache/src/object.c:1145: undefined reference to `je_malloc_stats_print'
collect2: error: ld returned 1 exit status
Makefile:199: recipe for target 'redis-server' failed
make[1]: *** [redis-server] Error 1
make[1]: Leaving directory '/home/longweijin/github.com/ApsaraCache/src'
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 2

aofsplit逻辑漏洞

aofSplit>openAppendOnly

如果openAppendOnly失败,则appendonly被关闭;此时无法执行写命令,并且即使磁盘恢复正常server也无法自动恢复。

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.