Git Product home page Git Product logo

tendis's Introduction

tendis

Tendis is a high-performance distributed storage system which is fully compatible with the Redis protocol. 中文文档

Table of Contents

Introduction

Tendis is a high-performance distributed storage system which is fully compatible with the Redis protocol. It uses RocksDB as the storage engine, and all data is stored to disks through RocksDB. Users can access Tendis using a Redis client, and the application hardly needs to be changed. In addition, Tendis supports storage capacity far exceeding memory, which can greatly reduce user storage costs.

Similar to Redis clusters, Tendis uses a decentralized distributed solution. The gossip protocol is used for communication between nodes, and all nodes in a cluster can be routed to the correct node when a user accesses. Cluster nodes support automatic discovery of other nodes, detect faulty nodes, and ensure the application is almost not affected when the master node failed.

Features

  • Redis compatibility

    Redis protocol and commands supported in Tendis are compatible with Redis.

  • Persistent storage

    Using RocksDB as storage engine. All data is stored in RocksDB in a specific format, supporting PB-level storage capacity.

  • Decentralized distributed cluster

    Distributed implementation like Redis clusters, using a gossip protocol to intercommunicate between nodes.

  • Horizontal scalability

    Data migration online between nodes. High performance and linear scalability up to 1,000 nodes.

  • Failover

    Auto-detect non-working nodes, and promote replica nodes to master when a failure occurs.

  • Key component for Tendis Hybrid Storage Edition

    Thanks to the design and internal optimization, Redis and Tendis can work together to be Hybrid Storage Edition. It is suitable for KV storage scenarios, as it balances performance and cost, and greatly reduces your business operating costs by 80% in the scenarios where cold data takes up a lot of storage space.

Get Started

Requirements

  • g++ (required by c++17, version >= 5.5)
  • cmake (version >= 3.13.0)

Build

$ git clone https://github.com/Tencent/tendis.git --recursive
$ git submodule update --init --recursive
$ mkdir bulid
$ cd build & cmake ..
$ make -j12

Run and Play

$ ./build/bin/tendisplus tendisplus.conf

Connect to the server via redis-cli

$ redis-cli -p 51002

TEST

You can make some change to the code and make sure the following test script pass.

$ sh ./testall.sh

Performance

Hardware spec

CPU:2.50 GHz,48 core
DISK:NVMe SSD
MEM:192GB

Benchmarks and QPS numbers

tendisplus: workers = 56

./memtier_benchmark -t 20 -c 50 -s 127.0.0.1 -p 51002 --distinct-client-seed --command="set __key__ __data__" --key-prefix="kv_" --key-minimum=1 --key-maximum=500000000 --random-data --data-size=128 --test-time=1800
./memtier_benchmark -t 20 -c 50 -s 127.0.0.1 -p 51002 --distinct-client-seed --command="get __key__" --key-prefix="kv_" --key-minimum=1 --key-maximum=500000000 --test-time=1800
./memtier_benchmark -t 20 -c 50 -s 127.0.0.1 -p 51002 --distinct-client-seed --command="incr __key__" --key-prefix="int_" --key-minimum=1 --key-maximum=1000000 --test-time=1800
./memtier_benchmark -t 20 -c 50 -s 127.0.0.1 -p 51002 --distinct-client-seed --command="lpush __key__ __data__" --key-prefix="list_" --key-minimum=1 --key-maximum=1000000 --random-data --data-size=128 --test-time=1800
./memtier_benchmark -t 20 -c 50 -s 127.0.0.1 -p 51002 --distinct-client-seed --command="sadd __key__ __data__" --key-prefix="set_" --key-minimum=1 --key-maximum=1000000 --random-data --data-size=128 --test-time=1800
./memtier_benchmark -t 20 -c 50 -s 127.0.0.1 -p 51002 --distinct-client-seed --command="zadd __key__ __key__ __data__" --key-prefix="" --key-minimum=1 --key-maximum=1000000 --random-data --data-size=128 --test-time=1800
./memtier_benchmark -t 20 -c 50 -s 127.0.0.1 -p 51002 --distinct-client-seed --command="hset __key__ __data__ __data__" --key-prefix="hash_" --key-minimum=1 --key-maximum=1000000 --random-data --data-size=128 --test-time=1800

image.png

latency:

SET    1.6ms    99%
SET    2.2ms    99.9%
SET    6.9ms    99.99%
SET    9.4ms    100.00%

QPS on different payload

tendisplus: workers = 56

./memtier_benchmark -t 20 -c 50 -s 127.0.0.1 -p 51002 --distinct-client-seed --command="set __key__ __data__" --key-prefix="kv_" --command-key-pattern=R --random-data --data-size=128 --test-time=1800
./memtier_benchmark -t 20 -c 50 -s 127.0.0.1 -p 51002 --distinct-client-seed --command="get __key__" --key-prefix="kv_" --command-key-pattern=R --test-time=1800

image.png

we test set for half an hour, and then test get key half an hour. because the data is not big enough, most of the data is in memory, so the get qps for different payload is nearly the same.

Contributing

For more information regarding contributing issues or pull requests, checkout CONTRIBUTING

Support

Checkout support for FAQs or join our discussion groups.

License

Tendis is licensed under the GNU General Public License Version 3.0. Copyright and license information can be found in the file LICENSE.txt.

tendis's People

Contributors

barneyxiao avatar evil-crow avatar jingjunli avatar lukemakeit avatar raffertyyu avatar takenliu avatar tendisdev avatar vinchen 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

tendis's Issues

cmake failed

CMake Error: install(EXPORT "glog-targets" ...) includes target "glog" which requires target "gflags_nothreads_static" that is not in the export set.
CMake Error: install(EXPORT "RocksDBTargets" ...) includes target "rocksdb" which requires target "gflags_nothreads_static" that is not in the export set.
CMake Error: install(EXPORT "RocksDBTargets" ...) includes target "rocksdb-shared" which requires target "gflags_nothreads_static" that is not in the export set.
-- Generating done

ubuntu2004上cmake报错fatal error: sys/endian.h: No such file or directory

内核版本: 4.19.128
gcc版本:9.3.0
cmake版本:3.16.3

Determining if the include file sys/endian.h exists failed with the following output:
Change Dir: /home/jud/tendis/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_e4817/fast && /usr/bin/make -f CMakeFiles/cmTC_e4817.dir/build.make CMakeFiles/cmTC_e4817.dir/build
make[1]: Entering directory '/home/jud/tendis/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_e4817.dir/CheckIncludeFile.c.o
/usr/bin/cc    -o CMakeFiles/cmTC_e4817.dir/CheckIncludeFile.c.o   -c /home/jud/tendis/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
/home/jud/tendis/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:10: fatal error: sys/endian.h: No such file or directory
    1 | #include <sys/endian.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [CMakeFiles/cmTC_e4817.dir/build.make:66: CMakeFiles/cmTC_e4817.dir/CheckIncludeFile.c.o] Error 1
make[1]: Leaving directory '/home/jud/tendis/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_e4817/fast] Error 2

Determining if the include file windows.h exists failed with the following output:
Change Dir: /home/jud/tendis/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_70456/fast && /usr/bin/make -f CMakeFiles/cmTC_70456.dir/build.make CMakeFiles/cmTC_70456.dir/build
make[1]: Entering directory '/home/jud/tendis/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_70456.dir/CheckIncludeFile.c.o
/usr/bin/cc    -o CMakeFiles/cmTC_70456.dir/CheckIncludeFile.c.o   -c /home/jud/tendis/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
/home/jud/tendis/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:10: fatal error: windows.h: No such file or directory
    1 | #include <windows.h>
      |          ^~~~~~~~~~~
compilation terminated.
make[1]: *** [CMakeFiles/cmTC_70456.dir/build.make:66: CMakeFiles/cmTC_70456.dir/CheckIncludeFile.c.o] Error 1
make[1]: Leaving directory '/home/jud/tendis/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_70456/fast] Error 2

Determining if the function lzo1x_1_15_compress exists in the lzo2 failed with the following output:
Change Dir: /home/jud/tendis/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_19cea/fast && /usr/bin/make -f CMakeFiles/cmTC_19cea.dir/build.make CMakeFiles/cmTC_19cea.dir/build
make[1]: Entering directory '/home/jud/tendis/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_19cea.dir/CheckFunctionExists.c.o
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=lzo1x_1_15_compress   -o CMakeFiles/cmTC_19cea.dir/CheckFunctionExists.c.o   -c /usr/share/cmake-3.16/Modules/CheckFunctionExists.c
Linking C executable cmTC_19cea
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_19cea.dir/link.txt --verbose=1
/usr/bin/cc  -DCHECK_FUNCTION_EXISTS=lzo1x_1_15_compress    -rdynamic CMakeFiles/cmTC_19cea.dir/CheckFunctionExists.c.o  -o cmTC_19cea  -llzo2
/usr/bin/ld: cannot find -llzo2
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_19cea.dir/build.make:87: cmTC_19cea] Error 1
make[1]: Leaving directory '/home/jud/tendis/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_19cea/fast] Error 2

Performing C++ SOURCE FILE Test HAVE_VISUAL_STUDIO_ARCH_AVX failed with the following output:
Change Dir: /home/jud/tendis/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_e6f7b/fast && /usr/bin/make -f CMakeFiles/cmTC_e6f7b.dir/build.make CMakeFiles/cmTC_e6f7b.dir/build
make[1]: Entering directory '/home/jud/tendis/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_e6f7b.dir/src.cxx.o
/usr/bin/c++    -std=c++17 -g -fno-omit-frame-pointer  -DHAVE_VISUAL_STUDIO_ARCH_AVX   /arch:AVX -o CMakeFiles/cmTC_e6f7b.dir/src.cxx.o -c /home/jud/tendis/build/CMakeFiles/CMakeTmp/src.cxx
c++: error: /arch:AVX: No such file or directory
make[1]: *** [CMakeFiles/cmTC_e6f7b.dir/build.make:66: CMakeFiles/cmTC_e6f7b.dir/src.cxx.o] Error 1
make[1]: Leaving directory '/home/jud/tendis/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_e6f7b/fast] Error 2

Branch dev-2.2 Build Failure with gcc 10.2.0 on MacOS

Description

Following build instructions seeing failures as followings

Scanning dependencies of target rocksdb
[ 10%] Building CXX object src/thirdparty/rocksdb-5.13.4/rocksdb/CMakeFiles/rocksdb.dir/cache/clock_cache.cc.o
[ 10%] Building CXX object src/thirdparty/rocksdb-5.13.4/rocksdb/CMakeFiles/rocksdb.dir/cache/lru_cache.cc.o
[ 10%] Building CXX object src/thirdparty/rocksdb-5.13.4/rocksdb/CMakeFiles/rocksdb.dir/cache/sharded_cache.cc.o
[ 10%] Building CXX object src/thirdparty/rocksdb-5.13.4/rocksdb/CMakeFiles/rocksdb.dir/db/builder.cc.o
In file included from /Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/range_del_aggregator.h:15,
                 from /Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/memtable.h:19,
                 from /Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/memtable_list.h:16,
                 from /Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/column_family.h:17,
                 from /Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/version_set.h:31,
                 from /Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/compaction.h:11,
                 from /Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/compaction_iterator.h:12,
                 from /Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/builder.cc:16:
/Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/version_edit.h: In constructor 'rocksdb::FdWithKeyRange::FdWithKeyRange(rocksdb::FileDescriptor, rocksdb::Slice, rocksdb::Slice, rocksdb::FileMetaData*)':
/Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/version_edit.h:157:33: error: implicitly-declared 'constexpr rocksdb::FileDescriptor::FileDescriptor(const rocksdb::FileDescriptor&)' is deprecated [-Werror=deprecated-copy]
  157 |         largest_key(_largest_key) {}
      |                                 ^
/Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/version_edit.h:47:19: note: because 'rocksdb::FileDescriptor' has user-provided 'rocksdb::FileDescriptor& rocksdb::FileDescriptor::operator=(const rocksdb::FileDescriptor&)'
   47 |   FileDescriptor& operator=(const FileDescriptor& fd) {
      |                   ^~~~~~~~
/Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/version_edit.h: In instantiation of 'constexpr std::pair<_T1, _T2>::pair(_U1&&, _U2&&) [with _U1 = int&; _U2 = rocksdb::FileMetaData; typename std::enable_if<(std::_PCC<true, _T1, _T2>::_MoveConstructiblePair<_U1, _U2>() && std::_PCC<true, _T1, _T2>::_ImplicitlyMoveConvertiblePair<_U1, _U2>()), bool>::type <anonymous> = true; _T1 = int; _T2 = rocksdb::FileMetaData]':
/Users/username/homebrew/Cellar/gcc/10.2.0/include/c++/10.2.0/ext/new_allocator.h:150:4:   required from 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = std::pair<int, rocksdb::FileMetaData>; _Args = {int&, rocksdb::FileMetaData}; _Tp = std::pair<int, rocksdb::FileMetaData>]'
/Users/username/homebrew/Cellar/gcc/10.2.0/include/c++/10.2.0/bits/alloc_traits.h:512:17:   required from 'static void std::allocator_traits<std::allocator<_CharT> >::construct(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, _Up*, _Args&& ...) [with _Up = std::pair<int, rocksdb::FileMetaData>; _Args = {int&, rocksdb::FileMetaData}; _Tp = std::pair<int, rocksdb::FileMetaData>; std::allocator_traits<std::allocator<_CharT> >::allocator_type = std::allocator<std::pair<int, rocksdb::FileMetaData> >]'
/Users/username/homebrew/Cellar/gcc/10.2.0/include/c++/10.2.0/bits/vector.tcc:115:30:   required from 'void std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {int&, rocksdb::FileMetaData}; _Tp = std::pair<int, rocksdb::FileMetaData>; _Alloc = std::allocator<std::pair<int, rocksdb::FileMetaData> >]'
/Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/version_edit.h:219:48:   required from here
/Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/version_edit.h:76:8: error: implicitly-declared 'constexpr rocksdb::FileDescriptor::FileDescriptor(const rocksdb::FileDescriptor&)' is deprecated [-Werror=deprecated-copy]
   76 | struct FileMetaData {
      |        ^~~~~~~~~~~~
/Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/version_edit.h:47:19: note: because 'rocksdb::FileDescriptor' has user-provided 'rocksdb::FileDescriptor& rocksdb::FileDescriptor::operator=(const rocksdb::FileDescriptor&)'
   47 |   FileDescriptor& operator=(const FileDescriptor& fd) {
      |                   ^~~~~~~~
In file included from /Users/username/homebrew/Cellar/gcc/10.2.0/include/c++/10.2.0/bits/stl_algobase.h:64,
                 from /Users/username/homebrew/Cellar/gcc/10.2.0/include/c++/10.2.0/bits/char_traits.h:39,
                 from /Users/username/homebrew/Cellar/gcc/10.2.0/include/c++/10.2.0/string:40,
                 from /Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/builder.h:9,
                 from /Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/builder.cc:10:
/Users/username/homebrew/Cellar/gcc/10.2.0/include/c++/10.2.0/bits/stl_pair.h:353:64: note: synthesized method 'rocksdb::FileMetaData::FileMetaData(rocksdb::FileMetaData&&)' first required here
  353 |  : first(std::forward<_U1>(__x)), second(std::forward<_U2>(__y)) { }
      |                                                                ^
In file included from /Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/range_del_aggregator.h:15,
                 from /Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/memtable.h:19,
                 from /Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/memtable_list.h:16,
                 from /Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/column_family.h:17,
                 from /Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/version_set.h:31,
                 from /Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/compaction.h:11,
                 from /Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/compaction_iterator.h:12,
                 from /Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/builder.cc:16:
/Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/version_edit.h: In instantiation of 'constexpr std::pair<_T1, _T2>::pair(_U1&&, const _T2&) [with _U1 = int&; typename std::enable_if<std::_PCC<true, _T1, _T2>::_MoveCopyPair<true, _U1, _T2>(), bool>::type <anonymous> = true; _T1 = int; _T2 = rocksdb::FileMetaData]':
/Users/username/homebrew/Cellar/gcc/10.2.0/include/c++/10.2.0/ext/new_allocator.h:150:4:   required from 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = std::pair<int, rocksdb::FileMetaData>; _Args = {int&, const rocksdb::FileMetaData&}; _Tp = std::pair<int, rocksdb::FileMetaData>]'
/Users/username/homebrew/Cellar/gcc/10.2.0/include/c++/10.2.0/bits/alloc_traits.h:512:17:   required from 'static void std::allocator_traits<std::allocator<_CharT> >::construct(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, _Up*, _Args&& ...) [with _Up = std::pair<int, rocksdb::FileMetaData>; _Args = {int&, const rocksdb::FileMetaData&}; _Tp = std::pair<int, rocksdb::FileMetaData>; std::allocator_traits<std::allocator<_CharT> >::allocator_type = std::allocator<std::pair<int, rocksdb::FileMetaData> >]'
/Users/username/homebrew/Cellar/gcc/10.2.0/include/c++/10.2.0/bits/vector.tcc:115:30:   required from 'void std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {int&, const rocksdb::FileMetaData&}; _Tp = std::pair<int, rocksdb::FileMetaData>; _Alloc = std::allocator<std::pair<int, rocksdb::FileMetaData> >]'
/Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/version_edit.h:224:37:   required from here
/Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/version_edit.h:76:8: error: implicitly-declared 'constexpr rocksdb::FileDescriptor::FileDescriptor(const rocksdb::FileDescriptor&)' is deprecated [-Werror=deprecated-copy]
   76 | struct FileMetaData {
      |        ^~~~~~~~~~~~
/Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/version_edit.h:47:19: note: because 'rocksdb::FileDescriptor' has user-provided 'rocksdb::FileDescriptor& rocksdb::FileDescriptor::operator=(const rocksdb::FileDescriptor&)'
   47 |   FileDescriptor& operator=(const FileDescriptor& fd) {
      |                   ^~~~~~~~
In file included from /Users/username/homebrew/Cellar/gcc/10.2.0/include/c++/10.2.0/bits/stl_algobase.h:64,
                 from /Users/username/homebrew/Cellar/gcc/10.2.0/include/c++/10.2.0/bits/char_traits.h:39,
                 from /Users/username/homebrew/Cellar/gcc/10.2.0/include/c++/10.2.0/string:40,
                 from /Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/builder.h:9,
                 from /Users/username/Tendis/src/thirdparty/rocksdb-5.13.4/rocksdb/db/builder.cc:10:
/Users/username/homebrew/Cellar/gcc/10.2.0/include/c++/10.2.0/bits/stl_pair.h:323:51: note: synthesized method 'rocksdb::FileMetaData::FileMetaData(const rocksdb::FileMetaData&)' first required here
  323 |        : first(std::forward<_U1>(__x)), second(__y) { }
      |                                                   ^
cc1plus: all warnings being treated as errors
make[2]: *** [src/thirdparty/rocksdb-5.13.4/rocksdb/CMakeFiles/rocksdb.dir/db/builder.cc.o] Error 1
make[1]: *** [src/thirdparty/rocksdb-5.13.4/rocksdb/CMakeFiles/rocksdb.dir/all] Error 2
make: *** [all] Error 2

Expected Behavior

Build should pass and success

Current Behavior

Failed with given message

Possible Solution

Support gcc 10 or clarify supported gcc version in document?

Steps to Reproduce (for bugs)

$ git clone https://github.com/Tencent/Tendis.git 
$ git submodule update --init --recursive
$ mkdir bulid
$ cd build && cmake ..
$ make 

Context

Compile and run Tendis on mac

Your Environment

  • Operating System and version: Darwin username-M-P0PP 17.7.0 Darwin Kernel Version 17.7.0: Fri Oct 30 13:34:27 PDT 2020; root:xnu-4570.71.82.8~1/RELEASE_X86_64 x86_64
  • Machine Specifications: MacBook Pro (15-inch, 2016), 2.6 GHz Intel Core i7, 16 GB 2133 MHz LPDDR3
  • Tendis Version: dev-2.2 branch latest code
  • gcc version:
$ gcc --version
gcc-10 (Homebrew GCC 10.2.0) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

快速试用运行后, 不知道接下来如何执行命令.

Description

快速试用运行后, 不知道接下来如何执行命令.

Expected Behavior

我按照 文档进行操作, 屏幕上只是输出了一个配置列表

Current Behavior

[#36#wangx@aliyun:tendisplus-2.1.2-rocksdb-v5.13.4] $ ./bin/tendisplus scripts/tendisplus.conf
start server with cfg:
  bind:"127.0.0.1"
  binlog-send-batch:256
  binlog-send-bytes:16777216
  binlog-using-defaultCF:no
  binlogDelRange:1
  binlogFileSecs:1200
  binlogFileSizeMB:64
  binlogRateLimitMB:64
  checkkeytypeforsetcmd:no
  chunkSize:16384
  cluster-enabled:no
  cluster-migration-barrier:1
  cluster-migration-binlog-iters:10
  cluster-migration-distance:10000
  cluster-migration-rate-limit:32
  cluster-migration-slots-num-per-task:10
  cluster-node-timeout:15000
  cluster-require-full-coverage:yes
  cluster-single-node:no
  cluster-slave-no-failover:no
  cluster-slave-validity-factor:10
  databases:16
  delCntIndexMgr:10000
  delJobCntIndexMgr:1
  dir:"./home/db"
  domain-enabled:no
  dumpdir:"./home/dump"
  executorThreadNum:48
  executorWorkPoolSize:0
  fullPushThreadnum:4
  fullReceiveThreadnum:4
  garbage-delete-size:30
  garbageDeleteThreadnum:1
  generalLog:no
  incrPushThreadnum:4
  keysDefaultLimit:100
  kvStoreCount:10
  lockWaitTimeOut:3600
  logDir:"./home/log"
  logLevel:"notice"
  logRecycleThreadnum:4
  masterauth:""
  maxBinlogKeepNum:1
  maxClients:10000
  migrate-gc-enabled:yes
  migrate-snapshot-retry-num:1000
  migrateReceiveThreadnum:4
  migrateSenderThreadnum:4
  minBinlogKeepSec:3600
  netBatchSize:1048576
  netBatchTimeoutSec:10
  netIoThreadNum:0
  noexpire:no
  pauseTimeIndexMgr:10
  pidFile:"./home/tendisplus.pid"
  port:51002
  proto-max-bulk-len:536870912
  requirepass:""
  rocks.blockcache_strict_capacity_limit:no
  rocks.blockcachemb:4096
  rocks.compress_type:"snappy"
  rocks.disable_wal:no
  rocks.flush_log_at_trx_commit:no
  rocks.level0_compress_enabled:no
  rocks.level1_compress_enabled:no
  rocks.wal_dir:""
  scanCntIndexMgr:1000
  scanJobCntIndexMgr:1
  slave-migrate-enabled:no
  slaveBinlogKeepNum:1
  slowlog:"./home/log/slowlog"
  slowlog-file-enabled:yes
  slowlog-flush-interval:1000
  slowlog-log-slower-than:100000
  slowlog-max-len:128
  storage:"rocks"
  timeoutSecBinlogWaitRsp:30
  truncateBinlogIntervalMs:1000
  truncateBinlogNum:50000
  version-increase:yes
[#37#wangx@aliyun:tendisplus-2.1.2-rocksdb-v5.13.4] 

Possible Solution

应该是文档没有写清楚如何进入tendis shell模式吧

Steps to Reproduce (for bugs)

1. unzip file
$ tar zxvf tendisplusX.Y.Z-rocksdb-vxxx.tgz
2. change working directory to output
$ cd output
3. run tendis:
$ ./bin/tendisplus  scripts/tendisplus.conf

Context

新手上路, 第一步就执行不下去会让人很有挫败感的.

Your Environment

  • Operating System and version:
    ubuntu 20.04
  • Machine Specifications:
  • Tendis Version:
    5.13.4
  • Tendis Configuration:
    ./scriptes/tendisplus.conf/
  • IO/Network used:
  • Link to your project:

hgetall性能较慢有改进余地吗?

Tendis的hgetall操作对比同为rocksdb后端的pika大约慢一倍。

使用vire-benchmark测试(https://github.com/vipshop/vire)
Pika:3.4.0
Tendis:2.1.2

vire-benchmark -t hgetall,hset -n 1000000 -c 24 -h [HOST] -p [PORT]

服务端用fio存储。

pika:
====== HGETALL ======
1000000 requests completed in 27.87 seconds
24 parallel clients
16 bytes payload
keep alive: 1

Tendis:
====== HGETALL ======
1000000 requests completed in 50.20 seconds
24 parallel clients
16 bytes payload
keep alive: 1

同样环境下,hset比pika性能是更好的,get/set相差无几。hgetall则差别很大。

Tendis配置:
bind 0.0.0.0
binlog-send-batch 256
binlog-send-bytes 16777216
binlog-using-defaultCF no
binlogDelRange 1
binlogFileSecs 1200
binlogFileSizeMB 512
binlogRateLimitMB 512
checkkeytypeforsetcmd no
chunkSize 16384
cluster-enabled no
cluster-migration-barrier 1
cluster-migration-binlog-iters 10
cluster-migration-distance 10000
cluster-migration-rate-limit 32
cluster-migration-slots-num-per-task 10
cluster-node-timeout 15000
cluster-require-full-coverage yes
cluster-single-node no
cluster-slave-no-failover no
cluster-slave-validity-factor 10
databases 16
delCntIndexMgr 10000
delJobCntIndexMgr 1
dir "/path/to/tendis6379/db"
domain-enabled no
dumpdir "/path/to/tendis6379/dump"
executorThreadNum 24
executorWorkPoolSize 8
fullPushThreadnum 4
fullReceiveThreadnum 4
garbage-delete-size 30
garbageDeleteThreadnum 1
generalLog no
incrPushThreadnum 4
keysDefaultLimit 100
kvStoreCount 10
lockWaitTimeOut 3600
logDir "/path/to/tendis6379/log"
logLevel "notice"
logRecycleThreadnum 4
masterauth ""
maxBinlogKeepNum 200
maxClients 10000
migrate-gc-enabled yes
migrate-snapshot-retry-num 1000
migrateReceiveThreadnum 4
migrateSenderThreadnum 4
minBinlogKeepSec 3600
netBatchSize 1048576
netBatchTimeoutSec 10
netIoThreadNum 0
noexpire no
pauseTimeIndexMgr 10
pidFile "/path/to/tendis6379/tendisplus.pid"
port 6379
proto-max-bulk-len 536870912
requirepass ""
rocks.blockcache_strict_capacity_limit no
rocks.blockcachemb 78848
rocks.compress_type "snappy"
rocks.disable_wal no
rocks.flush_log_at_trx_commit no
rocks.level0_compress_enabled no
rocks.level1_compress_enabled no
rocks.wal_dir ""
scanCntIndexMgr 1000
scanJobCntIndexMgr 1
slave-migrate-enabled no
slaveBinlogKeepNum 1
slowlog "/path/to/tendis6379/slowlog"
slowlog-file-enabled no
slowlog-flush-interval 1000
slowlog-log-slower-than 100000
slowlog-max-len 128
storage "rocks"
timeoutSecBinlogWaitRsp 30
truncateBinlogIntervalMs 1000
truncateBinlogNum 50000
version-increase yes

=================

pika配置:
port : 9221
thread-num : 20
thread-pool-size : 24
sync-thread-num : 6
log-path : /path/to/pika9221/log
db-path : /path/to/pika9221/db
dump-path : /path/to/pika9221/dump
pidfile : /path/to/pika9221/pika.pid
db-sync-path : /path/to/pika9221/dbsync
write-buffer-size : 268435456
arena-block-size :
timeout : 60
requirepass :
masterauth :
userpass :
userblacklist :
instance-mode : classic
databases : 8
default-slot-num : 1024
replication-num : 0
consensus-level : 0
dump-prefix :
daemonize : yes
dump-expire : 0
maxclients : 20000
target-file-size-base : 20971520
expire-logs-days : 7
expire-logs-nums : 50
root-connection-num : 2
slowlog-write-errorlog : no
slowlog-log-slower-than : 10000
slowlog-max-len : 128
db-sync-speed : -1
slave-priority : 100
sync-window-size : 9000
max-conn-rbuf-size : 268435456
write-binlog : yes
binlog-file-size : 104857600
max-cache-statistic-keys : 0
small-compaction-threshold : 5000
max-write-buffer-size : 10737418240
max-write-buffer-number : 2
max-client-response-size : 1073741824
compression : snappy
max-background-flushes : 4
max-background-compactions : 4
max-cache-files : 5000
max-bytes-for-level-multiplier : 10

希望支持sock连接

在服务器TCP资源不够用的情况下,增加sock连接还是很有帮助的。

Cluster nodes.conf配置支持

集群的cluster nodes信息是记录在哪里的呢?实例目录下没有找到相关文件,以及是否支持配置指定

另外,redis cluster支持提前准备好各个实例的nodes.conf文件后,再启动实例,这样可以避免大集群的握手时间。tendis是否支持相同做法

Parallel Occ chk

it is suggested that tendisplus upgrades to rocks 6.x series. Or backport this patch.
As tendisplus uses rocksdb's occ. It may suffer great lock contentions on serializely commit chk.
By upgrading to parallel occ, pure in-mem workload should gain 4x better performance.

集群模式下info命令输出 redis_mode:standalone

tendis已经配置为集群模式,但是 info 命令输出的 redis_mode 为 standalone

# Server
redis_version:2.1.2-rocksdb-v5.13.4
redis_git_sha1:faadcd0d
redis_git_dirty:0
redis_build_id:15650123421272571168
redis_mode:standalone
os:Linux 3.10.0-229.el7.x86_64 x86_64
arch_bits:64
multiplexing_api:asio
gcc_version:7:3:1
process_id:10690
tcp_port:51003

tendisplus 的bind 与 redis的bind

redis的bind指定ip含义是只有当前ip及其网卡上的ip才能连上当前节点
tendisplus在创建集群的时候bind是用来创建集群指定ip使用的。
这个是否有必要更改成和redis的bind相一致

有windows版本的吗

请问一下有windows版本吗?最后是发布的版本。编译还需要编译环境

配置文件如何生效

使用docker-compose部署,编辑tendisplus.conf,重启服务docker-compose restart,观察tendisplus.conf,刚刚配置的信息已经被还原了

迁移redis到tendis报错

详细日志如下:

9744:C 28 Dec 15:24:19.179 * create worker to send revision to tendis
9744:C 28 Dec 15:24:19.180 * Sync Conn(127.0.0.1:51002_0) connect to tendis(127.0.0.1:51002) success.
9744:C 28 Dec 15:24:19.180 * using conn:127.0.0.1:51002_0 to update slots map
9744:C 28 Dec 15:24:19.180 * ClusterConnPool Init finish
9744:C 28 Dec 15:24:19.181 * Redis-sync connect to redis(10.0.147.12:6009) success.
9744:M 28 Dec 15:24:19.181 # oO0OoO0OoO0Oo Sync is starting oO0OoO0OoO0Oo
9744:M 28 Dec 15:24:19.181 # Sync version=2.1.3, bits=64, pid=9744, just started
9744:M 28 Dec 15:24:19.181 # Server initialized
9744:M 28 Dec 15:24:19.181 * Ready to accept connections
9744:M 28 Dec 15:24:19.181 * Auth redis success, sending REPLCONF listening-port to master(xx,x,x,x:6009)
9744:M 28 Dec 15:24:19.181 * REPLCONF listening-port OK
9744:M 28 Dec 15:24:19.182 * REPLCONF capa OK
9744:M 28 Dec 15:24:19.182 * Master not support tendis_extend_protocol, -ERR Unrecognized REPLCONF option: capa-tendis
9744:M 28 Dec 15:24:19.182 * Master not support repl group id, -ERR Unrecognized REPLCONF option: capa-cluster
9744:M 28 Dec 15:24:19.183 * Sync get revision -1 from tendis
9744:M 28 Dec 15:24:19.184 * Sync get revision from redis 0, cmd: -ERR Unrecognized REPLCONF option: getrevision
9744:M 28 Dec 15:24:19.184 # Tendis's max revision is 0, redis revision is 0
9744:M 28 Dec 15:24:19.184 * Send psync ? 0
9744:M 28 Dec 15:24:19.818 * Full resync from redis, runid(fc613f9a7220b8a2b3d10891c24178b9ff84f238), offset(2116872478).
9744:M 28 Dec 15:32:00.492 * Broadcast config set session tendis_protocol_extend off to all queue.
9744:M 28 Dec 15:32:00.507 * [ERR] Parse RDB version error at 1252 in /home/peco/redis-for-cloud/src/sync/link.cc
9744:M 28 Dec 15:32:00.507 # parse rdb failed
9744:M 28 Dec 15:32:00.507 # Something error , redis-sync will disconnect redis
9744:M 28 Dec 15:32:00.507 # Forward point (Redis, Twemproxy, etc) offline, retry connect...
9744:M 28 Dec 15:32:01.508 # Check group name error: ERR Unrecognized REPLCONF option: replgroupid

主要的错误为:

[ERR] Parse RDB version error at 1252 in /home/peco/redis-for-cloud/src/sync/link.cc

tendis版本为:2.1.2-rocksdb-v5.13.4
reids版本为: 5.0.5

tendis-2.1.2 monitor command error

1608866429.120551 [0 10.22.111.244:50694] "set" "tb:rmdsrv:state:taskstate:tb:5d6735dbc926c19374a7f3a17e2" "
5d67357233900015f5faa(����08@��J{}"
1608866429.120624 [0 10.22.111.244:50694] "set" "tb:rmdsrv:state:taskstate:tb:5e019afb97b77000171f869a2173eec0" "
5e019afb97b7700017629429
a000126d5ec(�Є�J{}"
1608866429.120631 [0 10.22.111.244:51236] "pexpire" "tb:rmdsrv:state:taskstate:tb:58df188089bc463e526233b1:06efa65cef18e58680a27cd4d47d8897" "1078709002"
1608866429.120689 [0 10.22.111.244:50694] "set" "tb:rmdsrv:state:taskstate:tb:5ecb94bbb382d20015998eba:ef7c8573bf26c25cb53a0c5832b8729e" "
5ecb94bbb382d20015998eba 5961638yu1434927961617713323"5f042114592f5d0001a441ee(����J{}"
1608866429.120801 [0 10.22.111.244:51236] "pexpire" "tb:rmdsrv:state:taskstate:tb:59f83ea989bc4616c3541ba4:92561bd829f0ecb1cdcb4745d4a750a6" "878909792"
1608866429.120923 [0 10.22.111.244:51236] "pexpire" "tb:rmdsrv:state:taskstate:tb:5e705a945a7505001fa3aafb:39f0dd2679347741eb265f6cbaeeefb9" "2016226129"
16088.121013 [0 10.22.111.244:51236] "set" "tb:rmdsrv:state:orderstate:tb:1370070401965" "
signed succeeded)R���C@0����8B#
created5f9b69194cd6da000160029bB"
signed5f9b69194cd6da00016002a7B%
succeeded5f9b69194cd6da00016002a9JZ
Error: Protocol error, got "\a" as reply type byte

Is it Jepsen tested?

Description

Jepsen.io is the leading industry authority on testing distributed systems/databases.

Expected Behavior

A note in the readme about its current Jepsen test status.

Current Behavior

No mention in readme or in issues.

Possible Solution

Just write something about it in the readme, since it is an indicator people care about. If not tested, describe why, and how you will go avout getting it Jepsen tested.

Context

Evaluate the safety of using it.

编译cmake..报错:已经成功安装过gflags

CMake Error at /usr/local/lib/cmake/gflags/gflags-nonamespace-targets.cmake:34 (message):
Some (but not all) targets in this export set were already defined.

Targets Defined: gflags_nothreads_static

Targets not yet defined:
gflags_shared;gflags_nothreads_shared;gflags_static

Call Stack (most recent call first):
/usr/local/lib/cmake/gflags/gflags-config.cmake:17 (include)
src/thirdparty/snappy/CMakeLists.txt:133 (find_package)

Build on Mac

cmake failed on macOS 11 when it tried to check gcc configuration. I have installed gcc-10 and cmake with homebrew. But it seems that it cannot work well when it tried to read the variable CMAKE_COMPILER_IS_GNUCC, could you please share some ideas about this error? Thanks.

$ cmake ..
-- The C compiler identification is AppleClang 12.0.0.12000032
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
#define TENDISPLUS_GIT_SHA1 "b4e8bbe8"
#define TENDISPLUS_GIT_DIRTY "      36"
/Library/Developer/CommandLineTools/usr/bin/c++
CMake Error at CMakeLists.txt:34 (message):
  gcc or vs2015(update 2)+ is required

无法写入数据

image
是在迁移slot后出现的,calc_test_living_detail_num2020-12-2023所在的slot已经迁移成功了

编译链接失败

tendisplus_static link错误报链接库找不到
[ 95%] Linking CXX executable ../../../bin/tendisplus_static
/usr/bin/ld: cannot find -ldl
/usr/bin/ld: cannot find -lpthread
/usr/bin/ld: cannot find -lrt
/usr/bin/ld: cannot find -ldl
/usr/bin/ld: cannot find -lpthread
/usr/bin/ld: cannot find -lrt
/usr/bin/ld: cannot find -lpthread
/usr/bin/ld: cannot find -lm
/usr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
make[2]: *** [bin/tendisplus_static] Error 1
make[1]: *** [src/tendisplus/server/CMakeFiles/tendisplus_static.dir/all] Error 2
make: *** [all] Error 2

已经生成的bin是能找到对应的链接库了
[root@centosVM02 build]# ldd bin/write_stress
linux-vdso.so.1 => (0x00007ffc57b9a000)
librocksdb.so.5 => /root/Tendis/build/lib/librocksdb.so.5 (0x00007faa7d7c9000)
libpthread.so.0 => /usr/lib64/libpthread.so.0 (0x00007faa7d5ad000)
librt.so.1 => /usr/lib64/librt.so.1 (0x00007faa7d3a5000)
libjemalloc.so.2 => /root/Tendis/src/thirdparty/jemalloc/lib/libjemalloc.so.2 (0x00007faa7cefc000)
libstdc++.so.6 => /usr/local/gcc-5.5.0/lib64/libstdc++.so.6 (0x00007faa7cb80000)
libm.so.6 => /usr/lib64/libm.so.6 (0x00007faa7c87e000)
libgcc_s.so.1 => /usr/local/gcc-5.5.0/lib64/libgcc_s.so.1 (0x00007faa7c667000)
libc.so.6 => /usr/lib64/libc.so.6 (0x00007faa7c29a000)
/lib64/ld-linux-x86-64.so.2 (0x00007faa7dff6000)
libdl.so.2 => /usr/lib64/libdl.so.2 (0x00007faa7c096000)

节点重启速度是否会慢

在数据量比较大的情况下重启会不会很慢?
假如会比较慢,会有日志打印出来,告诉节点在干什么吗?
PS:这点很重要,否则启动的人,不知道他到底是出问题了,还是正在进行某些工作。

tendis怎么使用redis的scan功能,监控数据?

File "utils/monitor_redis_data_test.py", line 104, in handle
cursor, keys = redis_client.scan(cursor, match="*", count=query_count_tendis)
File "/usr/local/python3/lib/python3.5/site-packages/redis/client.py", line 1754, in scan
return self.execute_command('SCAN', *pieces)
File "/usr/local/python3/lib/python3.5/site-packages/redis/client.py", line 775, in execute_command
return self.parse_response(connection, command_name, **options)
File "/usr/local/python3/lib/python3.5/site-packages/redis/client.py", line 795, in parse_response
return self.response_callbacks[command_name](response, **options)
File "/usr/local/python3/lib/python3.5/site-packages/redis/client.py", line 339, in parse_scan
cursor, r = response
ValueError: not enough values to unpack (expected 2, got 0)

内存释放问题

部署了一个单实例,使用benchmark工具跑了些性能测试后,进程闲置两天了,内存占用还是维持在3.5G

如图:
image

是否能更快的自动释放内存?

Update RocksDB to latest (6.14.6)

As $SUBJECT says, the current shipped version of RocksDB is quite old.

Do you rely on any incompatible APIs on that version or can we just replace with latest release?

v6.14.6 is the latest tag.

无法启动

tendis停止后,无法再启动了

日志提示如下
F0107 14:52:35.971920 16138 rocks_kvstore.cpp:1828] opendb:./home/db/catalog, failed info:-ERR:3,msg:Corruption: Can't access /000180.sst: IO error: while stat a file for size: ./home/db/catalog/000180.sst: No such file or directory

A proposal for Improving Key Format

Current Key Format is SlotID | Type | DBID | PK | 0 | Version | SK | PK_LEN | Reserved, the PK_LEN in suffix will harm some compression algo such as terarkdb's NestLoudsTrie.

A better solution is to escape one '\0' byte in PK into '\0\0' ( 2 '\0' bytes), and let Version Never be 0, thus PK can be identified unambiguously and PK_LEN is not needed. An additional advantage is the key size will be reduced in most cases because '\0\0' in PK is very unlikey in Redis-like DB(which Tendis aimed on).

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.