Hypertable 是高性能分布式数据库(类 Bigtable),Ubuntu 下需从源码编译。本文记录 Git 获取源码、安装编译依赖、CMake 配置、编译安装与回归测试全流程。
# 源码目录
mkdir -p ~/src/hypertable
# 构建目录
mkdir -p ~/build/hypertable
# 安装前缀
mkdir -p ~/hypertable
sudo apt-get install git-core
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
git clone git://scm.hypertable.org/pub/repos/hypertable.git ~/src/hypertable
# 更新:cd ~/src/hypertable && git pull
sudo apt-get install build-essential cmake zlib1g-dev \
libboost-all-dev libboost1.54-dev liblog4cpp5-dev \
libexpat1-dev libattr1-dev libreadline-dev \
libncurses5-dev libgoogle-perftools-dev
关键包说明:
build-essential:GCC/工具链
cmake:构建系统
libboost-all-dev:Boost C++ 库(≥1.34.1)
liblog4cpp5-dev:日志库
libexpat1-dev:XML 解析
libattr1-dev:扩展属性
libreadline-dev / libncurses5-dev:交互 Shell
libgoogle-perftools-dev:tcmalloc 内存分配器
cd ~/build/hypertable
cmake -DCMAKE_INSTALL_PREFIX=~/hypertable \
-DCMAKE_BUILD_TYPE=Debug \
-DBoost_INCLUDE_DIR=/usr/include/boost \
~/src/hypertable
输出应显示找到 Boost、tcmalloc、doxygen、graphviz 等依赖路径,最终提示 Build files have been written to: ~/build/hypertable。
cd ~/build/hypertable
make -j$(nproc)
# 可选:运行回归测试
# make test
make install
export PATH=~/hypertable/bin:$PATH
export LD_LIBRARY_PATH=~/hypertable/lib:$LD_LIBRARY_PATH
hypertable --version
# 启动单机测试实例参考官方文档

完成编译安装后,Hypertable 可作为高性能键值存储服务运行。生产环境建议使用 Release 构建(-DCMAKE_BUILD_TYPE=Release)并配置分布式集群模式。