diff --git a/codes/deploy/main.sh b/codes/deploy/main.sh index 905289b..2bd86bd 100644 --- a/codes/deploy/main.sh +++ b/codes/deploy/main.sh @@ -55,6 +55,7 @@ cat << EOF [tomcat] install tomcat8 [nginx] install nginx [nodejs] install node.js [elk] install elk [redis] install redis [mongodb] install mongodb + [kafka] install kafka 【3 - Recommended Tools】 [sdk] install sdkman @@ -87,6 +88,7 @@ function chooseOper() { elk ) ${filepath}/tool/elk/install-elk.sh;; redis ) ${filepath}/tool/redis/install-redis.sh;; mongodb ) ${filepath}/tool/mongodb/install-mongodb.sh;; + kafka ) ${filepath}/tool/kafka/install-kafka.sh;; # 3 - Recommended Tools sdk ) ${filepath}/tool/sdk/install-sdk.sh;; diff --git a/codes/deploy/tool/kafka/README.md b/codes/deploy/tool/kafka/README.md new file mode 100644 index 0000000..fb27b51 --- /dev/null +++ b/codes/deploy/tool/kafka/README.md @@ -0,0 +1,11 @@ +# 安装 Kafka + +使用方法: + +```sh +wget --no-check-certificate --no-cookies https://raw.githubusercontent.com/dunwu/linux/master/codes/deploy/tool/kafka/install-kafka.sh +chmod -R 777 install-kafka.sh +./install-kafka.sh +``` + +脚本会下载解压 kafka 到 `/opt/software/kafka` 路径下。 diff --git a/codes/deploy/tool/kafka/install-kafka.sh b/codes/deploy/tool/kafka/install-kafka.sh new file mode 100644 index 0000000..61b955c --- /dev/null +++ b/codes/deploy/tool/kafka/install-kafka.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +################################################################################### +# 安装 kafka 脚本 +# 适用于所有 linux 发行版本。 +# Author: Zhang Peng +################################################################################### + +# 下载并解压 kafka +echo -e "\n>>>>>>>>> install kafka" + +root=/opt/software/kafka +version=2.11-1.1.0 +mkdir -p ${root} +wget -O ${root}/kafka_${version}.tgz http://mirrors.shu.edu.cn/apache/kafka/1.1.0/kafka_${version}.tgz +cd ${root} +tar -xzf kafka_${version}.tgz