Skip to content

Commit 1535ae1

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

6 files changed

Lines changed: 64 additions & 33 deletions

File tree

codes/linux/ops/soft/README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,21 @@ curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/
6161
wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/nodejs-install.sh | bash
6262
```
6363

64+
## MongoDB 安装
65+
66+
说明:
67+
68+
下载 mongodb `4.0.9` 并解压安装到 `/opt/mongodb` 路径下。
69+
70+
使用方法:
71+
72+
执行以下任意命令即可执行安装脚本。
73+
74+
```sh
75+
curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/mongodb-install.sh | bash
76+
wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/mongodb-install.sh | bash
77+
```
78+
6479
## Redis 安装
6580

6681
说明:
@@ -115,4 +130,16 @@ curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/
115130
wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/rocketmq-install.sh | bash
116131
```
117132

118-
脚本会下载解压 kafka 到 `/opt/kafka` 路径下。
133+
## ZooKeeper 安装
134+
135+
说明:
136+
137+
下载 zookeeper `3.4.12` 并解压安装到 `/opt/zookeeper` 路径下。
138+
139+
使用方法:执行以下任意命令即可执行脚本。
140+
141+
```sh
142+
curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/zookeeper-install.sh | bash
143+
wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/zookeeper-install.sh | bash
144+
```
145+

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" "kafka" "rocketmq"
14+
select item in "git" "zsh" "jdk" "maven" "nodejs" "mongodb" "redis" "tomcat" "kafka" "rocketmq" "zookeeper"
1515
do
1616
path=$(cd "$(dirname "$0")"; pwd)
1717
case ${item} in
@@ -20,10 +20,12 @@ case ${item} in
2020
"jdk") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/jdk8-install.sh | bash ;;
2121
"maven") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/maven-install.sh | bash ;;
2222
"nodejs") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/nodejs-install.sh | bash ;;
23+
"mongodb") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/mongodb-install.sh | bash ;;
2324
"redis") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/redis-install.sh | bash ;;
2425
"tomcat") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/tomcat8-install.sh | bash ;;
2526
"kafka") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/kafka-install.sh | bash ;;
2627
"rocketmq") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/rocketmq-install.sh | bash ;;
28+
"zookeeper") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/zookeeper-install.sh | bash ;;
2729
*)
2830
echo -e "输入项不支持!"
2931
main
Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,29 @@
11
#!/usr/bin/env bash
22

3+
cat << EOF
4+
35
###################################################################################
46
# 安装 mongodb 脚本
5-
# 适用于所有 linux 发行版本。
7+
# @system: 适用于所有 linux 发行版本。
68
# @author: Zhang Peng
79
###################################################################################
810
9-
echo -e "\n>>>>>>>>> install mongodb"
11+
EOF
12+
13+
version=4.0.9
14+
if [[ -n $1 ]]; then
15+
version=$1
16+
fi
1017

11-
# 下载并解压 mongodb
1218
root=/opt/mongodb
13-
version=3.6.3
19+
if [[ -n $2 ]]; then
20+
root=$2
21+
fi
22+
23+
echo -e "\n>>>>>>>>> download mongodb"
1424
mkdir -p ${root}
1525
wget -O ${root}/mongodb-linux-x86_64-${version}.tgz https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-${version}.tgz
16-
cd ${root}
17-
tar zxf mongodb-linux-x86_64-${version}.tgz
18-
mv mongodb-linux-x86_64-${version} mongodb-${version}
1926

27+
echo -e "\n>>>>>>>>> install mongodb"
28+
tar zxf ${root}/mongodb-linux-x86_64-${version}.tgz -C ${root}
2029
mkdir -p /data/db

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

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
11
#!/usr/bin/env bash
22

3+
cat << EOF
4+
35
###################################################################################
46
# 安装 zookeeper 脚本
5-
# 适用于所有 linux 发行版本。
7+
# @system: 适用于所有 linux 发行版本。
68
# @author: Zhang Peng
79
###################################################################################
810
9-
echo -e "\n>>>>>>>>> install zookeeper"
11+
EOF
1012

11-
root=/opt/zookeeper
1213
version=3.4.12
14+
if [[ -n $1 ]]; then
15+
version=$1
16+
fi
17+
18+
root=/opt/zookeeper
19+
if [[ -n $2 ]]; then
20+
root=$2
21+
fi
22+
23+
echo -e "\n>>>>>>>>> download zookeeper"
1324
mkdir -p ${root}
1425
wget -O ${root}/zookeeper-${version}.tar.gz http://mirrors.hust.edu.cn/apache/zookeeper/zookeeper-${version}/zookeeper-${version}.tar.gz
15-
cd ${root}
16-
tar -zxf zookeeper-${version}.tar.gz
17-
cd zookeeper-${version}
26+
27+
echo -e "\n>>>>>>>>> install zookeeper"
28+
tar zxf ${root}/zookeeper-${version}.tar.gz -C ${root}

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

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

0 commit comments

Comments
 (0)