阿里云ECS安装zookeeper/kafka的配置问题

安装步骤网上很多,按照要求下载,解压,配置环境变量即可。

由于是在阿里云上部署。简单说一下配置文件。第一步肯定是先在ECS实例安全组设置开通端口了

zookeeper没啥特别的看下端口clientPort=2181,就可以。

kafka要设置一下。主要就是ip端口

# see kafka.server.KafkaConfig for additional details and defaults

############################# Server Basics #############################

# The id of the broker. This must be set to a unique integer for each broker.
broker.id=1
port=9092
host.name=172.66.32.11  //内网地址
advertised.host.name=49.67.215.142  //公网地址

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

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

# The address the socket server listens on. It will get the value returned from 
# java.net.InetAddress.getCanonicalHostName() if not configured.
#   FORMAT:
#     listeners = listener_name://host_name:port
#   EXAMPLE:
#     listeners = PLAINTEXT://your.host.name:9092
#listeners=PLAINTEXT://:9092

# Hostname and port the broker will advertise to producers and consumers. If not set, 
# it uses the value for "listeners" if configured.  Otherwise, it will use the value
# returned from java.net.InetAddress.getCanonicalHostName().
#advertised.listeners=PLAINTEXT://your.host.name:9092
advertised.listeners=PLAINTEXT://49.67.215.142:9092  //公网地址

另外就是其余两个配置  log路径和  zookeeper地址

你可能感兴趣的:(java开发,微服务,消息队列,分布式)