单机版Druid安装过程

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了单机版Druid安装过程相关的知识,希望对你有一定的参考价值。

记录Druid单机版安装过程,大体与官网安装过程,加入了个别与官网安装不一致的情况和解决方法

Druid运行依赖zookeeper作为分布式协调服务,下载安装zookeeper

wget https://archive.apache.org/dist/zookeeper/zookeeper-3.4.11/zookeeper-3.4.11.tar.gz
tar -zvf zookeeper-3.4.14.tar.gz
ln -s zookeeper-3.4.14 zookeeper

下载Druid安装包:

wget http://mirrors.tuna.tsinghua.edu.cn/apache/incubator/druid/0.15.0-incubating/apache-druid-0.15.0-incubating-bin.tar.gz
tar -zxf apache-druid-0.15.0-incubating-bin.tar.gz
ln -s apache-druid-0.15.0-incubating druid

配置~/.bash_profile 环境变量
vim ~/.bash_profile

export JAVA_HOME=/home/homework/jdk
export ZK_HOME=/home/homework/zookeeper
export DRUID_HOME=/home/homework/druid
export KAFKA_HOME=/home/homework/kafka
export PATH=$PATH:$JAVA_HOME/bin:$ZK_HOME/bin:$DRUID_HOME/bin:$KAFKA_HOME/bin

重新加载环境变量
source ~/.bash_profile

启动zookeeper

zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /home/homework/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED

启动druid

[homework@test druid]$ start-micro-quickstart 
[Thu Aug 15 19:51:07 2019] Running command[zk], logging to[/mnt/homework/apache-druid-0.15.0-incubating/var/sv/zk.log]: bin/run-zk conf
[Thu Aug 15 19:51:07 2019] Running command[coordinator-overlord], logging to[/mnt/homework/apache-druid-0.15.0-incubating/var/sv/coordinator-overlord.log]: bin/run-druid coordinator-overlord conf/druid/single-server/micro-quickstart
[Thu Aug 15 19:51:07 2019] Running command[broker], logging to[/mnt/homework/apache-druid-0.15.0-incubating/var/sv/broker.log]: bin/run-druid broker conf/druid/single-server/micro-quickstart
[Thu Aug 15 19:51:07 2019] Running command[router], logging to[/mnt/homework/apache-druid-0.15.0-incubating/var/sv/router.log]: bin/run-druid router conf/druid/single-server/micro-quickstart
[Thu Aug 15 19:51:07 2019] Running command[historical], logging to[/mnt/homework/apache-druid-0.15.0-incubating/var/sv/historical.log]: bin/run-druid historical conf/druid/single-server/micro-quickstart
[Thu Aug 15 19:51:07 2019] Running command[middleManager], logging to[/mnt/homework/apache-druid-0.15.0-incubating/var/sv/middleManager.log]: bin/run-druid middleManager conf/druid/single-server/micro-quickstart
[Thu Aug 15 19:51:08 2019] Command[zk] exited (pid = 25982, exited = 1)
[Thu Aug 15 19:51:08 2019] Command[zk] failed, see logfile for more details: /mnt/homework/apache-druid-0.15.0-incubating/var/sv/zk.log
[Thu Aug 15 19:51:11 2019] Running command[zk], logging to[/mnt/homework/apache-druid-0.15.0-incubating/var/sv/zk.log]: bin/run-zk conf

我在执行这个命令的情况下会报错。具体报错内容可以查看/mnt/homework/apache-druid-0.15.0-incubating/var/sv/zk.log。主要原因是官网要求将zookeeper以zk文件夹放在druid的根目录下。
由于我这里zookeeper的安装是与druid等其他组件同级目录。所以在druid的安装目录下创建了一个软连接,指向zk

cd /home/homework/druid
ln -s /home/homework/zookeeper zk

这个情况下,就能够启动druid

以上是关于单机版Druid安装过程的主要内容,如果未能解决你的问题,请参考以下文章

Druid单机环境安装指南

Druid 大数据分析之快速应用(单机模式)

安装-单机

kafka单机和集群(全分布)的安装部署过程

mac 搭建单机版kafka完整过程-基于kafka3.0

Ubuntu22.04 安装单机版kubernetes