Skip to content

Commit a72a40b

Browse files
committed
更新脚本
1 parent 662fa67 commit a72a40b

5 files changed

Lines changed: 54 additions & 30 deletions

File tree

codes/linux/ops/service/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# 服务安装配置
2+
3+
## JDK 安装
4+
5+
说明:
6+
7+
JDK8 会被安装到 `/usr/lib/jvm/java` 路径。
8+
9+
使用方法:
10+
11+
执行以下任意命令即可执行安装脚本。
12+
13+
```sh
14+
curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/service/jdk8-install.sh | bash
15+
wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/service/jdk8-install.sh | bash
16+
```
17+
18+
## Redis 安装
19+
20+
说明:
21+
22+
下载 `5.0.4` 版本的 redis 并解压安装到 `/opt/redis` 路径下。
23+
24+
使用方法:
25+
26+
执行以下任意命令即可执行安装脚本。
27+
28+
```sh
29+
curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/service/redis-install.sh | bash
30+
wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/service/redis-install.sh | bash
31+
```
32+
33+

codes/linux/ops/service/jdk/README.md

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

codes/linux/ops/service/jdk/install-jdk8.sh renamed to codes/linux/ops/service/jdk8-install.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#!/usr/bin/env bash
22

3+
cat << EOF
34
###################################################################################
45
# 安装 JDK8 脚本
56
# 仅适用于所有 CentOS 发行版本
67
# JDK 会被安装到 /usr/lib/jvm/java 路径。
78
# Author: Zhang Peng
89
###################################################################################
10+
EOF
911

1012
echo -e "\n>>>>>>>>> install jdk8"
1113

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,31 @@
11
#!/usr/bin/env bash
22

3+
cat << EOF
34
###################################################################################
45
# 安装 Redis 脚本
5-
# 适用于所有 linux 发行版本。
6-
# 注意:安装 nginx 需要依赖以下库,需预先安装:
7-
# yum install -y zlib zlib-devel gcc-c++ libtool openssl openssl-devel tcl
86
# Author: Zhang Peng
97
###################################################################################
8+
EOF
109

11-
echo -e "\n>>>>>>>>> install redis"
10+
version=5.0.4
11+
if [[ -n $1 ]]; then
12+
version=$1
13+
fi
1214

13-
# 下载并解压 redis
1415
root=/opt/redis
15-
version=4.0.8
16+
if [[ -n $2 ]]; then
17+
root=$2
18+
fi
19+
20+
echo -e "\n>>>>>>>>> install libs"
21+
yum install -y zlib zlib-devel gcc-c++ libtool openssl openssl-devel tcl
22+
23+
echo -e "\n>>>>>>>>> download redis"
1624
mkdir -p ${root}
1725
wget -O ${root}/redis-${version}.tar.gz http://download.redis.io/releases/redis-${version}.tar.gz
18-
cd ${root}systemctl
19-
tar zxvf redis-${version}.tar.gz
2026

21-
# 编译
22-
cd redis-${version}
23-
make
27+
echo -e "\n>>>>>>>>> install redis"
28+
tar zxvf ${root}/redis-${version}.tar.gz -C ${root}
29+
cd ${root}/redis-${version}
30+
make & make install
31+
cd -

codes/linux/ops/service/redis/README.md

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

0 commit comments

Comments
 (0)