一、前置环境准备
1. 准备Linux环境,我起的虚机,使用CentOS8,4核、12G,磁盘50G
1.1.备份yum源
# 系统下载连接:magnet:?xt=urn:btih:9DB46A612D04763AA7DB02A0FF63EDE2EA555867&dn=CentOS-8.1.1911-x86_64-dvd1.iso
sudo mkdir /etc/yum.repo.d/backup
sudo mv /etc/yum.repo.d/*.repo /etc/yum.repo.d/backup
sudo vim /etc/yum.repo.d/CentOS-Base.repo
1.2.配置yum源
# CentOS-Base.repo
[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
#failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/http://mirrors.aliyuncs.com/centos/$releasever/BaseOS/$basearch/os/http://mirrors.cloud.aliyuncs.com/centos/$releasever/BaseOS/$basearch/os/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
#failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/os/http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/os/http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/os/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
#failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/os/http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/os/http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official[PowerTools]
name=CentOS-$releasever - PowerTools - mirrors.aliyun.com
#failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/PowerTools/$basearch/os/http://mirrors.aliyuncs.com/centos/$releasever/PowerTools/$basearch/os/http://mirrors.cloud.aliyuncs.com/centos/$releasever/PowerTools/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official[AppStream]
name=CentOS-$releasever - AppStream - mirrors.aliyun.com
#failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/AppStream/$basearch/os/http://mirrors.aliyuncs.com/centos/$releasever/AppStream/$basearch/os/http://mirrors.cloud.aliyuncs.com/centos/$releasever/AppStream/$basearch/os/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
1.3.更新yum源
yum clean all && yum makecache
1.4.安装&更新软件
yum install -y automake bison flex boost-devel libevent-devel openssl-devel python3-devel autoconf libtool cmake ncurses-devel lzo-devel zlib-devel gcc-c++ maven git make systemd-devel orc-devel clang python2 npm
# 有些包默认的版本低,需要手动更新,比如libarchive
yum update -y
# 更新完成后,要删除更细,新生成的repo,把CentOS-Base.repo恢复回来,再clean和makecache
rm -f /etc/yum.repos.d/CentOS-Linux*
mv /etc/yum.repos.d/CentOS-Base.repo(***自己替换) /etc/yum.repos.d/CentOS-Base.repo
yum clean all && yum makecache
# python手动创建软连接
ln -s /usr/bin/python2 /usr/bin/python
1.5.编译fe ui需要升级node.js从10.24.1到18.20.7(12+)
# 下载包
https://nodejs.org/dist/v18.20.7/node-v18.20.7-linux-x64.tar.xz
# 解压和替换
rm -rf ~/.npm/
tar -xJf node-v18.20.7-linux-x64.tar.xz
# 重新安装
cd /home/user/v18.20.7-linux-x64/lib/node_modules/npm
ln -s /home/user/v18.20.7-linux-x64/bin/npm /usr/bin/npm
ln -s /home/user/v18.20.7-linux-x64/bin/node /usr/bin/node
npm install -g nrm
ln -s /home/usr/v18.20.7-linux-x64/bin/nrm /usr/bin/nrm
1.6.修改maven源
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd"><mirrors><!-- 镜像:阿里云仓库代理 --><mirror><id>aliyun-central</id><url>https://maven.aliyun.com/repository/public</url><mirrorOf>*,!cloudera-releases,!snapshots,!cloudera,!huawei-obs-sdk</mirrorOf></mirror></mirrors>
</settings>
验证maven源
mvn help:effective-settings
# 过程中 mvn 报错oom,添加以下参数# -Xmx8192m:最大堆内存提升至8GB(根据物理内存调整)# -XX:+UseG1GC:使用G1垃圾回收器优化内存回收效率
echo 'MAVEN_OPTS="-Xms4096m -Xmx8192m -XX:MaxMetaspaceSize=1024m" -XX:+UseG1GC -XX:+HeapDumpOnOutOfMemoryError"' >> /usr/bin/mvn
2. 部署
2.1下载源码和三方依赖
wget https://github.com/apache/doris-thirdparty/releases/download/automation-2.0/doris-thirdparty-prebuilt-linux-x86_64.tar.xz
wget https://dist.apache.org/repos/dist/release/doris/2.1/2.1.8.1/apache-doris-2.1.8.1-src.tar.gz
2.2解压源码和三方依赖
tar -xJvf doris-thirdparty-prebuilt-linux-x86_64.tar.xz
tar -zxvf apache-doris-2.1.8.1-src.tar.gz
mv apache-doris-2.1.8.1-src doris-2.1.8
mv installed doris-2.1.8/
3. 编译
3.1先编译FE试试
# 进目录
cd doris-2.1.8/
# 先编译FE,记得先看看公网网络通不通,这一步需要连接公网
sh build.sh --fe
4. 有图有真相