Skip to content

Commit 5ef7e1b

Browse files
committed
更新脚本
1 parent cf0fe82 commit 5ef7e1b

13 files changed

Lines changed: 92 additions & 62 deletions

File tree

codes/linux/ops/soft/README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
安装 [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh)
88

9-
使用方法
9+
使用方法
1010

1111
执行以下任意命令即可执行安装脚本。
1212

@@ -89,3 +89,30 @@ curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/
8989
wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/tomcat8-install.sh | bash
9090
```
9191

92+
## Kafka 安装
93+
94+
说明:
95+
96+
下载 kafka `2.2.0` 并解压安装到 `/opt/kafka` 路径下。
97+
98+
使用方法:执行以下任意命令即可执行脚本。
99+
100+
```sh
101+
curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/kafka-install.sh | bash
102+
wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/kafka-install.sh | bash
103+
```
104+
105+
## RocketMQ 安装
106+
107+
说明:
108+
109+
下载 rocketmq `4.5.0` 并解压安装到 `/opt/rocketmq` 路径下。
110+
111+
使用方法:执行以下任意命令即可执行脚本。
112+
113+
```sh
114+
curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/rocketmq-install.sh | bash
115+
wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/rocketmq-install.sh | bash
116+
```
117+
118+
脚本会下载解压 kafka 到 `/opt/kafka` 路径下。
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env bash
2+
3+
cat << EOF
4+
5+
###################################################################################
6+
# 安装 Kafka 脚本
7+
# @system: 适用于所有 linux 发行版本。
8+
# @author: Zhang Peng
9+
###################################################################################
10+
11+
EOF
12+
13+
version=2.2.0
14+
if [[ -n $1 ]]; then
15+
version=$1
16+
fi
17+
18+
root=/opt/kafka
19+
if [[ -n $2 ]]; then
20+
root=$2
21+
fi
22+
23+
echo -e "\n>>>>>>>>> download kafka"
24+
mkdir -p ${root}
25+
wget -O ${root}/kafka_2.12-${version}.tgz http://mirrors.tuna.tsinghua.edu.cn/apache/kafka/${version}/kafka_2.12-${version}.tgz
26+
27+
echo -e "\n>>>>>>>>> install kafka"
28+
tar zxf ${root}/kafka_2.12-${version}.tgz -C ${root}

codes/linux/ops/soft/kafka/README.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

codes/linux/ops/soft/kafka/install-kafka.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

codes/linux/ops/soft/main.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ EOF
1111

1212
path=$(cd "$(dirname "$0")"; pwd)
1313
PS3="Please select script type: "
14-
select item in "git" "zsh" "jdk" "maven" "nodejs" "redis" "tomcat"
14+
select item in "git" "zsh" "jdk" "maven" "nodejs" "redis" "tomcat" "kafka" "rocketmq"
1515
do
1616
path=$(cd "$(dirname "$0")"; pwd)
1717
case ${item} in
@@ -22,6 +22,8 @@ case ${item} in
2222
"nodejs") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/nodejs-install.sh | bash ;;
2323
"redis") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/redis-install.sh | bash ;;
2424
"tomcat") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/tomcat8-install.sh | bash ;;
25+
"kafka") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/kafka-install.sh | bash ;;
26+
"rocketmq") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/rocketmq-install.sh | bash ;;
2527
*)
2628
echo -e "输入项不支持!"
2729
main

codes/linux/ops/soft/mongodb/install-mongodb.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ version=3.6.3
1414
mkdir -p ${root}
1515
wget -O ${root}/mongodb-linux-x86_64-${version}.tgz https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-${version}.tgz
1616
cd ${root}
17-
tar zxvf mongodb-linux-x86_64-${version}.tgz
17+
tar zxf mongodb-linux-x86_64-${version}.tgz
1818
mv mongodb-linux-x86_64-${version} mongodb-${version}
1919

2020
mkdir -p /data/db

codes/linux/ops/soft/nginx/install-nginx.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ nginxVersion=1.12.2
2222
mkdir -p ${ngixnRoot}
2323
wget -O ${ngixnRoot}/nginx-${nginxVersion}.tar.gz http://nginx.org/download/nginx-${nginxVersion}.tar.gz
2424
cd ${ngixnRoot}
25-
tar zxvf nginx-${nginxVersion}.tar.gz
25+
tar zxf nginx-${nginxVersion}.tar.gz
2626

2727
# 编译
2828
cd nginx-${nginxVersion}

codes/linux/ops/soft/nginx/install-pcre.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ version=$2
1616
mkdir -p ${root}
1717
wget -O ${root}/pcre-${version}.tar.gz http://downloads.sourceforge.net/project/pcre/pcre/${version}/pcre-${version}.tar.gz
1818
cd ${root}
19-
tar zxvf pcre-${version}.tar.gz
19+
tar zxf pcre-${version}.tar.gz
2020
cd pcre-${version}
2121

2222
# 编译

codes/linux/ops/soft/redis-install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ mkdir -p ${root}
2828
wget -O ${root}/redis-${version}.tar.gz http://download.redis.io/releases/redis-${version}.tar.gz
2929

3030
echo -e "\n>>>>>>>>> install redis"
31-
tar zxvf ${root}/redis-${version}.tar.gz -C ${root}
31+
tar zxf ${root}/redis-${version}.tar.gz -C ${root}
3232
cd ${root}/redis-${version}
3333
make & make install
3434
cd -
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env bash
2+
3+
cat << EOF
4+
5+
###################################################################################
6+
# 安装 rocketmq 脚本
7+
# @system: 适用于所有 linux 发行版本。
8+
# @author: Zhang Peng
9+
###################################################################################
10+
11+
EOF
12+
13+
version=4.5.0
14+
if [[ -n $1 ]]; then
15+
version=$1
16+
fi
17+
18+
root=/opt/rocketmq
19+
if [[ -n $2 ]]; then
20+
root=$2
21+
fi
22+
23+
echo -e "\n>>>>>>>>> download rocketmq"
24+
mkdir -p ${root}
25+
wget -O ${root}/rocketmq-all-${version}-bin-release.zip http://mirrors.tuna.tsinghua.edu.cn/apache/rocketmq/${version}/rocketmq-all-${version}-bin-release.zip
26+
27+
echo -e "\n>>>>>>>>> install rocketmq"
28+
unzip -o ${root}/rocketmq-all-${version}-bin-release.zip -d ${root}/rocketmq-all-${version}/

0 commit comments

Comments
 (0)