Druid.io系列(八):部署
介绍
前面几个章节对Druid的整体架构做了简单的说明,本文主要描述如何部署Druid的环境
Imply提供了一套完整的部署方式,包括依赖库,Druid,图形化的数据展示页面,SQL查询组件等。本文将基于Imply套件进行说明
单机部署
依赖
- Java 8 or better
- Node.js 4.5.x or better
- Linux, Mac OS X, or other Unix-like OS (Windows is not supported)
- At least 4GB of RAM
下载与安装
- 从https://imply.io/get-started 下载最新版本安装包
- tar -xzf imply-2.5.14.tar.gz
- cd imply-2.5.14
目录说明如下:
- bin/ - run scripts for included software.
- conf/ - template configurations for a clustered setup.
- conf-quickstart/* - configurations for the single-machine quickstart.
- dist/ - all included software.
- quickstart/ - files related to the single-machine quickstart.
启动服务
bin/supervise -c conf/supervise/quickstart.conf
安装验证
导入测试数据
安装包中包含一些测试的数据,可以通过执行预先定义好的数据说明文件进行导入
bin/post-index-task --file quickstart/wikiticker-index.json
可视化控制台
- overlord 控制页面:http://localhost:8090/console.html.
- druid集群页面:http://localhost:8081
- 数据可视化页面:http://localhost:9095
- HTTP POST数据查询
命令:curl -L -H’Content-Type: application/json’ -XPOST –data-binary @quickstart/wikiticker-top-pages.json http://localhost:8082/druid/v2?pretty
结果:
[ { "timestamp" : "2016-06-27T00:00:11.080Z", "result" : [ { "edits" : 29, "page" : "Copa América Centenario" }, { "edits" : 16, "page" : "User:Cyde/List of candidates for speedy deletion/Subpage" }, .......... { "edits" : 8, "page" : "World Deaf Championships" } ] } ]
集群部署
集群配置的规划需要根据需求来定制,下面以一个开发环境机器搭建为例,描述如何搭建一个有HA特性的Druid集群.
集群部署有以下几点需要说明
1. 为了保证HA,主节点部署两台
2. 管理节点与查询节点可以考虑多核大内存的机器
部署规划
角色 | 机器 | 配置 | 集群角色 |
---|---|---|---|
主节点 | 10.5.24.137 | 8C16G | Coordinator,Overlord |
主节点 | 10.5.24.138 | 8C16G | Coordinator,Overlord |
数据节点,查询节点 | 10.5.24.139 | 8C16G | Historical, MiddleManager, Tranquility,Broker,Pivot Web |
数据节点,查询节点 | 10.5.24.140 | 8C16G | Historical, MiddleManager, Tranquility,(数据节点,查询节点)Broker |
部署步骤
公共配置
编辑conf/druid/_common/common.runtime.properties 文件内容
#
# Extensions
#
druid.extensions.directory=dist/druid/extensions
druid.extensions.hadoopDependenciesDir=dist/druid/hadoop-dependencies
druid.extensions.loadList=["druid-parser-route","druid-lookups-cached-global","druid-histogram","druid-datasketches","mysql-metadata-storage","druid-hdfs-storage","druid-kafka-indexing-service"]
#
# Logging
#
# Log all runtime properties on startup. Disable to avoid logging properties on startup:
druid.startup.logging.logProperties=true
#
# Zookeeper
#
druid.zk.service.host=master251
druid.zk.paths.base=/druid
# For MySQL:
druid.metadata.storage.type=mysql
druid.metadata.storage.connector.connectURI=jdbc:mysql://master251:3306/druid
druid.metadata.storage.connector.user=druid
druid.metadata.storage.connector.password=druid
#
# Deep storage
#
# For local disk (only viable in a cluster if this is a network mount):
# For HDFS:
druid.storage.type=hdfs
druid.storage.storageDirectory=hdfs://master251:9000/druid/segments
主节点配置
- 创建配置文件:cp conf/supervise/master-no-zk.conf conf/supervise/master.conf
- 编辑master.conf 内容如下:
:verify bin/verify-java
:verify bin/verify-version-check coordinator bin/run-druid coordinator conf
!p80 overlord bin/run-druid overlord conf
目前的版本中,mysql-metadata-storage没有包含在默认的安装包中,如果使用mysql存储元数据,需要单独安装下对应的扩展,是用下列命令在两个master节点上对需要用到的扩展进行安装:
root@druid imply-2.5.# java -classpath "dist/druid/lib/*" -Ddruid.extensions.directory="dist/druid/extensions" io.druid.cli.Main tools pull-deps -c io.druid.extensions:mysql-metadata-storage:0.12. -c io.druid.extensions.contrib:druid-rabbitmq:0.12. -h org.apache.hadoop:hadoop-client:2.6.
==默认mysql-metadata-storage带的mysql驱动是针对Mysql 5.1的,如果使用Mysql的版本是5.5 或是其他版本,可能会出现”Communications link failure”的错误,此时需要更新Mysql的驱动。==
在10.5.24.137/138上启动master相关服务:nohup bin/supervise -c conf/supervise/master.conf > master.log &
数据节点与查询节点配置
- 安装NodeJS:apt-get install nodejs
- 创建配置文件:vim conf/supervise/data-with-query.conf
- 编辑data-with-query.conf 内容如下:
:verify bin/verify-java
:verify bin/verify-node
:verify bin/verify-version-check broker bin/run-druid broker conf
imply-ui bin/run-imply-ui conf historical bin/run-druid historical conf
middleManager bin/run-druid middleManager conf # Uncomment to use Tranquility Server
#!p95 tranquility-server bin/tranquility server -configFile conf/tranquility/server.json # Uncomment to use Tranquility Kafka
#!p95 tranquility-kafka bin/tranquility kafka -configFile conf/tranquility/kafka.json
对于集群模式,pivot的配置文件必须调整为mysql,sqllite会导致无法查看datasource,修改conf/pivot/config.xml文件
settingsLocation:
location: mysql
uri: 'mysql://root:123456@10.5.24.151:3306/druid'
table: 'pivot_state'
initialSettings:
clusters:
- name: druid
type: druid
host: localhost:
在10.5.24.139/140两台机器上分别执行:nohup bin/supervise -c conf/supervise/data-with-query.conf > data-with-query.log &
验证
可视化控制台
- overlord 控制页面:http://10.5.24.138:8090/console.html.
- druid集群页面:http://10.5.24.138:8081
- 数据可视化页面:http://10.5.24.139:9095
Druid.io系列(八):部署的更多相关文章
- Druid.io系列(九):数据摄入
1. 概述 Druid的数据摄入主要包括两大类: 1. 实时输入摄入:包括Pull,Push两种 - Pull:需要启动一个RealtimeNode节点,通过不同的Firehose摄取不同种类的数据源 ...
- Druid.io系列(一):简介
原文链接: https://blog.csdn.net/njpjsoftdev/article/details/52955676 Druid.io(以下简称Druid)是面向海量数据的.用于实时查询与 ...
- Druid.io系列(五):查询过程
原文链接: https://blog.csdn.net/njpjsoftdev/article/details/52956194 Druid使用JSON over HTTP 作为底层的查询语言,不过强 ...
- Druid.io系列(七):架构剖析
1. 前言 Druid 的目标是提供一个能够在大数据集上做实时数据摄入与查询的平台,然而对于大多数系统而言,提供数据的快速摄入与提供快速查询是难以同时实现的两个指标.例如对于普通的RDBMS,如果想要 ...
- Druid.io系列(三): Druid集群节点
原文链接: https://blog.csdn.net/njpjsoftdev/article/details/52955937 1 Historical Node Historical Node的职 ...
- Druid.io系列(二):基本概念与架构
原文链接: https://blog.csdn.net/njpjsoftdev/article/details/52955788 在介绍Druid架构之前,我们先结合有关OLAP的基本原理来理解Dr ...
- Druid.io系列(六):问题总结
原文地址: https://blog.csdn.net/njpjsoftdev/article/details/52956508 我们在生产环境中使用Druid也遇到了很多问题,通过阅读官网文档.源码 ...
- Druid.io系列(四):索引过程分析
原文链接: https://blog.csdn.net/njpjsoftdev/article/details/52956083 Druid底层不保存原始数据,而是借鉴了Apache Lucene.A ...
- 微软云平台windows azure入门系列八课程
微软云平台windows azure入门系列八课程: Windows Azure入门教学系列 (一): 创建第一个WebRole程序与部署 Windows Azure入门教学系列 (二): 创建第一个 ...
随机推荐
- vue.js 源代码学习笔记 ----- 工具方法 perf
import { inBrowser } from './env' export let mark export let measure if (process.env.NODE_ENV !== 'p ...
- flask 文件的上传下载和excel操作
文件的下载 from flask import send_from_directory @excel_bp.route('/get_attachment/<path:filename>') ...
- jfreechart 在jsp页面显示所画的图片(resin服务器的servelet配置是关键)(图片只过内存)
用的web服务器是resin服务器,在配置web.xml时需要注意,其实resin服务器的web.xml服务器配置和tomcat服务器的配置很像, 1. 我第一次按照自己的想法,想当然的在resin- ...
- c++下使用命名管道实现进程间通信
前面已经使用邮槽实现过进程间通信:http://www.cnblogs.com/jzincnblogs/p/5192654.html ,这里使用命名管道实现进程间通信. 与邮槽不同的是,命名管道在进程 ...
- How to choose the number oftopics/partitions in a Kafka cluster?
How to choose the number oftopics/partitions in a Kafka cluster? 如何为一个kafka集群选择topics/partitions的数量? ...
- Windows下安装Web.py快速指南
环境介绍 首先介绍下安装使用的环境 - Windows 7 - Python 3.6 Web.py介绍 web.py是Python在Web领域一个轻量级的解决方案,所谓轻量,就是非常简单快速满足Web ...
- Modules(最小树形图)
题目链接: Modules 描述 蒜头有一块主板,为了提升其性能,可在主板上安置若干增强模块.蒜头有n个不同的增强模块,增强模块可以直接安置在主板上,也可以安置在已经直接或间接连接在主板上的其他增强模 ...
- Xcode 8 修改项目名
很麻烦,不想修改了 有个教程,贴一下. From: 大发写字的地方 Xcode8 修改包名(含cocopods)
- 【剑指offer】和为s的两个数字
原创博文,转载请注明出处! # 题目 # 思路 首先定义两个指针,第一个指针p指向数组的第一个数字,第二个指针q指向数组的最后一个数字.如果p+q=s,则找到要找的数字:如果p+q<s,则p向后 ...
- 【剑指offer】二叉树的镜像,C++实现(先序遍历)
原创博文,转载请注明出处!github地址 博客文章索引地址 1.题目 输入一颗二叉树,将二叉树变换为原二叉树的镜像,如下图所示: 2.思路 二叉树有0个节点 二叉树有1个节点 二叉树有 ...