Compiling RocksDB
- Install the dependencies.
yum install -y cmake gcc gcc-c++ gflags-devel libstdc++-devel
- Obtain the RocksDB source package.
yum install git -y git config --global http.sslVerify false git clone https://gitee.com/kunpeng_compute/rocksdb.git cd rocksdb git checkout rocksdb-7.9.2-lava
- Optional: Perform a unit test.
sh build.sh UTONLY
If the test is executed successfully, the following information is displayed:

- Compile RocksDB in Release mode.
sh build.sh
You can specify a compilation mode (Debug, RelWithDebInfo, or Release) after build.sh. If no mode is specified, the Release mode is used by default.
By default, the build.sh script enables all Kunpeng acceleration features. If KSAL is not required, add the DISABLE_KSAL option to disable it. Example: sh build.sh Release DISABLE_KSAL
If the output of the following command contains information marked in the red box in the figure, KSAL has been enabled.
ldd build/librocksdb.so.7.9.2

- Optional: Perform a performance test.
cd script sh test_perf_all.sh
It takes about 10 hours to execute all test cases. You can change the key-value size in line 8 and the number of databases in line 13 to reduce or modify the test cases.
The default read/write path is /mnt/rocksdb_data/test. You can change the path by specifying basedir in the second line of the test_perf_all.sh script. Before running the script, ensure that the path is available.
To mount a device to a specified path, run the following command (replace nvme0n1 as required):
mkfs.ext4 /dev/nvme0n1 mount /dev/nvme0n1 /mnt/rocksdb_data/test
- Install RocksDB.
cd ../build make install
- Obtain optimization parameter configurations.
cd ../config_file cat optimize_file