拉取代码
git clone ssh://zmh1230@gerrit.cloudera.org:29418/Impala-ASF新建 docker
docker run -d -it --privileged --name zmh_asf -v xxx/Impala-ASF:xxx/impala ubuntu:20.04 bash创建 impala 用户
# 获取宿主机用户 uid 和 gid | |
id | |
# 以 root 用户进入容器: | |
docker exec -it -u root zmh_asf bash | |
# 修改 /tmp 文件权限 | |
chmod -R 1777 /tmp | |
# 创建 impala 用户 | |
adduser --disabled-password --gecos '' impala | |
# 修改 impala 用户 id 跟宿主机登录用户的 uid 一致 | |
usermod -u ${host_uid} impala | |
# 修改 impala 组的 id 跟宿主机登录用户的 gid 一致 | |
groupmod -g ${host_gid} impala | |
# 修改文件权限 | |
chown -R impala:impala xxx/impala /var/lib/hadoop-hdfs | |
# 加入 sudo | |
apt-get update | |
apt-get install sudo | |
echo 'impala ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers | |
su - impala |
- git、vim 等安装
sudo apt-get --yes install git | |
sudo apt-get --yes install vim | |
# General build requirements | |
sudo apt-get install build-essential git | |
sudo apt-get install texinfo | |
# Requirements for specific packages | |
sudo apt-get install bison # For binutils | |
sudo apt-get install autoconf automake libtool # For libevent | |
sudo apt-get install libz-dev # For OpenSSL | |
sudo apt-get install libssl-dev # For Thrift | |
sudo apt-get install libncurses-dev # For GDB | |
sudo apt-get install libsasl2-dev libkrb5-dev # For Kudu |
- 初始化环境
cd /opt/impala/impala | |
export IMPALA_HOME=`pwd` | |
# m2 的包下载比较慢 | |
$IMPALA_HOME/bin/bootstrap_system.sh |
- 构建 toolchain
# docker | |
cd .. && mkdir toolchain %&& cd impala && ln -s /opt/impala/toolchain . | |
# 宿主机 | |
cd /data/qdev/zmh | |
docker cp cdp_components-31397203 zmh_asf:/opt/impala/toolchain | |
docker cp toolchain-packages-gcc7.5.0 zmh_asf:/opt/impala/toolchain | |
# 修改环境变量 | |
export DOWNLOAD_CDH_COMPONENTS=false | |
export SKIP_PYTHON_DOWNLOAD=true | |
export SKIP_TOOLCHAIN_BOOTSTRAP=true | |
export IMPALA_GCC_VERSION=7.5.0 | |
export IMPALA_FLATBUFFERS_VERSION=1.6.0 | |
export IMPALA_CRCUTIL_VERSION=440ba7babeff77ffad992df3a10c767f184e946e-p2 | |
export IMPALA_BREAKPAD_VERSION=97a98836768f8f0154f8f86e5e14c2bb7e74132e-p2 | |
export IMPALA_LIBUNWIND_VERSION=1.3-rc1-p3 |
有些包找不到是因为版本号不对,注意即时跟换 toolchain 中的版本!!!
- 编译
./buildall.sh -noclean -skiptests -format |
参考文档:
https://cwiki.apache.org/confluence/display/IMPALA/Impala+Development+Environment+inside+Docker
https://cwiki.apache.org/confluence/display/IMPALA/Building+native-toolchain+from+scratch+and+using+with+Impala