更新脚本

This commit is contained in:
Zhang Peng 2019-05-07 15:21:04 +08:00
parent 5ef7e1b11e
commit 1535ae1299
6 changed files with 64 additions and 33 deletions

View File

@ -61,6 +61,21 @@ curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/
wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/nodejs-install.sh | bash wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/nodejs-install.sh | bash
``` ```
## MongoDB 安装
说明:
下载 mongodb `4.0.9` 并解压安装到 `/opt/mongodb` 路径下。
使用方法:
执行以下任意命令即可执行安装脚本。
```sh
curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/mongodb-install.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/mongodb-install.sh | bash
```
## Redis 安装 ## Redis 安装
说明: 说明:
@ -115,4 +130,16 @@ curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/
wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/rocketmq-install.sh | bash wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/rocketmq-install.sh | bash
``` ```
脚本会下载解压 kafka 到 `/opt/kafka` 路径下。 ## ZooKeeper 安装
说明:
下载 zookeeper `3.4.12` 并解压安装到 `/opt/zookeeper` 路径下。
使用方法:执行以下任意命令即可执行脚本。
```sh
curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/zookeeper-install.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/zookeeper-install.sh | bash
```

View File

@ -11,7 +11,7 @@ EOF
path=$(cd "$(dirname "$0")"; pwd) path=$(cd "$(dirname "$0")"; pwd)
PS3="Please select script type: " PS3="Please select script type: "
select item in "git" "zsh" "jdk" "maven" "nodejs" "redis" "tomcat" "kafka" "rocketmq" select item in "git" "zsh" "jdk" "maven" "nodejs" "mongodb" "redis" "tomcat" "kafka" "rocketmq" "zookeeper"
do do
path=$(cd "$(dirname "$0")"; pwd) path=$(cd "$(dirname "$0")"; pwd)
case ${item} in case ${item} in
@ -20,10 +20,12 @@ case ${item} in
"jdk") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/jdk8-install.sh | bash ;; "jdk") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/jdk8-install.sh | bash ;;
"maven") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/maven-install.sh | bash ;; "maven") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/maven-install.sh | bash ;;
"nodejs") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/nodejs-install.sh | bash ;; "nodejs") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/nodejs-install.sh | bash ;;
"mongodb") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/mongodb-install.sh | bash ;;
"redis") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/redis-install.sh | bash ;; "redis") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/redis-install.sh | bash ;;
"tomcat") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/tomcat8-install.sh | bash ;; "tomcat") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/tomcat8-install.sh | bash ;;
"kafka") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/kafka-install.sh | bash ;; "kafka") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/kafka-install.sh | bash ;;
"rocketmq") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/rocketmq-install.sh | bash ;; "rocketmq") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/rocketmq-install.sh | bash ;;
"zookeeper") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/zookeeper-install.sh | bash ;;
*) *)
echo -e "输入项不支持!" echo -e "输入项不支持!"
main main

View File

@ -1,20 +1,29 @@
#!/usr/bin/env bash #!/usr/bin/env bash
cat << EOF
################################################################################### ###################################################################################
# 安装 mongodb 脚本 # 安装 mongodb 脚本
# 适用于所有 linux 发行版本。 # @system: 适用于所有 linux 发行版本。
# @author: Zhang Peng # @author: Zhang Peng
################################################################################### ###################################################################################
echo -e "\n>>>>>>>>> install mongodb" EOF
version=4.0.9
if [[ -n $1 ]]; then
version=$1
fi
# 下载并解压 mongodb
root=/opt/mongodb root=/opt/mongodb
version=3.6.3 if [[ -n $2 ]]; then
root=$2
fi
echo -e "\n>>>>>>>>> download mongodb"
mkdir -p ${root} mkdir -p ${root}
wget -O ${root}/mongodb-linux-x86_64-${version}.tgz https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-${version}.tgz wget -O ${root}/mongodb-linux-x86_64-${version}.tgz https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-${version}.tgz
cd ${root}
tar zxf mongodb-linux-x86_64-${version}.tgz
mv mongodb-linux-x86_64-${version} mongodb-${version}
echo -e "\n>>>>>>>>> install mongodb"
tar zxf ${root}/mongodb-linux-x86_64-${version}.tgz -C ${root}
mkdir -p /data/db mkdir -p /data/db

View File

@ -1,9 +0,0 @@
# 安装 mongodb
使用方法:
```sh
curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/mongodb/install-mongodb.sh | bash
```
脚本会下载解压 redis 到 `/opt/mongodb` 路径下。

View File

@ -1,17 +1,28 @@
#!/usr/bin/env bash #!/usr/bin/env bash
cat << EOF
################################################################################### ###################################################################################
# 安装 zookeeper 脚本 # 安装 zookeeper 脚本
# 适用于所有 linux 发行版本。 # @system: 适用于所有 linux 发行版本。
# @author: Zhang Peng # @author: Zhang Peng
################################################################################### ###################################################################################
echo -e "\n>>>>>>>>> install zookeeper" EOF
version=3.4.12
if [[ -n $1 ]]; then
version=$1
fi
root=/opt/zookeeper root=/opt/zookeeper
version=3.4.12 if [[ -n $2 ]]; then
root=$2
fi
echo -e "\n>>>>>>>>> download zookeeper"
mkdir -p ${root} mkdir -p ${root}
wget -O ${root}/zookeeper-${version}.tar.gz http://mirrors.hust.edu.cn/apache/zookeeper/zookeeper-${version}/zookeeper-${version}.tar.gz wget -O ${root}/zookeeper-${version}.tar.gz http://mirrors.hust.edu.cn/apache/zookeeper/zookeeper-${version}/zookeeper-${version}.tar.gz
cd ${root}
tar -zxf zookeeper-${version}.tar.gz echo -e "\n>>>>>>>>> install zookeeper"
cd zookeeper-${version} tar zxf ${root}/zookeeper-${version}.tar.gz -C ${root}

View File

@ -1,9 +0,0 @@
# 安装 ZooKeeper
使用方法:
```sh
curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/zookeeper/install-zookeeper.sh | bash
```
脚本会下载解压 zookeeper 到 `/opt/zookeeper` 路径下。