Tencent / Tendis

Tendis is a high-performance distributed storage system fully compatible with the Redis protocol.
http://tendis.cn
Other
2.87k stars 317 forks source link

如何嵌入自己的rocksdb? #195

Closed HBSDLJZ closed 1 year ago

HBSDLJZ commented 1 year ago

您好,我对rocksdb修改了c++源代码,进行了优化,如何嵌入替换掉tendis原有的rocksdb,可否有详细的教程,谢谢您,麻烦帮忙解决一下!

takenliu commented 1 year ago

参考CMakeLists.txt里面的写法,比如NEW_ROCKSDB选项下面的set(ROCKSDB_DIR "yourself_dir/rocksdb")

raffertyyu commented 1 year ago

可以尝试先试着看下CMakeLists.txt文件内容。还需要把rocksdb的patch注释掉。

HBSDLJZ commented 1 year ago

谢谢二位大佬 image make -j12 bi编译的时候报这个snappy问题,如何解决?麻烦解决一下~~

HBSDLJZ commented 1 year ago

如何能让tendis编译的时候识别到我的snappy,本机已经安装了snappy了

raffertyyu commented 1 year ago

看着像是snappy版本不同,能否先卸载原系统上的snappy,编译成功之后再安装回来呢。

HBSDLJZ commented 1 year ago

谢谢 done

HBSDLJZ commented 1 year ago
image

本地编译不通过,但是本地已经安装了lstdc++,如何解决?求大佬们帮忙解答~

raffertyyu commented 1 year ago

tendisplus 用的是全静态链接,所以需要stdc++ 的静态库

centos系用yum install libstdc++-static ubuntu系用apt install libstdc++-10-dev 或者libstdc++-11-dev或者libstdc++-12-dev

HBSDLJZ commented 1 year ago
image

安装静态库 报这个,问您下怎么解决?

raffertyyu commented 1 year ago

这个原因就可能比较多了。大概率是有版本后缀。 你可以先执行

yum search stdc++

找一下其他可能的包,包含libstdc++和static之类的名字。也许可能会有不一样的包名。

如果不行的话,建议先试一下切换到国内镜像源,比如tuna 然后执行

yum clean all
yum makecahe
yum install libstdc++-static
HBSDLJZ commented 1 year ago

太感谢您了,成功编译bin文件了!

HBSDLJZ commented 1 year ago

麻烦再请教一下,生成的tendisplus执行文件,启动时,只是输出了如下日志,一刷而过,tendis并没有启动,问一下这是什么原因导致的?

[root@localhost tmp.Y1QIlpiVuL]# ./tendisplus tendisplus.conf start server with cfg: allow-cross-slot:no aof-enabled:no aof-psync-num:500 bind:"127.0.0.1" binlog-enabled:yes binlog-save-logs:yes binlog-send-batch:256 binlog-send-bytes:16777216 binlog-using-defaultCF:no binlogDelRange:100000 binlogFileSecs:1200 binlogFileSizeMB:64 binlogRateLimitMB:64 checkkeytypeforsetcmd:no chunkSize:16384 cluster-allow-replica-migration:no cluster-enabled:no cluster-migration-barrier:1 cluster-migration-batch-size:16 cluster-migration-binlog-iters:10 cluster-migration-distance:10000 cluster-migration-rate-limit:32 cluster-migration-slots-num-per-task:10 cluster-migration-timeout:5 cluster-node-timeout:15000 cluster-require-full-coverage:yes cluster-single-node:no cluster-slave-no-failover:no cluster-slave-validity-factor:10 compactrange-after-deleterange:no daemon:yes databases:16 delCntIndexMgr:10000 deletefilesinrange-for-binlog:yes deletefilesinrange-for-migrate-gc:no delJobCntIndexMgr:1 dir:"./home/db" direct-io:no domain-enabled:no dumpdir:"./home/dump" executorThreadNum:48 executorWorkPoolSize:0 force-recovery:0 fullPsync-notice-enabled:no fullPushThreadnum:5 fullReceiveThreadnum:5 garbage-delete-size:30 garbageDeleteThreadnum:1 generalLog:no generate-heartbeat-binlog-interval:0 incrPushThreadnum:10 jeprof-auto-dump:yes keysDefaultLimit:100 kvStoreCount:10 lockDbXWaitTimeout:1 lockWaitTimeOut:3600 log-error:no logDir:"./home/log" logLevel:"notice" logRecycleThreadnum:5 lua-time-limit:5000 luaStateMaxIdleTime:3600000 masterauth:** maxBinlogKeepNum:1 maxClients:10000 migrate-gc-enabled:no migrate-snapshot-key-num:100000 migrate-snapshot-retry-num:1000 migrateReceiveThreadnum:5 migrateSenderThreadnum:5 minBinlogKeepSec:3600 net-send-batch-size:1400 netBatchSize:1048576 netBatchTimeoutSec:10 netIoThreadNum:0 noexpire:no pauseTimeIndexMgr:1 pidFile:"./home/tendisplus.pid" port:51002 proto-max-bulk-len:536870912 replicate-fix-enabled:yes requirepass:** rocks-transaction-mode:2 rocks.blockcache_num_shard_bits:6 rocks.blockcache_strict_capacity_limit:no rocks.blockcachemb:4096 rocks.compaction_deletes_ratio:0.000000 rocks.compaction_deletes_trigger:0 rocks.compaction_deletes_window:0 rocks.compress_type:"snappy" rocks.delete_bytes_per_second:0 rocks.disable_wal:no rocks.flush_log_at_trx_commit:no rocks.level0_compress_enabled:no rocks.level1_compress_enabled:no rocks.max_background_jobs:2 rocks.max_open_files:-1 rocks.rate_limiter_auto_tuned:yes rocks.rate_limiter_fairness:10 rocks.rate_limiter_rate_bytes_per_sec:0 rocks.rate_limiter_refill_period_us:100000 rocks.skip_concurrency_control:no rocks.wal_dir:"" save-min-binlogid:yes scanCntIndexMgr:1000 scanDefaultLimit:10 scanDefaultMaxIterateTimes:10000 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" supply-fullpsync-key-batch-num:100 tbitmap-fragment-size:1024 timeoutSecBinlogWaitRsp:3 truncateBinlogIntervalMs:1000 truncateBinlogNum:100000 version-increase:yes wait-time-if-exists-migrate-task:600

HBSDLJZ commented 1 year ago

可否帮忙解决下~~~