Druid

Druid(Druid.io)简单使用

橙三吉。 提交于 2019-12-18 02:30:29
Druid简单使用 一、Druid服务进程 Historical进程:Historical进程用于处理历史数据的存储和查询(历史数据包括所以已经被committed的流数据)。Historical进程从深度存储(Deep Storage)中下载Segment数据,同时支持对这些数据的查询操作。Historical进程不支持写入操作。 MiddleManager进程:MiddleManager负责将数据导入到集群中。他们负责从外部数据源中读取数据,也负责发布新的Segment。 Broker进程:Broker负责从外部客户端接收查询请求,并把这些请求拆分成子查询后转发给Historical和MiddleManager。当Broker接收到这些子查询的结果疑惑,会合并子查询结果并将结果返回给调用者。终端用户实际上都是和Broker做交互,而不会直接查询Historical和MiddleManager。 Coordinator进程:Coordinator进程负责协调Historical进程。他们负责把Segment分配给特定的Historical进程,以及确保这些Segment在Historical间是负载均衡的。 Overlard进程:Overlard进程负责协调MiddleManager进程,它也是数据导入的控制器

Doker容器部署Tomcat服务器

隐身守侯 提交于 2019-12-18 01:38:34
1、拉取tomcat服务镜像文件 root@ubuntu:~# docker pull registry.cn-hangzhou.aliyuncs.com/xxxx/xxxxx:web web: Pulling from registry.xxxxxxx/xiaoyaoji 0586e6d4e45e: Extracting [==============> ] 19.5 MB/67.1 MB 0586e6d4e45e: Pulling fs layer 0586e6d4e45e: Downloading [==============================> ] 40.38 MB/67.1 MB 15d45afac408: Download complete 9b8cebd39bac: Download complete 62ca1091452a: Download complete 07570fbab17a: Download complete 889ff497587a: Downloading [===========================> ] 103.3 MB/186.5 MB 2、通过镜像生成容器 root@ubuntu:~# docker run -d -p 80:8080 registry.cn-hangzhou.xxxxxx:web

springboot集成druid数据源并且监控

回眸只為那壹抹淺笑 提交于 2019-12-18 01:30:07
Druid是 Java 语言中最好的 数据库 连接池,并且能够提供强大的监控和扩展功能。 业界把 Druid 和 HikariCP 做对比后,虽说 HikariCP 的性能比 Druid 高,但是因为 Druid 包括很多维度的统计和分析功能,所以这也是大家都选择使用它的原因。 首先配置 druid maven 依赖 <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.0.18</version></dependency>配置 application.properties #数据库spring.datasource.type=com.alibaba.druid.pool.DruidDataSourcespring.datasource.url=jdbc:mysql://localhost:3306/my_data?useUnicode=true&characterEncoding=utf8spring.datasource.username=rootspring.datasource.password=123456spring.datasource.driver-class-name=com.mysql.jdbc.Driver#为实体对象所在的包

springboot中使用druid和监控配置

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-17 22:54:31
如果想要监控自己的项目的访问情况及查看配置信息,druid是一个很好的选择,可能你会问druid是什么?有什么用?优点是什么? Druid简介 Druid是阿里巴巴开源的数据库连接池,号称是Java语言中最好的数据库连接池,能够提供强大的监控和扩展功能。GitHub地址: https://github.com/alibaba/druid。 Druid有以下优点: 1) 可以监控数据库访问性能,Druid内置提供了一个功能强大的StatFilter插件,能够详细统计SQL的执行性能,这对于线上分析数据库访问性能有帮助。 2) 替换DBCP和C3P0,Druid提供了一个高效、功能强大、可扩展性好的数据库连接池。 3) 数据库密码加密。直接把数据库密码写在配置文件中,这是不好的行为,容易导致安全问题。DruidDriver和DruidDataSource都支持PasswordCallback。 4) SQL执行日志,Druid提供了不同的LogFilter,能够支持Common-Logging、Log4j和JdkLog,你可以按需要选择相应的LogFilter,监控你应用的数据库访问情况。 5) 扩展JDBC,如果你要对JDBC层有编程的需求,可以通过Druid提供的Filter-Chain机制,很方便编写JDBC层的扩展插件。 Spring Boot默认的数据源是:org

数据库连接池Druid使用总结(结合各位大牛总结的)

会有一股神秘感。 提交于 2019-12-17 06:50:53
根据综合性能,可靠性,稳定性,扩展性,易用性等因素替换成最优的 数据库 连接池。 Druid:druid-1.0.29 数据库 Mysql.5.6.17 替换 目标: 替换掉C3P0,用 druid来替换 替换原因: 1、性能方面 hikariCP>druid>tomcat-jdbc>dbcp>c3p0 。hikariCP的高性能得益于最大限度的避免锁竞争。 2、druid功能最为全面,sql拦截等功能,统计数据较为全面,具有良好的扩展性。 3、综合性能,扩展性等方面,可考虑使用druid或者hikariCP连接池 ,比较方便对jdbc接口进行监控跟踪等。 4、可开启prepareStatement缓存,对性能会有大概20%的提升。 psCache是connection私有的,所以不存在线程竞争的问题,开启pscache不会存在竞争的性能损耗。 psCache的key为prepare执行的sql和catalog等,value对应的为prepareStatement对象。开启缓存主要是减少了解析sql的开销。 5、 3p0历史悠久,代码及其复杂,不利于维护。并且存在deadlock的潜在风险。 6、Druid可以打印SQL,慢查询方面的日志 Druid 参数 配置参数 缺省值 游戏服设置的值 参数说明 initialSize 0 4 初始化连接数量 minIdle 0 4

Spring Boot学习(二)—— 配置Druid连接池

安稳与你 提交于 2019-12-15 05:38:40
目录 要先配置上数据源!!! Druid简述: 一、搭建一个空壳Spring Boot项目 二、配置数据源 三、添加Druid依赖以及配置: 四、加密数据库password 关于Spring Boot整合Druid连接池最重要的一点就是: 要先配置上数据源!!! 不然,启动项目的时候会报错!!! 接下来就把 Spring Boot配置Druid需要的最少的依赖和代码贴出来,做个纪念吧! Druid简述: Druid的官方项目在GitHub上: https://github.com/alibaba/druid 里面有一些优点及配置的介绍,这玩意经过阿里巴巴双11的检验,性能上肯定没啥问题了! 一、搭建一个空壳Spring Boot项目 可参考: https://blog.csdn.net/weixin_42443070/article/details/103392421 二、配置数据源 我用的是mysql,所以在项目中要额外引入以下两个依赖: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </dependency> <dependency> <groupId>mysql</groupId> <artifactId

UnresolvedAddressException being hit by Druid broker

為{幸葍}努か 提交于 2019-12-13 08:27:24
问题 I'm new to Druid. I've set up a cluster using the Imply IAP package. Events are being ingested into Druid from Kafka using Tranquility. I can see that the events are being accepted by Tranquility - the following log statements are what I used to verify that: 2016-10-03 19:19:22,715 [KafkaConsumer-CommitThread] INFO c.m.tranquility.kafka.KafkaConsumer - Flushed {conn_recs={receivedCount=1, sentCount=1, droppedCount=0, unparseableCount=0}} pending messages in 32056ms and committed offsets in

Springboot 文件形式配置Druid

无人久伴 提交于 2019-12-13 04:04:43
Springboot2.0之后,只有Druid1.1.10以上的版本才能支持: pom.xml <dependency> <groupId>com.alibaba</groupId> <artifactId>druid-spring-boot-starter</artifactId> <version>1.1.21</version> </dependency> application.properities ###########数据库配置########## spring.datasource.driver-class-name=com.mysql.jdbc.Driver ##开发用 spring.datasource.url=jdbc:mysql://1.1.1.1:3306/baoyandao?characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true ##部署用 #spring.datasource.url=jdbc:mysql://1.1.1.1:3306/baoyandao?characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai

Java - java.lang.NoClassDefFoundError: com/google/inject/internal/util/$Preconditions

柔情痞子 提交于 2019-12-12 13:52:39
问题 I'm working on an extension for druid that uses jclouds for Rackspace Cloud Files and I encountered a problem with Google guice and I'm not very confident with Java. I already saw this question, but it doesn't seem that there's a conflict in guice versions. This is the code that is being executed: @Provides @LazySingleton public CloudFilesApi getCloudFilesApi(final CloudFilesAccountConfig config) { log.info("Provider: " + config.getProvider()); log.info("Username: " + config.getUserName());

SpringBoot整合Druid实现数据源监控

故事扮演 提交于 2019-12-12 00:46:43
1.pom依赖 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.1.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.jdbcconection</groupId> <artifactId>jdbc</artifactId> <version>0.0.1-SNAPSHOT</version> <name