topic

Kafka常用命令

為{幸葍}努か 提交于 2019-12-03 20:09:52
- 依次在各节点上启动: kafka bin/kafka-server-start.sh config/server.properties - 查看当前服务器中的所有topic bin/kafka-topics.sh --list --zookeeper hadoop01:2181 - 创建topic bin/kafka-topics.sh --create --zookeeper hadoop01:2181 --replication-factor 1 --partitions 3 --topic CustomerContacts - 删除topic bin/kafka-topics.sh --delete --zookeeper hadoop01:2181 --topic CustomerContacts 需要server.properties中设置delete.topic.enable=true否则只是标记删除或者直接重启。 - 通过shell命令发送消息 sh bin/kafka-console-producer.sh --broker-list kafka01:9092 --topic test - 通过shell消费消息 bin/kafka-console-consumer.sh --zookeeper hadoop01:2181 --from-beginning -

Kafka 的一些知识点整理【1】

穿精又带淫゛_ 提交于 2019-12-03 20:06:34
First: Kafka 是什么? Kafka 是一个发布订阅系统 最初是是LinkedIn 开发 最后交给Apache 开源组织 github地址: https://github.com/apache/kafka 是用java 和Scala 去开发的~ Kafka 现在主要用于 消息队列使用 Kafka 是一个快速 可扩展 内在就是分布式的系统 分布式: Kafka 提供集群服务 Kafka cluster 可以由一个或者多个Broker 组成 每个Broker 提供对客户端的服务 分区: 每一类消息 或者叫订阅主体 topic 可以有很多分区 Partition 复制:一个topic 的分区有多个副本,按照一定的规则分布在broker集群中,副本可分为leader和follow,leader所在broker负责响应客户端的读写请求,follow周期性地同步leader数据,已防止leader故障后消息丢失 常见的术语有哪些 Broker : Kafka集群包含一个或多个服务器,这种服务器被称为broker。broker端不维护数据的消费状态,提升了性能。直接使用磁盘进行存储,线性读写,速度快:避免了数据在JVM内存和系统内存之间的复制,减少耗性能的创建对象和垃圾回收 Topic && Partition : Topic 是指消息发送的服务器的类别 消费着用此类别去订阅消息

kafka的offset相关知识

為{幸葍}努か 提交于 2019-12-03 17:11:38
Offset存储模型 由于一个partition只能固定的交给一个消费者组中的一个消费者消费,因此Kafka保存offset时并不直接为每个消费者保存,而是以 groupid-topic-partition -> offset 的方式保存。 如图所示: Kafka在保存Offset的时候,实际上是将Consumer Group和partition对应的offset以消息的方式保存在__consumers_offsets这个topic中 。 __consumers_offsets默认拥有50个partition,可以通过 Math.abs(groupId.hashCode() % offsets.topic.num.partitions) 的方式来查询某个Consumer Group的offset信息保存在__consumers_offsets的哪个partition中。 下图展示了__consumers_offsets中保存的offset消息的格式: 如图所示,一条offset消息的格式为groupid-topic-partition -> offset。 因此consumer poll消息时,已知groupid和topic,又通过Coordinator分配partition的方式获得了对应的partition,自然能够通过Coordinator查找__consumers

kafka常用命令

余生颓废 提交于 2019-12-03 15:17:49
kafka自带sh脚本使用示例: (1)启动/关闭kafka服务: ```shell nohup env JMX_PORT=9999 /path/to/kafka_2.10-0.8.2.2/bin/kafka-server-start.sh config/server.properties >/dev/null 2>&1 & /path/to/kafka_2.10-0.8.2.2/bin/zookeeper-server-stop.sh config/zookeeper.properties >/dev/null 2>&1 & ``` (2)创建topic /path/to/kafka_2.10-0.8.2.2/bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test 查看topic列表 /path/to/kafka_2.10-0.8.2.2/bin/kafka-topics.sh --list --zookeeper localhost:2181 (3)发送msg /path/to/kafka_2.10-0.8.2.2/bin/kafka-console-producer.sh --broker-list localhost

Kafka---如何配置Kafka集群和zookeeper集群

会有一股神秘感。 提交于 2019-12-03 15:17:34
Kafka的集群配置 一般有 三种方法 ,即 (1)Single node – single broker集群; (2)Single node – multiple broker集群; (3)Multiple node – multiple broker集群。 前两种方法官网上有配置过程( (1)(2)配置方法官网教程 ),下面会简单介绍前两种方法,主要介绍最后一种方法。 准备工作: 1.Kafka的压缩包,这里选用的是 kafka_2.10-0.8.2.2.tgz 。 2.三台CentOS 6.4 64位虚拟机。分别是192.168.121.34(主机名为master)、192.168.121.35(主机名为datanode1)、192.168.121.36(主 机名为datanode2)。 一、Single node – single broker集群配置(单节点单boker集群配置) 注:图片来源自网络 1.解压Kafka的压缩包 [root @master kafkainstall]# tar -xzf kafka_2.10-0.8.2.0.tgz [root @master kafkainstall]# cd kafka_2.10-0.8.2.2 这里我新建了一个kafkainstall文件夹来存放加压后的文件,然后进入解压后的kafka_2.10-0.8.2.2文件夹。

RMQ Topic

旧城冷巷雨未停 提交于 2019-12-03 11:51:51
原创转载请注明出处: https://www.cnblogs.com/agilestyle/p/11794927.html RMQ Topic Project Directory Maven Dependency 1 <?xml version="1.0" encoding="UTF-8"?> 2 <project xmlns="http://maven.apache.org/POM/4.0.0" 3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 4 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 5 <modelVersion>4.0.0</modelVersion> 6 7 <groupId>org.fool.rmq</groupId> 8 <artifactId>rmq</artifactId> 9 <version>1.0-SNAPSHOT</version> 10 11 <parent> 12 <groupId>org.springframework.boot</groupId> 13 <artifactId>spring-boot-starter-parent

IE problem with CSS file

匿名 (未验证) 提交于 2019-12-03 09:17:17
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: After the upload of a new site version to the Production environment - the site is displayed incorrectly in IE, tested versions 6 and 8. While on the local version of the site (UAT environment) everything is fine. After the short investigation I found out that IE just changes the CSS file itslef. It is starting from ~line 1740 with the follwing: in the correct CSS version: .add-topic-form .title, .add-topic-form .tags, .add-topic-form .original_author, .add-topic-form .original_link, .add-topic-form .link-url { margin-top: 5px; width: 95%; }

text file of all titles / topic titles in Freebase

匿名 (未验证) 提交于 2019-12-03 09:05:37
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need a text file to contain every title / title of each topic / title of each item in a .txt file each on its own line. How can I do this or make this if I have already downloaded a freebase rdf dump? If possible, I also need a separate text file with each topic's / item's description on a single line each description on its own line. How can I do that? I would greatly appreciate it if someone could help me make either of these files from a Freebase rdf dump. Thanks in Advance! 回答1: Filter the RDF dump on the predicate/property ns:type

WARN Error while fetching metadata with correlation id 1 : {MY_TOPIC?=INVALID_TOPIC_EXCEPTION} (org.apache.kafka.clients.NetworkClient)

匿名 (未验证) 提交于 2019-12-03 08:59:04
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: when I run the following command with kafka 0.9.0.1 i get this warnings[1]. Can you please tell me what is wrong with my topics? (I'm talking to the kafka broker which runs in ec2) #./kafka-console-consumer.sh --new-consumer --bootstrap-server kafka.xx.com:9092 --topic MY_TOPIC? [1] [2016-04-06 10:57:45,839] WARN Error while fetching metadata with correlation id 1 : {MY_TOPIC?=INVALID_TOPIC_EXCEPTION} (org.apache.kafka.clients.NetworkClient) [2016-04-06 10:57:46,066] WARN Error while fetching metadata with correlation id 3 : {MY_TOPIC?

LDA and topic model

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have studied LDA and Topic model for several weeks.But due to my poor mathematics ability, i can not fully understand its inner algorithms.I have used the GibbsLDA implementation, input a lot of documents, and set topic number as 100, i got a file named "final.theta" which stores the topic proportion of each topic in each document.This result is good, i can use the topic proportion to do many other things. But when i tried Blei's C language implementation on LDA, i only got a file named final.gamma, but i don't know how to