Skip to content

Commit

Permalink
Merge remote-tracking branch 'ops/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
汪志鹏 committed Jul 21, 2015
2 parents b34750c + 1647afe commit ed43c6c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 50 deletions.
7 changes: 6 additions & 1 deletion Service/ZooKeeper/ZooKeeper的安装.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

ZooKeeper的安装模式分为三种,分别为:单机模式(stand-alone)、集群模式和集群伪分布模式。ZooKeeper 单机模式的安装相对比较简单,如果第一次接触ZooKeeper的话,建议安装ZooKeeper单机模式或者集群伪分布模式。

# Exhibitor 是 ZooKeeper 实例监控,备份,恢复,清理和可视化工具, 是 ZooKeeper 的监控管理系统。
http://www.oschina.net/p/%E2%80%8Bexhibitor
# 解压后台启动 就可以用
http://ip:8088/exhibitor/v1/ui/index.html


clientPort=2181
maxClientCnxns=1024
Expand Down Expand Up @@ -432,4 +437,4 @@ numChildren = 0


# 注意 myid文件里面的数字要和 zoo.conf里面配置的当前server的.几对应
/opt/zookeeper/data/myid
/opt/zookeeper/data/myid
13 changes: 13 additions & 0 deletions Service/kafka/Kafka安装配置.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ zookeeper.connect=192.168.40.134:2181,192.168.40.132:2181,192.168.40.133:2181
先启动zookeeper服务: bin/zkServer.sh start (本文中zookeeper为独立安装,具体过程在此不细述)
再在每台机器上执行: bin/kafka-server-start.sh config/server.properties


# kafka配置注意
# 需要配置较大 分片影响读写速度
num.partitions=64

# 数据目录也要单独配置磁盘较大的地方
log.dirs=/data/kafka-logs

# 时间按需求保留过期时间 避免磁盘满
log.retention.hours=168



# 后台启动
nohup bin/kafka-server-start.sh /opt/kafka/config/server.properties &
# 注意 kafka如果有问题 nohup的日志文件会非常大,把磁盘占满
Expand Down
52 changes: 3 additions & 49 deletions Service/kafka/server.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
############################# Server Basics #############################

# The id of the broker. This must be set to a unique integer for each broker.
broker.id=91
broker.id=11

############################# Socket Server Settings #############################

# The port the socket server listens on
port=9092

# Hostname the broker will bind to. If not set, the server will bind to all interfaces
host.name=10.10.91.91
host.name=10.10.10.11

# Hostname the broker will advertise to producers and consumers. If not set, it uses the
# value for "host.name" if configured. Otherwise, it will use the value returned from
Expand Down Expand Up @@ -111,54 +111,8 @@ log.cleaner.enable=true
# server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002".
# You can also append an optional chroot string to the urls to specify the
# root directory for all kafka znodes.
zookeeper.connect=10.10.91.91:2181,10.10.91.93:2181,10.10.91.93:2181
zookeeper.connect=10.10.10.11:2181,10.10.10.12:2181,10.10.10.13:2181

# Timeout in ms for connecting to zookeeper
zookeeper.connection.timeout.ms=1000000

# declare the reporter
kafka.metrics.reporters=com.airbnb.kafka.KafkaStatsdMetricsReporter

# enable the reporter, (false)
external.kafka.statsd.reporter.enabled=true

# the host of the StatsD server (localhost)
external.kafka.statsd.host=10.10.76.71

# the port of the StatsD server (8125)
external.kafka.statsd.port=8125

# a prefix for all metrics names (empty)
external.kafka.statsd.metrics.prefix=kafka.10-10-91-91

# note that the StatsD reporter follows the global polling interval (10)
# kafka.metrics.polling.interval.secs=10

# A regex to exclude some metrics
# Default is: (kafka\.consumer\.FetchRequestAndResponseMetrics.*)|(.*ReplicaFetcherThread.*)|(kafka\.server\.FetcherLagMetrics\..*)|(kafka\.log\.Log\..*)|(kafka\.cluster\.Partition\..*)
#
# The metric name is formatted with this template: group.type.scope.name
#
# external.kafka.statsd.metrics.exclude_regex=

#
# Each metric provides multiple dimensions: min, max, meanRate, etc
# This is typically too much data.
# It is possible to enable/disable some metric dimensions with the following properties:
# (default values are shown)
#
# external.kafka.statsd.dimension.enabled.count=false
# external.kafka.statsd.dimension.enabled.meanRate=true
# external.kafka.statsd.dimension.enabled.rate1m=true
# external.kafka.statsd.dimension.enabled.rate5m=true
# external.kafka.statsd.dimension.enabled.rate15m=true
# external.kafka.statsd.dimension.enabled.min=false
# external.kafka.statsd.dimension.enabled.max=false
# external.kafka.statsd.dimension.enabled.mean=true
# external.kafka.statsd.dimension.enabled.stddev=false
# external.kafka.statsd.dimension.enabled.median=true
# external.kafka.statsd.dimension.enabled.p75=false
# external.kafka.statsd.dimension.enabled.p95=false
# external.kafka.statsd.dimension.enabled.p98=false
# external.kafka.statsd.dimension.enabled.p99=true
# external.kafka.statsd.dimension.enabled.p999=false

0 comments on commit ed43c6c

Please sign in to comment.