1.使用现成的镜像
docker pull apachedoris/doris-dev:build-env-1.3
1.1拉取镜像
docker pull apachedoris/doris-dev:build-env-1.3
1.2运行镜像
docker run -it --name doris apachedoris/doris-dev:build-env-1.3
1.3查看镜像是否运行成功
docker ps -a
如图,运行成功。进入容器
1.4mkdir创建doris
mkdir doris
1.5进入doris
wget <https://mirrors.bfsu.edu.cn/apache/incubator/doris/0.13.0-incubating/apache-doris-0.13.0-incubating-src.tar.gz>
1.6解压
tar -zxvf apache-doris-0.13.0-incubating-src.tar.gz
1.7编译
编译之前需要修改maven配置
.进入maven
cd usr/share/maven/conf
.修改setting.xml 换仓库地址
<mirror> <id>alimaven</id> <name>aliyun maven</name> <url><https://maven.aliyun.com/repository/public></url> <mirrorOf>central</mirrorOf> </mirror> <mirror> <id>alimaven-central</id> <name>aliyun maven central</name> <url><https://maven.aliyun.com/repository/central></url> <mirrorOf>central</mirrorOf> </mirror> <mirror> <id>alimaven-spring</id> <name>aliyun maven-spring</name> <url><https://maven.aliyun.com/repository/spring></url> <mirrorOf>central</mirrorOf> </mirror> <mirror> <id>central</id> <name>Maven Repository Switchboard</name> <url><https://repo1.maven.org/maven2/></url> <mirrorOf>central</mirrorOf> </mirror> <mirror> <id>jboss-public-repository-group</id> <mirrorOf>central</mirrorOf> <name>JBoss Public Repository Group</name> <url><http://repository.jboss.org/nexus/content/groups/public></url> </mirror> <mirror> <id>spring-snapshots</id> <mirrorOf>central</mirrorOf> <name>Spring Snapshots</name> <url><https://repo.spring.io/snapshot></url> </mirror> <mirror> <id>spring-milestones</id> <mirrorOf>central</mirrorOf> <name>Spring Milestones</name> <url><https://repo.spring.io/milestone></url> </mirror>
修改fe中的配置文件
.进入之前创建doris/apache-doris-0.13.0-incubating-src/fe 路径
cd /root/doris/apache-doris-0.13.0-incubating-src/fe
.修改pom.xml文件
<!-- for java-cup --> <repository> <id>cloudera-thirdparty</id> <url><https://repository.cloudera.com/content/repositories/third-party/></url> // 将上面两行配置**改为**下面两行** <id>cloudera-public</id> <url><https://repository.cloudera.com/artifactory/public/> </url> </repository> <pluginRepositories> <!-- for cup-maven-plugin --> <pluginRepository> <id>spring-plugins</id> <url><https://repo.spring.io/plugins-release/></url> // 将上面两行配置**改为**下面两行** <id>cloudera-public</id> <url><https://repository.cloudera.com/artifactory/public/></url> </pluginRepository> </pluginRepositories>
1.8直接编译
sh bulid.sh
编译成功会产出output文件
1.9部署和启动FE
将编译好的文件output里面fe cp复制到宿主机opt/doris/fe
.创建文件夹doris-meta存放元数据
mkdir /opt/doris/fe/doris-meta //路径必须提前创建好
.修改fe.conf文件
vi ./conf/fe.conf
.添加下面的配置
//如果因为内存原因无启动,修改启动内存大小 4g初始 meta_dir = /opt/doris/fe/doris-meta priority_networks = 192.168.220.133/22 ip地址
启动fe
cd /opt/doris/fe/bin sh start_sh --daemon 后台启动 #发生错误请通过查看fe/log/fe.log 或者 fe/log/fe.out 查看错误信息
关闭防火墙或者开放相应端口
打开浏览器访问,进入可视化的界面
<http://192.168.220.145:8030/>
1.10 部署和启动BE
将编译好的文件output里面be cp复制到宿主机opt/doris/be
创建be存储数据的文件夹
mkdir -p /opt/doris/be/storage ####路径必须提前创建好
.启动be
cd /opt/doris/be/bin sh start_be.sh --daemon
.BE 启动失败的情况处理
.修改最大文件句柄数
echo "* soft nofile 204800" >> /etc/security/limits.conf echo "* hard nofile 204800" >> /etc/security/limits.conf echo "* soft nproc 204800" >> /etc/security/limits.conf echo "* hard nproc 204800 " >> /etc/security/limits.conf 修改 /etc/sysctl.conf 加入 echo fs.file-max = 6553560 >> /etc/sysctl.conf
.查看是否成功
cat /etc/security/limits.conf cat /etc/sysctl.conf
.重启生效
reboot -h now
.重新启动be即可
cd /opt/doris/be/bin sh start_be.sh --daemon
1.11 通过mysql client连接
.
.安装mysql
yum install -y mysql
.通过mysql客户端连接doris
ip地址 mysql -h 192.168.220.145 -p 9030 -uroot
.添加be
ALTER SYSTEM ADD BACKEND "192.168.220.146:9050"
.关闭防火墙
systemctl disable firewalld
.查看fe和be节点状态
show proc ‘/frontends’; show proc ‘/backends’;
.fe节点连接状态如图
.be节点连接状态如图
.删除fe 命令
mysql> ALTER SYSTEM DROPP FOLLOWER "192.168.220.145:9050";
.删除be命令
ALTER SYSTEM DROP BACKEND "192.168.220.146:9050";