Skip to content

Instantly share code, notes, and snippets.

@srimaln91
Created March 3, 2021 12:00
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save srimaln91/bea462f8e3cefc793125757a3080391f to your computer and use it in GitHub Desktop.
Save srimaln91/bea462f8e3cefc793125757a3080391f to your computer and use it in GitHub Desktop.
Install RocksDB in CentOS7
#!/bin/bash
set -ex
ROCKSDB_VERSION="5.18.4"
ZSTD_VERSION="1.1.3"
yum update -y && yum install epel-release -y
yum install -y \
wget \
gcc-c++ \
snappy snappy-devel \
zlib zlib-devel \
bzip2 bzip2-devel \
lz4-devel \
libasan \
gflags
wget -qO /tmp/zstd-${ZSTD_VERSION}.tar.gz https://github.com/facebook/zstd/archive/v${ZSTD_VERSION}.tar.gz
wget -qO /tmp/rocksdb-${ROCKSDB_VERSION}.tar.gz https://github.com/facebook/rocksdb/archive/v${ROCKSDB_VERSION}.tar.gz
cd /tmp
tar xzvf zstd-${ZSTD_VERSION}.tar.gz
tar xzvf rocksdb-${ROCKSDB_VERSION}.tar.gz
echo "Installing ZSTD..."
pushd zstd-${ZSTD_VERSION}
make && make install
popd
echo "Compiling RocksDB..."
pushd rocksdb-${ROCKSDB_VERSION}
make shared_lib
make install-shared INSTALL_PATH=/usr
# cleanup
rm -rf /tmp/zstd-${ZSTD_VERSION}.tar.gz /tmp/zstd-${ZSTD_VERSION}
rm -rf /tmp/rocksdb-${ROCKSDB_VERSION}.tar.gz /tmp/rocksdb-${ROCKSDB_VERSION}
echo "Installation Completed!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment