kafka 安装
下载kafka源码拷贝到/usr/local,添加path
安装JDK
安装
linux 下载rpm包
http://www.oracle.com/technetwork/java/javase/downloads/jdk10-downloads-4416644.html
执行rpm -iv jdk-10.0.2_linux-x64_bin.rpm
验证
$java -version
java version "10.0.2" 2018-07-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)
启动kafka
- 启动zookeeper /usr/local/kafka/bin/zookeeper-server-start.sh /usr/local/kafka/config/zookeeper.properties &
错误记录
启动kafka server错误
java.net.UnknownHostException: bj1-10-112-179-12: bj1-10-112-179-12: Name or service not known
- 原因
意思是找不到域名bj1-10-112-179-12,用hostname查看本地的主机名是否和bj1-10-112-179-12一样, - 解决
将本机地址和主机名的映射添加到/etc/hosts文件中
例如: 123.1.1.43 bj1-10-112-179-12