Druid时序数据库升级流程

Stella981
• 阅读 838

目前Druid集群版本为0.11.0,新版本0.12.1已支持Druid SQL和Redis,考虑到Druid新特性以及性能的提升,因此需要将Druid从0.11.0版本升级到0.12.1版本,下面将对Druid升级步骤做详细的介绍,升级时请严格按照此步骤进行升级,以免出现一些不可预知的问题。

1. Druid升级包

Druid官网下载druid-0.12.1-bin.tar.gz和mysql-metadata-storage-0.12.1.tar.gz

2. 配置Druid-0.12.1

  • 解压druid-0.12.1-bin.tar.gz

    [work@druid]$ tar -zxvf druid-0.12.1-bin.tar.gz [work@druid]$ rm -rf druid-0.12.1-bin.tar.gz

  • 解压mysql-metadata-storage-0.12.1.tar.gz

    [work@druid]$ tar -zxvf mysql-metadata-storage-0.12.1.tar.gz -C druid-0.12.1/extensions/ [work@druid]$ rm -rf mysql-metadata-storage-0.12.1.tar.gz

3. 配置common.runtime.properties

[work@druid druid-0.11.0]$ cd conf/druid/_common
[work@druid _common]$ vi common.runtime.properties


# If you specify `druid.extensions.loadList=[]`, Druid won't load any extension from file system.
# If you don't specify `druid.extensions.loadList`, Druid will load all the extensions under root extension directory.
# More info: http://druid.io/docs/latest/operations/including-extensions.html
druid.extensions.loadList=["druid-kafka-eight", "druid-hdfs-storage", "druid-histogram", "druid-datasketches", "druid-lookups-cached-global", "mysql-metadata-storage"]

# If you have a different version of Hadoop, place your Hadoop client jar files in your hadoop-dependencies directory
# and uncomment the line below to point to your directory.
#druid.extensions.hadoopDependenciesDir=/my/dir/hadoop-dependencies

#
# Logging
#

# Log all runtime properties on startup. Disable to avoid logging properties on startup:
druid.startup.logging.logProperties=true

#
# Zookeeper
#

druid.zk.service.host=172.16.XXX.XXX:2181
druid.zk.paths.base=/druid

#
# Metadata storage
#

# For Derby server on your Druid Coordinator (only viable in a cluster with a single Coordinator, no fail-over):
#druid.metadata.storage.type=derby
#druid.metadata.storage.connector.connectURI=jdbc:derby://localhost:1527/var/druid/metadata.db;create=true
#druid.metadata.storage.connector.host=localhost
#druid.metadata.storage.connector.port=1527

# For MySQL:
druid.metadata.storage.type=mysql
druid.metadata.storage.connector.connectURI=jdbc:mysql://172.16.XXX.XXX:3306/druid
druid.metadata.storage.connector.user=root
druid.metadata.storage.connector.password=123456

# For PostgreSQL:
#druid.metadata.storage.type=postgresql
#druid.metadata.storage.connector.connectURI=jdbc:postgresql://db.example.com:5432/druid
#druid.metadata.storage.connector.user=...
#druid.metadata.storage.connector.password=...

#
# Deep storage
#

# For local disk (only viable in a cluster if this is a network mount):
#druid.storage.type=local
#druid.storage.storageDirectory=var/druid/segments

# For HDFS:
druid.storage.type=hdfs
druid.storage.storageDirectory=/druid/segments

# For S3:
#druid.storage.type=s3
#druid.storage.bucket=your-bucket
#druid.storage.baseKey=druid/segments
#druid.s3.accessKey=...
#druid.s3.secretKey=...

#
# Indexing service logs
#

# For local disk (only viable in a cluster if this is a network mount):
#druid.indexer.logs.type=file
#druid.indexer.logs.directory=var/druid/indexing-logs

# For HDFS:
druid.indexer.logs.type=hdfs
druid.indexer.logs.directory=/druid/indexing-logs

# For S3:
#druid.indexer.logs.type=s3
#druid.indexer.logs.s3Bucket=your-bucket
#druid.indexer.logs.s3Prefix=druid/indexing-logs

#
# Service discovery
#

druid.selectors.indexing.serviceName=druid/overlord
druid.selectors.coordinator.serviceName=druid/coordinator

#
# Monitoring
#

druid.monitoring.monitors=["io.druid.java.util.metrics.JvmMonitor"]
druid.emitter=logging
druid.emitter.logging.logLevel=info

# Storage type of double columns
# ommiting this will lead to index double as float at the storage layer

druid.indexing.doubleStorage=double

4. 复制HDFS配置文件

[work@druid _common]$ cp core-site.xml /alidata/server/druid-0.12.1/conf/druid/_common/
[work@druid _common]$ cp hdfs-site.xml /alidata/server/druid-0.12.1/conf/druid/_common/
[work@druid _common]$ cp mapred-site.xml /alidata/server/druid-0.12.1/conf/druid/_common/
[work@druid _common]$ cp yarn-site.xml /alidata/server/druid-0.12.1/conf/druid/_common/

5.启用Druid SQL功能

[work@druid broker]$ vi runtime.properties


druid.service=druid/broker
druid.host=172.16.XXX.XXX
druid.port=8082

# HTTP server threads
druid.broker.http.numConnections=5
druid.server.http.numThreads=9

# Processing threads and buffers
druid.processing.buffer.sizeBytes=256000000
druid.processing.numThreads=2

# Query cache (we use a small local cache)
druid.broker.cache.useCache=true
druid.broker.cache.populateCache=true
druid.cache.type=local
druid.cache.sizeInByte=2000000000

# enable druid sql and http
druid.sql.enable=true
druid.sql.avatica.enable=true
druid.sql.http.enable=true

备注:broker、overlord、coordinator、historical、middleManager等目录下的runtime.properties新增属性druid.host=ipAddress

6. 更新MiddleManager任务执行数capacity

work@druid middleManager]$ vi runtime.properties


druid.service=druid/middleManager
druid.host=172.16.XXX.XXX
druid.port=8091

# Number of tasks per middleManager
druid.worker.capacity=20

# Task launch parameters
druid.indexer.runner.javaOpts=-server -Xmx2g -Duser.timezone=UTC -Dfile.encoding=UTF-8 -Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager
druid.indexer.task.baseTaskDir=var/druid/task

# HTTP server threads
druid.server.http.numThreads=9

# Processing threads and buffers on Peons
druid.indexer.fork.property.druid.processing.buffer.sizeBytes=256000000
druid.indexer.fork.property.druid.processing.numThreads=2

# Hadoop indexing
druid.indexer.task.hadoopWorkingPath=var/druid/hadoop-tmp
druid.indexer.task.defaultHadoopCoordinates=["org.apache.hadoop:hadoop-client:2.7.3"]

7. 升级Historical

[work@druid druid-0.12.1]$ nohup >> nohuphistorical.out java `cat conf/druid/historical/jvm.config | xargs` -cp conf/druid/_common:conf/druid/historical:lib/* io.druid.cli.Main server historical &

8. 升级Overlord

[work@druid druid-0.12.1]$ nohup >> logs/nohupoverlord.out java `cat conf/druid/overlord/jvm.config | xargs` -cp conf/druid/_common:conf/druid/overlord:lib/* io.druid.cli.Main server overlord &

9. 升级MiddleManager

  • 禁止Overlor再向指定服务的MiddleManager分配任务

    http://<MiddleManager_IP:PORT>/druid/worker/v1/disable

  • 查看指定MiddleManager任务列表

    http://<MiddleManager_IP:PORT>/druid/worker/v1/tasks

  • 启动MiddleManager

    [work@druid druid-0.12.1]$ nohup >> logs/nohupmiddleManager.out java cat conf/druid/middleManager/jvm.config | xargs -cp conf/druid/_common:conf/druid/middleManager:lib/* io.druid.cli.Main server middleManager &

  • 启用Overlord向指定MiddleManager分配任务

    http://<MiddleManager_IP:PORT>/druid/worker/v1/enable

10. 升级Broker

[work@druid druid-0.12.1]$ nohup >> nohupbroker.out java `cat conf/druid/broker/jvm.config | xargs` -cp conf/druid/_common:conf/druid/broker:lib/* io.druid.cli.Main server broker &

11. 升级Coordinator

[work@druid druid-0.12.1]$ nohup >> nohupcoordinator.out java `cat conf/druid/coordinator/jvm.config | xargs` -cp conf/druid/_common:conf/druid/coordinator:lib/* io.druid.cli.Main server coordinator &

至此,Druid就完成从0.11.0版本升级到0.12.1版本。

点赞
收藏
评论区
推荐文章
blmius blmius
3年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
皕杰报表之UUID
​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为
待兔 待兔
4个月前
手写Java HashMap源码
HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22
Stella981 Stella981
3年前
SpringBoot 开启Druid监控统计功能教程
Druid数据连接池简介Druid是Java语言中最好的数据库连接池。Druid能够提供强大的监控和扩展功能。性能好,同时自带监控页面,可以实时监控应用的连接池情况以及其中性能差的sql,方便我们找出应用中连接池方面的问题。Druid是一个JDBC组件,它包括三部分:1.DruidDriver代理
Stella981 Stella981
3年前
Druid数据库连接池 实现数据库账号密码加密
jar包版本:druid1.0.15.jar1\.加密,用以下命令将用户名和密码加密cmd命令行执行javacpdruid1.0.15.jarcom.alibaba.druid.filter.config.ConfigTools加密串得到密文2.用户名解密:packag
Stella981 Stella981
3年前
Spring Boot2.X+mybatis+Druid+PageHelper实现多数据源并分页,支持多个字段动态排序,结构层级分明,代码耦合,框架入门
一、SpringBoot整合Mybatis、Druid和PageHelper并实现多数据源和分页,支持多个字段动态排序,其中对分页插件进行了封装,满足于任何场景的开发Druid是一个数据库连接池。Druid可以说是目前最好的数据库连接池!因其优秀的功能、性能和扩展性方面,深受开发人员的青睐。Druid已经在阿里巴巴部署了超过600个应用,经过一年多
Wesley13 Wesley13
3年前
Java 学习笔记 三
一、Druid的简单使用1try{2//1.创建Druid数据源对象3DruidDataSourcedataSourcenewDruidDataSource();45//2.设置数据库连接信息6
Stella981 Stella981
3年前
SpringBoot2 学习 集成Druid配置
Mavenspring.datasource.druid.webstatfilter.principalsessionnamesession_name测试http://localhost:9081/mixmall/druid/index.html————————————————版权
可莉 可莉
3年前
0018SpringBoot连接docker中的mysql并使用druid数据源
由于druid数据源自带监控功能,所以引用druid数据源1、centos7中安装并启动docker2、docker安装并启动mysql3、pom.xml中引入druid依赖4、application.yml中配置数据库连接及druid数据源信息5、编写DruidConfig配置文件,绑定4中所配置的数据源信息6、编写HelloCon
Easter79 Easter79
3年前
SpringBoot2 学习 集成Druid配置
Mavenspring.datasource.druid.webstatfilter.principalsessionnamesession_name测试http://localhost:9081/mixmall/druid/index.html————————————————版权