自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(98)
  • 收藏
  • 关注

原创 oracel和db2 mybatis批量更新

网上有很多关于mybatis批量更新的例子,但基本都是针对mysql或oracle的,针对db2的少之又少;一、oracle+mybatis执行批量更新:mapper.xml:<update id="doupdateBatchResUpStatusById" parameterType="java.util.List"><foreach collec...

2020-03-02 23:06:31 1602 1

原创 非阻塞算法简介

在不只一个线程访问一个互斥的变量时,所有线程都必须使用同步,否则就可能会发生一些非常糟糕的事情。Java 语言中主要的同步手段就是synchronized关键字(也称为内在锁),它强制实行互斥,确保执行synchronized块的线程的动作,能够被后来执行受相同锁保护的synchronized块的其他线程看到。在使用得当的时候,内在锁可以让程序做到线程安全,但是在使用锁定保护短的代码路...

2019-06-28 14:05:32 245

原创 流行的原子

十五年前,多处理器系统是高度专用系统,要花费数十万美元(大多数具有两个到四个处理器)。现在,多处理器系统很便宜,而且数量很多,几乎每个主要微处理器都内置了多处理支持,其中许多系统支持数十个或数百个处理器。要使用多处理器系统的功能,通常需要使用多线程构造应用程序。但是正如任何编写并发应用程序的人可以告诉你的那样,要获得好的硬件利用率,只是简单地在多个线程中分割工作是不够的,还必须确保线程确实大部...

2019-06-28 14:05:09 212

原创 【kafka系列教程48】kafka在正在运行的集群中整合安全功能

将安全功能合并到运行的群集中你可以为正在运行的集群增加1个或多个我们前面讨论的安全协议,这是分阶段完成的:以增量替换的方式添加额外的安全端口(s)。 客户端使用安全的端口来连接,而不是PLAINTEXT端口的(假设你是客户端需要安全连接broker)。 再次增量的方式依次启用broker与broker之间的安全端口(如果需要) 最后依次关闭PLAINTEXT端口。7.2和7.3节介...

2019-06-28 14:04:52 443

原创 【kafka系列教程47】kafka认证和acl

认证和aclkafka附带一个可插拔的ACL(Access Control List 访问控制列表),它使用zookeeper来存储。通过在server.properties中设置authorizer.class.name来启用:authorizer.class.name=kafka.security.auth.SimpleAclAuthorizerKafka acls的格式为"...

2019-06-28 14:04:46 1162

原创 【kafka系列教程46】kafka SASL验证

使用SASL认证1. JAAS配置Kafka使用Java认证和授权服务(JAAS)进行SASL配置。 为broker配置JAAS KafkaServer是每个KafkaServer/Broker使用JAAS文件中的部分名称。本节为broker提供了SASL配置选项,包括进行broker之间通信所需的任何SASL客户端连接。 客户端部分用于验证与zookeeper的SASL连接...

2019-06-28 14:04:38 706

原创 【kafka系列教程45】kafka使用SSL加密和认证

使用SSL加密和认证Apache kafka 允许clinet通过SSL连接,SSL默认是不可用的,需手动开启。1. 为每个Kafka broker生成SSL密钥和证书。部署HTTPS,第一步是为集群的每台机器生成密钥和证书,可以使用java的keytool来生产。我们将生成密钥到一个临时的密钥库,之后我们可以导出并用CA签名它。keytool -keystore server....

2019-06-28 14:04:22 5890

原创 【kafka系列教程44】Java版本

Java版本From a security perspective, we recommend you use the latest released version of JDK 1.8 as older freely available versions have disclosed security vulnerabilities. LinkedIn is currently ru...

2019-06-28 12:32:55 341

原创 【kafka系列教程43】kafka生产服务器配置

生产者服务器配置Here is our server production server configuration:这是我们的服务器生产服务器配置:# Replication configurationsnum.replica.fetchers=4replica.fetch.max.bytes=1048576replica.fetch.wait.max.ms=500re...

2019-06-28 12:32:47 423

原创 【kafka系列教程42】Kafka Manager

作为一个分布式的消息发布-订阅系统,Apache Kafka在 Yahoo内部已经被很多团队所使用,例如媒体分析团队就将其应用到了实时分析流水线中,同时,Yahoo整个Kafka集群处理的峰值带宽超过了 20Gbps(压缩数据)。为了让开发者和服务工程师能够更加简单地维护Kafka集群,Yahoo构建了一个基于Web的管理工具,称为Kafka Manager,日前该项目已经在GitHub上开源。...

2019-06-28 12:32:37 1481 1

原创 【kafka系列教程41】kafka监控

MonitoringKafka uses Yammer Metrics for metrics reporting in both the server and the client. This can be configured to report stats using pluggable stats reporters to hook up to your monitoring syst...

2019-06-28 12:32:24 2300 1

原创 【kafka系列教程40】kafka数据中心

数据中心总结:意思是kafka集群最好部署在相同局域网的环境里,不要部署在不同的网络环境里。Some deployments will need to manage a data pipeline that spans multiple datacenters. Our recommended approach to this is to deploy a local Kafka clus...

2019-06-27 00:14:53 332

原创 【kafka系列教程39】kafka在数据迁移期间限制带宽的使用

Kafka提供一个broker之间复制传输的流量限制,限制了副本从机器到另一台机器的带宽上限。当重新平衡集群,引导新broker,添加或移除broker时候,这是很有用的。因为它限制了这些密集型的数据操作从而保障了对用户的影响。有2个接口可以实现限制。最简单和最安全的是调用kafka-reassign-partitions.sh时加限制。另外kafka-configs.sh也可以直接查看和修改...

2019-06-27 00:14:45 377

原创 【kafka系列教程38】kafka彻底删除topic

kafka0.8.1.1以及之前版本都无法使用类似一条命令就彻底删除topic,以前看过网上一些删除命令不过只是在zookeeper注销信息而已,但是实际的日志内容还是保存在kafka log中,因为个人需要所以慢慢琢磨了方法彻底清除topic(ps:kafka0.8.2好像直接支持直接删除,不过现在还是beta版 )。机器环境如下:Kafka目录:/usr/local/kafka_2....

2019-06-27 00:14:33 154

原创 【kafka系列教程37】kafka增加副本

增加副本Increasing the replication factor of an existing partition is easy. Just specify the extra replicas in the custom reassignment json file and use it with the --execute option to increase the r...

2019-06-27 00:14:21 596

原创 【kafka系列教程36】kafka退役broker

退役brokersThe partition reassignment tool does not have the ability to automatically generate a reassignment plan for decommissioning brokers yet. As such, the admin has to come up with a reassign...

2019-06-27 00:14:11 215

原创 【kafka系列教程35】kafka扩大集群

Adding servers to a Kafka cluster is easy, just assign them a unique broker id and start up Kafka on your new servers. However these new servers will not automatically be assigned any data partitions,...

2019-06-27 00:13:58 145

原创 【kafka系列教程34】kafka检查消费者位置

Sometimes it's useful to see the position of your consumers. We have a tool that will show the position of all consumers in a consumer group as well as how far behind the end of the log they are. To r...

2019-06-27 00:13:46 831

原创 【kafka系列教程33】kafka镜像集群之间的数据

镜像集群之间的数据We refer to the process of replicating databetweenKafka clusters "mirroring" to avoid confusion with the replication that happens amongst the nodes in a single cluster. Kafka comes with a ...

2019-06-27 00:13:37 624

原创 【kafka系列教程32】kafka平衡leader

Whenever a broker stops or crashes leadership for that broker's partitions transfers to other replicas. This means that by default when the broker is restarted it will only be a follower for all its p...

2019-06-27 00:13:26 405

原创 【kafka系列教程31】优雅的关闭kafka

The Kafka cluster will automatically detect any broker shutdown or failure and elect new leaders for the partitions on that machine. This will occur whether a server fails or it is brought down intent...

2019-06-27 00:13:15 3185

原创 【kafka系列教程30】kafka修改删除topic

You can change the configuration or partitioning of a topic using the same topic tool.你可以使用同样的topic工具更改topic的配置和分区。To add partitions you can do你可以添加分区 > bin/kafka-topics.sh --zookeeper z...

2019-06-25 22:19:20 696

原创 【kafka系列教程29】从老版本升级kafka

从老版本升级kafka从0.8.x, 0.9.x 或 0.10.0.X 升级到 0.10.1.00.10.1.0有线协议更改,通过遵循以下建议的滚动升级,在升级期间不会停机。但是,需要注意升0.10.1.0中潜在的突发状况。注意:由于引入了新的协议,要在升级客户端之前先升级kafka集群(即,0.10.1.x仅支持 0.10.1.x或更高版本的broker,但是0.10.1.x的bro...

2019-06-25 22:19:10 1839 1

原创 【kafka系列教程28】kafka添加和修改topic

You have the option of either adding topics manually or having them be created automatically when data is first published to a non-existent topic. If topics are auto-created then you may want to tune ...

2019-06-25 22:18:53 3009

原创 【kafka系列教程27】kafka分布

消费者offset跟踪 (Consumer Offset Tracking)The high-level consumer tracks the maximum offset it has consumed in each partition and periodically commits its offset vector so that it can resume from those ...

2019-06-25 22:18:45 323

原创 【kafka系列教程26】kafka日志

日志A log for a topic named "my_topic" with two partitions consists of two directories (namely my_topic_0 and my_topic_1) populated with data files containing the messages for that topic. The forma...

2019-06-25 22:18:34 253

原创 【kafka系列教程25】kafka消息格式

kafka消息格式消息(又名记录)始终是按批次写入。一批消息用技术术语表达就是记录批次,记录批次包含一个或多个记录。 在低性能的情况下,一个批次只有单条消息。记录批次和记录都有自己的头文件。下面介绍了Kafka版本0.11.0及更高版本(消息格式版本v2或magic = 2)的格式。点击此处查看有关邮件格式0和1的详细信息。5.3.1 消息批次以下是RecordBatch的磁盘格式。...

2019-06-25 22:18:23 657

原创 【kafka系列教程24】kafka网络层

网络层The network layer is a fairly straight-forward NIO server, and will not be described in great detail. The sendfile implementation is done by giving the MessageSet interface a writeTo method. T...

2019-06-25 22:18:12 155

原创 【kafka系列教程23】kafka接口设计

API设计生产者APIThe Producer API that wraps the 2 low-level producers - kafka.producer.SyncProducer and kafka.producer.async.AsyncProducer.生产者API,它封装了2个低级别的生产者-kafka.producer.SyncProducer 和kafka....

2019-06-25 22:18:02 931

原创 【kafka系列教程22】kafka配额

配额从0.9开始,Kafka集群能够对生产和消费设置配额。为每个客户端分组设置配额阈值(基于字节比率)。Kafka集群有能力对请求进行配额来控制客户端使用的broker资源。可以为共享配额的每个客户组执行两种类型的客户配额:通过配额定义网络带宽的字节率阈值(从0.9版本开始) 请求率配额将CPU的利用率阈值定义为网络和I/O线程的百分比(自0.11版本起)为什么需要配额?生产者...

2019-06-25 22:17:50 634

原创 【kafka系列教程21】kafka日志压缩

日志压缩Log compaction ensures that Kafka will always retain at least the last known value for each message key within the log of data for a single topic partition. It addresses use cases and scenari...

2019-06-25 22:17:38 951

原创 【kafka系列教程20】kafka副本和leader选举

副本Kafka replicates the log for each topic's partitions across a configurable number of servers (you can set this replication factor on a topic-by-topic basis). This allows automatic failover to thes...

2019-06-24 00:07:39 2134

原创 【kafka系列教程19】kafka消息传递保障

Now that we understand a little about how producers and consumers work, let's discuss the semantic guarantees Kafka provides between producer and consumer. Clearly there are multiple possible message ...

2019-06-24 00:07:28 722

原创 【kafka系列教程18】kafka消费者

The Kafka consumer works by issuing "fetch" requests to the brokers leading the partitions it wants to consume. The consumer specifies its offset in the log with each request and receives back a chunk...

2019-06-24 00:07:20 280

原创 【kafka系列教程17】kafka生产者

负载平衡The producer sends data directly to the broker that is the leader for the partition without any intervening routing tier. To help the producer do this all Kafka nodes can answer a request for me...

2019-06-24 00:07:09 150

原创 【kafka系列教程16】kafka效率

We have put significant effort into efficiency. One of our primary use cases is handling web activity data, which is very high volume: each page view may generate dozens of writes. Furthermore we assu...

2019-06-24 00:07:00 160

原创 【kafka系列教程15】kafka持久化

不要害怕文件系统!Kafka relies heavily on the filesystem for storing and caching messages. There is a general perception that "disks are slow" which makes people skeptical that a persistent structure can off...

2019-06-24 00:06:52 416

原创 【kafka系列教程14】kafka设计动机

We designed Kafka to be able to act as a unified platform for handling all the real-time data feeds a large company might have. To do this we had to think through a fairly broad set of use cases.我们设...

2019-06-24 00:06:40 145

原创 【kafka系列教程13】Kafka AdminClient配置

AdminClient Configs以下是Kafka Admin客户端库的配置。NAME DESCRIPTION TYPE DEFAULT VALID VALUES IMPORTANCE bootstrap.servers host/port,用于和kafka集群建立初始化连接。因为这些服务器地址仅用于初始化连接,并通过现有配置的来发现全部的kaf...

2019-06-24 00:06:30 789

原创 【kafka系列教程12】Kafka Connect配置

Kafka Connect ConfigsKafka Connect框架的相关配置(注意,窗口可向右拉动)。NAME DESCRIPTION TYPE DEFAULT VALID VALUES IMPORTANCE config.storage.topic kafka topic仓库配置 string high g...

2019-06-24 00:06:19 471

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除