第一次同步提交 github 和 gitee
parent
5dc233fd79
commit
2dfb94d010
57
README.md
57
README.md
|
@ -1,6 +1,12 @@
|
||||||
# Linux 教程
|
# Linux 教程
|
||||||
|
|
||||||
## :wrench: [软件安装配置](docs/linux/soft/README.md)
|
> 项目同步维护在 [github](https://github.com/dunwu/linux-tutorial) 和 [gitee](https://gitee.com/turnon/linux-tutorial)
|
||||||
|
|
||||||
|
| :wrench: | :shell: | :memo: | :books: |
|
||||||
|
| :----------------------------------: | :---------------------: | :--------------------: | :-------------------------: |
|
||||||
|
| [软件安装配置](#wrench-软件安装配置) | [运维脚本](#shell-运维脚本) | [知识点](#memo-知识点) | [学习资源](#books-学习资源) |
|
||||||
|
|
||||||
|
## :wrench: 软件安装配置
|
||||||
|
|
||||||
- [JDK 安装](docs/linux/soft/jdk-install.md)
|
- [JDK 安装](docs/linux/soft/jdk-install.md)
|
||||||
- [Elastic 安装](docs/linux/soft/elastic)
|
- [Elastic 安装](docs/linux/soft/elastic)
|
||||||
|
@ -17,7 +23,7 @@
|
||||||
- [Zookeeper 安装](docs/linux/soft/zookeeper-install.md)
|
- [Zookeeper 安装](docs/linux/soft/zookeeper-install.md)
|
||||||
- [Nacos 安装](docs/linux/soft/nacos-install.md)
|
- [Nacos 安装](docs/linux/soft/nacos-install.md)
|
||||||
|
|
||||||
## :shell: 脚本
|
## :shell: 运维脚本
|
||||||
|
|
||||||
- [软件安装配置脚本集合](https://github.com/dunwu/linux-tutorial/tree/master/codes/linux/soft)
|
- [软件安装配置脚本集合](https://github.com/dunwu/linux-tutorial/tree/master/codes/linux/soft)
|
||||||
|
|
||||||
|
@ -54,21 +60,16 @@
|
||||||
|
|
||||||
## :books: 学习资源
|
## :books: 学习资源
|
||||||
|
|
||||||
### 命令行检索
|
- 命令行检索
|
||||||
|
|
||||||
- [Linux 命令大全](http://man.linuxde.net/)
|
- [Linux 命令大全](http://man.linuxde.net/)
|
||||||
- [linux-command](https://jaywcjlove.gitee.io/linux-command/)
|
- [linux-command](https://jaywcjlove.gitee.io/linux-command/)
|
||||||
|
- 社区网站
|
||||||
### 社区网站
|
|
||||||
|
|
||||||
- [Linux 中国](https://linux.cn/) - 各种资讯、文章、技术
|
- [Linux 中国](https://linux.cn/) - 各种资讯、文章、技术
|
||||||
- [实验楼](https://www.shiyanlou.com/) - 免费提供了 Linux 在线环境,不用在自己机子上装系统也可以学习 Linux,超方便实用。
|
- [实验楼](https://www.shiyanlou.com/) - 免费提供了 Linux 在线环境,不用在自己机子上装系统也可以学习 Linux,超方便实用。
|
||||||
- [鸟哥的 linux 私房菜](http://linux.vbird.org/) - 非常适合 Linux 入门初学者看的教程。
|
- [鸟哥的 linux 私房菜](http://linux.vbird.org/) - 非常适合 Linux 入门初学者看的教程。
|
||||||
- [Linux 公社](http://www.linuxidc.com/) - Linux 相关的新闻、教程、主题、壁纸都有。
|
- [Linux 公社](http://www.linuxidc.com/) - Linux 相关的新闻、教程、主题、壁纸都有。
|
||||||
- [Linux Today](http://www.linuxde.net) - Linux 新闻资讯发布,Linux 职业技术学习!。
|
- [Linux Today](http://www.linuxde.net) - Linux 新闻资讯发布,Linux 职业技术学习!。
|
||||||
|
- 知识相关
|
||||||
### 知识相关
|
|
||||||
|
|
||||||
- [Linux 思维导图整理](http://www.jianshu.com/p/59f759207862)
|
- [Linux 思维导图整理](http://www.jianshu.com/p/59f759207862)
|
||||||
- [Linux 初学者进阶学习资源整理](http://www.jianshu.com/p/fe2a790b41eb)
|
- [Linux 初学者进阶学习资源整理](http://www.jianshu.com/p/fe2a790b41eb)
|
||||||
- [Linux 基础入门(新版)](https://www.shiyanlou.com/courses/1)
|
- [Linux 基础入门(新版)](https://www.shiyanlou.com/courses/1)
|
||||||
|
@ -77,9 +78,7 @@
|
||||||
- [Linux 编程之内存映射](https://www.shiyanlou.com/questions/2992)
|
- [Linux 编程之内存映射](https://www.shiyanlou.com/questions/2992)
|
||||||
- [Linux 知识点小结](https://blog.huachao.me/2016/1/Linux%E7%9F%A5%E8%AF%86%E7%82%B9%E5%B0%8F%E7%BB%93/)
|
- [Linux 知识点小结](https://blog.huachao.me/2016/1/Linux%E7%9F%A5%E8%AF%86%E7%82%B9%E5%B0%8F%E7%BB%93/)
|
||||||
- [10 大白帽黑客专用的 Linux 操作系统](https://linux.cn/article-6971-1.html)
|
- [10 大白帽黑客专用的 Linux 操作系统](https://linux.cn/article-6971-1.html)
|
||||||
|
- 软件工具
|
||||||
### 软件工具
|
|
||||||
|
|
||||||
- [超赞的 Linux 软件](https://www.gitbook.com/book/alim0x/awesome-linux-software-zh_cn/details) Github 仓库[Zh](https://github.com/alim0x/Awesome-Linux-Software-zh_CN) [En](https://github.com/VoLuong/Awesome-Linux-Software)
|
- [超赞的 Linux 软件](https://www.gitbook.com/book/alim0x/awesome-linux-software-zh_cn/details) Github 仓库[Zh](https://github.com/alim0x/Awesome-Linux-Software-zh_CN) [En](https://github.com/VoLuong/Awesome-Linux-Software)
|
||||||
- [程序员喜欢的 9 款最佳的 Linux 文件比较工具](http://os.51cto.com/art/201607/513796.htm)
|
- [程序员喜欢的 9 款最佳的 Linux 文件比较工具](http://os.51cto.com/art/201607/513796.htm)
|
||||||
- [提高 Linux 开发效率的 5 个工具](http://www.codeceo.com/article/5-linux-productivity-tools.html)
|
- [提高 Linux 开发效率的 5 个工具](http://www.codeceo.com/article/5-linux-productivity-tools.html)
|
||||||
|
@ -94,22 +93,16 @@
|
||||||
- [Webflow (Adobe Muse)](https://webflow.com/) 一款可以帮助用户不用编码就可以快速创建网站的谷歌浏览器插件。
|
- [Webflow (Adobe Muse)](https://webflow.com/) 一款可以帮助用户不用编码就可以快速创建网站的谷歌浏览器插件。
|
||||||
- [Tupi (Adobe Animate)](http://www.maefloresta.com/portal/) 一款可以创建 HTML5 动画的工具。
|
- [Tupi (Adobe Animate)](http://www.maefloresta.com/portal/) 一款可以创建 HTML5 动画的工具。
|
||||||
- [Black Magic Fusion (Adobe After Effects)](https://www.blackmagicdesign.com) 一款先进的合成软件,广泛应用于视觉特效、广电影视设计以及 3D 动画设计等领域。
|
- [Black Magic Fusion (Adobe After Effects)](https://www.blackmagicdesign.com) 一款先进的合成软件,广泛应用于视觉特效、广电影视设计以及 3D 动画设计等领域。
|
||||||
|
- 中国开源镜像站点
|
||||||
### 中国开源镜像站点
|
- [阿里云开源镜像站](http://mirrors.aliyun.com/)
|
||||||
|
- [网易开源镜像站](http://mirrors.163.com/)
|
||||||
- 阿里云开源镜像站:http://mirrors.aliyun.com/
|
- [搜狐开源镜像站](http://mirrors.sohu.com/)
|
||||||
- 网易开源镜像站:http://mirrors.163.com/
|
- [北京交通大学](http://mirror.bjtu.edu.cn/)
|
||||||
- 搜狐开源镜像站:http://mirrors.sohu.com/
|
- [兰州大学](http://mirror.lzu.edu.cn/)
|
||||||
- 北京交通大学:http://mirror.bjtu.edu.cn/ \<教育网荐\>
|
- [厦门大学](http://mirrors.xmu.edu.cn/)
|
||||||
- 兰州大学:http://mirror.lzu.edu.cn/ \<西北高校 FTP 搜索引擎\>
|
- [上海交通大学](http://ftp.sjtu.edu.cn/)
|
||||||
- 厦门大学:http://mirrors.xmu.edu.cn/
|
- [清华大学](http://mirrors.tuna.tsinghua.edu.cn/)
|
||||||
- 上海交通大学:http://ftp.sjtu.edu.cn/
|
- [中国科学技术大学](http://mirrors.ustc.edu.cn/)
|
||||||
- 清华大学:http://mirrors.tuna.tsinghua.edu.cn/
|
- [东北大学](http://mirror.neu.edu.cn/)
|
||||||
- http://mirrors6.tuna.tsinghua.edu.cn/
|
- [浙江大学](http://mirrors.zju.edu.cn/)
|
||||||
- http://mirrors4.tuna.tsinghua.edu.cn/
|
- [东软信息学院](http://mirrors.neusoft.edu.cn/)
|
||||||
- 中国科学技术大学:http://mirrors.ustc.edu.cn/
|
|
||||||
- http://ipv4.ustc.edu.cn/ \<教育网、电信\>
|
|
||||||
- http://ipv6.ustc.edu.cn/ \<IPv6 only\>
|
|
||||||
- 东北大学:http://mirror.neu.edu.cn/
|
|
||||||
- 浙江大学:http://mirrors.zju.edu.cn/
|
|
||||||
- 东软信息学院:http://mirrors.neusoft.edu.cn/
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
(1)下载脚本
|
(1)下载脚本
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/download.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/download.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
(2)执行脚本
|
(2)执行脚本
|
||||||
|
@ -20,7 +20,7 @@ cd /tmp/dunwu-ops
|
||||||
(3)清除脚本
|
(3)清除脚本
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/clear.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/clear.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
本项目总结、收集 Linux 环境下运维常用到的脚本工具,大致分为三类:
|
本项目总结、收集 Linux 环境下运维常用到的脚本工具,大致分为三类:
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
path=/tmp/dunwu-ops/
|
|
||||||
printf "\n>>>>>>>>> remove ${path}"
|
|
||||||
|
|
||||||
if [[ -d ${path} ]]; then
|
|
||||||
rm -f ${path}
|
|
||||||
printf "清除脚本成功"
|
|
||||||
else
|
|
||||||
printf "${path} 不存在,无法执行清除脚本操作"
|
|
||||||
fi
|
|
|
@ -1,13 +1,27 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
path=/tmp/dunwu-ops
|
##############################################################################
|
||||||
|
# console color
|
||||||
|
C_BLACK="\033[1;30m"
|
||||||
|
C_RED="\033[1;31m"
|
||||||
|
C_GREEN="\033[1;32m"
|
||||||
|
C_YELLOW="\033[1;33m"
|
||||||
|
C_BLUE="\033[1;34m"
|
||||||
|
C_PURPLE="\033[1;35m"
|
||||||
|
C_CYAN="\033[1;36m"
|
||||||
|
C_RESET="$(tput sgr0)"
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
path=/home/scripts/linux-tutorial
|
||||||
|
printf "\n${C_BLUE}>>>>>>>> Downloading linux-tutorial to ${path}.${C_RESET}\n"
|
||||||
|
command -v yum >/dev/null 2>&1 || { echo >&2 -e "${C_RED}Require yum but it's not installed. Aborting.${C_RESET}"; exit 1; }
|
||||||
|
command -v git >/dev/null 2>&1 || { echo >&2 -e "${C_YELLOW}Not detected git. Install git.${C_RESET}"; yum -y install git; }
|
||||||
|
|
||||||
|
if [[ -d ${path} ]]; then
|
||||||
|
cd ${path}
|
||||||
|
git pull
|
||||||
|
else
|
||||||
mkdir -p ${path}
|
mkdir -p ${path}
|
||||||
|
git clone --no-checkout https://gitee.com/turnon/linux-tutorial.git ${path}
|
||||||
printf "\n>>>>>>>>> download scripts to ${path}"
|
fi
|
||||||
wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/dunwu-ops.sh -O ${path}/dunwu-ops.sh
|
printf "\n${C_GREEN}<<<<<<<< Download linux-tutorial to ${path} ok.${C_RESET}\n"
|
||||||
wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/dunwu-soft.sh -O ${path}/dunwu-soft.sh
|
|
||||||
wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/dunwu-sys.sh -O ${path}/dunwu-sys.sh
|
|
||||||
|
|
||||||
chmod +x ${path}/dunwu-ops.sh
|
|
||||||
chmod +x ${path}/dunwu-soft.sh
|
|
||||||
chmod +x ${path}/dunwu-sys.sh
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ if [[ -n $index ]]; then
|
||||||
exit -1
|
exit -1
|
||||||
fi
|
fi
|
||||||
key=${menus[$no]}
|
key=${menus[$no]}
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/${key}-install.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/${key}-install.sh | bash
|
||||||
else
|
else
|
||||||
echo "输入项不支持!"
|
echo "输入项不支持!"
|
||||||
exit -1
|
exit -1
|
||||||
|
|
|
@ -16,22 +16,22 @@ select item in ${menus[@]}
|
||||||
do
|
do
|
||||||
case ${item} in
|
case ${item} in
|
||||||
"替换yum镜像")
|
"替换yum镜像")
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/change-yum-repo.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/change-yum-repo.sh | bash
|
||||||
main ;;
|
main ;;
|
||||||
"安装基本的命令工具")
|
"安装基本的命令工具")
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/install-tools.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/install-tools.sh | bash
|
||||||
main ;;
|
main ;;
|
||||||
"安装常用libs")
|
"安装常用libs")
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/install-libs.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/install-libs.sh | bash
|
||||||
main ;;
|
main ;;
|
||||||
"系统配置")
|
"系统配置")
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/sys-settings.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/sys-settings.sh | bash
|
||||||
main ;;
|
main ;;
|
||||||
"全部执行")
|
"全部执行")
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/change-yum-repo.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/change-yum-repo.sh | bash
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/install-tools | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/install-tools | bash
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/install-libs.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/install-libs.sh | bash
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/sys-settings.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/sys-settings.sh | bash
|
||||||
printf "执行完毕,退出。\n" ;;
|
printf "执行完毕,退出。\n" ;;
|
||||||
"退出")
|
"退出")
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
执行以下任意命令即可执行安装脚本。
|
执行以下任意命令即可执行安装脚本。
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/zsh-install.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/zsh-install.sh | bash
|
||||||
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/zsh-install.sh | bash
|
wget -qO- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/zsh-install.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
## JDK8 安装
|
## JDK8 安装
|
||||||
|
@ -26,8 +26,8 @@ JDK8 会被安装到 `/usr/lib/jvm/java` 路径。
|
||||||
执行以下任意命令即可执行安装脚本。
|
执行以下任意命令即可执行安装脚本。
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/jdk8-install.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/jdk8-install.sh | bash
|
||||||
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/jdk8-install.sh | bash
|
wget -qO- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/jdk8-install.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
## Maven 安装配置
|
## Maven 安装配置
|
||||||
|
@ -42,8 +42,8 @@ wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/li
|
||||||
执行以下任意命令即可执行安装脚本。
|
执行以下任意命令即可执行安装脚本。
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/maven-install.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/maven-install.sh | bash
|
||||||
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/maven-install.sh | bash
|
wget -qO- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/maven-install.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
## Node.js 安装
|
## Node.js 安装
|
||||||
|
@ -57,8 +57,8 @@ wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/li
|
||||||
执行以下任意命令即可执行安装脚本。
|
执行以下任意命令即可执行安装脚本。
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/nodejs-install.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/nodejs-install.sh | bash
|
||||||
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/nodejs-install.sh | bash
|
wget -qO- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/nodejs-install.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
## MongoDB 安装
|
## MongoDB 安装
|
||||||
|
@ -72,8 +72,8 @@ wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/li
|
||||||
执行以下任意命令即可执行安装脚本。
|
执行以下任意命令即可执行安装脚本。
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/mongodb-install.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/mongodb-install.sh | bash
|
||||||
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/mongodb-install.sh | bash
|
wget -qO- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/mongodb-install.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
## Redis 安装配置
|
## Redis 安装配置
|
||||||
|
@ -89,15 +89,15 @@ wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/li
|
||||||
执行以下任意命令即可按照默认配置安装脚本。
|
执行以下任意命令即可按照默认配置安装脚本。
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/redis-install.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/redis-install.sh | bash
|
||||||
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/redis-install.sh | bash
|
wget -qO- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/redis-install.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
定制化配置
|
定制化配置
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# 下载脚本到本地
|
# 下载脚本到本地
|
||||||
wget https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/redis-install.sh
|
wget https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/redis-install.sh
|
||||||
chmod +x redis-install.sh
|
chmod +x redis-install.sh
|
||||||
./redis-install.sh 5.0.4 /opt/redis 6379 123456
|
./redis-install.sh 5.0.4 /opt/redis 6379 123456
|
||||||
```
|
```
|
||||||
|
@ -118,8 +118,8 @@ chmod +x redis-install.sh
|
||||||
使用方法:
|
使用方法:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/tomcat8-install.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/tomcat8-install.sh | bash
|
||||||
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/tomcat8-install.sh | bash
|
wget -qO- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/tomcat8-install.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
## Kafka 安装
|
## Kafka 安装
|
||||||
|
@ -131,8 +131,8 @@ wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/li
|
||||||
使用方法:执行以下任意命令即可执行脚本。
|
使用方法:执行以下任意命令即可执行脚本。
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/kafka-install.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/kafka-install.sh | bash
|
||||||
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/kafka-install.sh | bash
|
wget -qO- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/kafka-install.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
## RocketMQ 安装
|
## RocketMQ 安装
|
||||||
|
@ -144,8 +144,8 @@ wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/li
|
||||||
使用方法:执行以下任意命令即可执行脚本。
|
使用方法:执行以下任意命令即可执行脚本。
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/rocketmq-install.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/rocketmq-install.sh | bash
|
||||||
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/rocketmq-install.sh | bash
|
wget -qO- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/rocketmq-install.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
## Nacos 安装
|
## Nacos 安装
|
||||||
|
@ -157,8 +157,8 @@ wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/li
|
||||||
使用方法:执行以下任意命令即可执行脚本。
|
使用方法:执行以下任意命令即可执行脚本。
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/nacos-install.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/nacos-install.sh | bash
|
||||||
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/nacos-install.sh | bash
|
wget -qO- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/nacos-install.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
## ZooKeeper 安装
|
## ZooKeeper 安装
|
||||||
|
@ -170,7 +170,7 @@ wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/li
|
||||||
使用方法:执行以下任意命令即可执行脚本。
|
使用方法:执行以下任意命令即可执行脚本。
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/zookeeper-install.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/zookeeper-install.sh | bash
|
||||||
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/zookeeper-install.sh | bash
|
wget -qO- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/zookeeper-install.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ replaceLogstashConfig() {
|
||||||
sed -i "s/# http.host: \"127.0.0.1\"/ http.host: ${IP}/g" ${ELASTIC_SOFTWARE_PATH}/logstash-${version}/config/logstash.yml
|
sed -i "s/# http.host: \"127.0.0.1\"/ http.host: ${IP}/g" ${ELASTIC_SOFTWARE_PATH}/logstash-${version}/config/logstash.yml
|
||||||
touch ${ELASTIC_SOFTWARE_PATH}/logstash-${version}/bin/nohup.out
|
touch ${ELASTIC_SOFTWARE_PATH}/logstash-${version}/bin/nohup.out
|
||||||
cd ${ELASTIC_SOFTWARE_PATH}/logstash-${version}/bin
|
cd ${ELASTIC_SOFTWARE_PATH}/logstash-${version}/bin
|
||||||
wget "https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/elk/config/logstash.conf"
|
wget "https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/elk/config/logstash.conf"
|
||||||
}
|
}
|
||||||
|
|
||||||
# 替换 Kibana 配置
|
# 替换 Kibana 配置
|
||||||
|
@ -125,6 +125,6 @@ replaceFilebeatConfig
|
||||||
|
|
||||||
# 最后,将启动脚本下载到本地
|
# 最后,将启动脚本下载到本地
|
||||||
mkdir -p /home/zp/script
|
mkdir -p /home/zp/script
|
||||||
wget -P /home/zp/script "https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/elk/boot-elk.sh"
|
wget -P /home/zp/script "https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/elk/boot-elk.sh"
|
||||||
#setPrivilegeForUser
|
#setPrivilegeForUser
|
||||||
|
|
||||||
|
|
|
@ -2,31 +2,31 @@
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# console color
|
# console color
|
||||||
BLACK="\033[1;30m"
|
C_BLACK="\033[1;30m"
|
||||||
RED="\033[1;31m"
|
C_RED="\033[1;31m"
|
||||||
GREEN="\033[1;32m"
|
C_GREEN="\033[1;32m"
|
||||||
YELLOW="\033[1;33m"
|
C_YELLOW="\033[1;33m"
|
||||||
BLUE="\033[1;34m"
|
C_BLUE="\033[1;34m"
|
||||||
PURPLE="\033[1;35m"
|
C_PURPLE="\033[1;35m"
|
||||||
CYAN="\033[1;36m"
|
C_CYAN="\033[1;36m"
|
||||||
RESET="$(tput sgr0)"
|
C_RESET="$(tput sgr0)"
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
printf "${PURPLE}"
|
printf "${C_PURPLE}"
|
||||||
cat << EOF
|
cat << EOF
|
||||||
|
|
||||||
###################################################################################
|
###################################################################################
|
||||||
# 安装 FastDFS 脚本
|
# install FastDFS 脚本
|
||||||
# FastDFS 会被安装到 /opt/fdfs 路径。
|
# FastDFS 会被install到 /opt/fdfs 路径。
|
||||||
# @system: 适用于 CentOS
|
# @system: 适用于 CentOS
|
||||||
# @author: Zhang Peng
|
# @author: Zhang Peng
|
||||||
###################################################################################
|
###################################################################################
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
printf "${RESET}"
|
printf "${C_RESET}"
|
||||||
|
|
||||||
command -v yum >/dev/null 2>&1 || { echo >&2 -e "${RED}Require yum but it's not installed. Aborting.${RESET}"; exit 1; }
|
command -v yum >/dev/null 2>&1 || { echo >&2 -e "${C_RED}Require yum but it's not installed. Aborting.${C_RESET}"; exit 1; }
|
||||||
command -v git >/dev/null 2>&1 || { echo >&2 -e "${RED}Require git but it's not installed. Aborting.${RESET}"; exit 1; }
|
command -v git >/dev/null 2>&1 || { echo >&2 -e "${C_RED}Require git but it's not installed. Aborting.${C_RESET}"; exit 1; }
|
||||||
|
|
||||||
yum install git gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zlib zlib-devel openssl-devel wget vim -y
|
yum install git gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zlib zlib-devel openssl-devel wget vim -y
|
||||||
|
|
||||||
|
@ -46,24 +46,38 @@ if [[ -n $3 ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p ${root}
|
mkdir -p ${root}
|
||||||
|
root=/opt/fdfs
|
||||||
echo -e "\n${GREEN}>>>>>>>>> 安装 libfastcommon${RESET}"
|
echo -e "\n${C_GREEN}>>>>>>>>> install libfastcommon${C_RESET}"
|
||||||
mkdir -p ${root}/libfastcommon
|
mkdir -p ${root}/libfastcommon
|
||||||
git clone https://github.com/happyfish100/libfastcommon.git "${root}/libfastcommon"
|
curl -o ${root}/libfastcommon.zip http://dunwu.test.upcdn.net/soft/fdfs/libfastcommon.zip
|
||||||
|
if [[ ! -f ${root}/libfastcommon.zip ]]; then
|
||||||
|
echo -e "\n${C_RED}>>>>>>>>> install libfastcommon failed,exit. ${C_RESET}"
|
||||||
|
fi
|
||||||
|
unzip -o ${root}/libfastcommon.zip -d ${root}
|
||||||
cd ${root}/libfastcommon
|
cd ${root}/libfastcommon
|
||||||
|
chmod +x -R ${root}/libfastcommon/*.sh
|
||||||
./make.sh && ./make.sh install
|
./make.sh && ./make.sh install
|
||||||
|
|
||||||
echo -e "\n${GREEN}>>>>>>>>> 安装 fastdfs${RESET}"
|
echo -e "\n${C_GREEN}>>>>>>>>> install fastdfs${C_RESET}"
|
||||||
mkdir -p ${root}/fastdfs
|
mkdir -p ${root}/fastdfs
|
||||||
git clone https://github.com/happyfish100/fastdfs.git "${root}/fastdfs"
|
curl -o ${root}/fastdfs.zip http://dunwu.test.upcdn.net/soft/fdfs/fastdfs.zip
|
||||||
|
if [[ ! -f ${root}/fastdfs.zip ]]; then
|
||||||
|
echo -e "\n${C_RED}>>>>>>>>> install fastdfs failed,exit. ${C_RESET}"
|
||||||
|
fi
|
||||||
|
unzip -o ${root}/fastdfs.zip -d ${root}
|
||||||
cd ${root}/fastdfs
|
cd ${root}/fastdfs
|
||||||
|
chmod +x -R ${root}/fastdfs/*.sh
|
||||||
./make.sh && ./make.sh install
|
./make.sh && ./make.sh install
|
||||||
|
|
||||||
echo -e "\n${GREEN}>>>>>>>>> 安装 fastdfs-nginx-module${RESET}"
|
echo -e "\n${C_GREEN}>>>>>>>>> install fastdfs-nginx-module${C_RESET}"
|
||||||
mkdir -p ${root}/fastdfs-nginx-module
|
mkdir -p ${root}/fastdfs-nginx-module
|
||||||
git clone https://github.com/happyfish100/fastdfs-nginx-module.git "${root}/fastdfs-nginx-module"
|
curl -o ${root}/fastdfs-nginx-module.zip http://dunwu.test.upcdn.net/soft/fdfs/fastdfs-nginx-module.zip
|
||||||
|
if [[ ! -f ${root}/fastdfs-nginx-module.zip ]]; then
|
||||||
|
echo -e "\n${C_RED}>>>>>>>>> install fastdfs-nginx-module failed,exit. ${C_RESET}"
|
||||||
|
fi
|
||||||
|
unzip -o ${root}/fastdfs-nginx-module.zip -d ${root}
|
||||||
|
|
||||||
echo -e "\n${GREEN}>>>>>>>>> 安装 nginx${RESET}"
|
echo -e "\n${C_GREEN}>>>>>>>>> install nginx${C_RESET}"
|
||||||
mkdir -p ${nginx_path}
|
mkdir -p ${nginx_path}
|
||||||
wget -O ${nginx_path}/nginx-${version}.tar.gz http://nginx.org/download/nginx-${version}.tar.gz
|
wget -O ${nginx_path}/nginx-${version}.tar.gz http://nginx.org/download/nginx-${version}.tar.gz
|
||||||
tar zxf ${nginx_path}/nginx-${version}.tar.gz -C ${nginx_path}
|
tar zxf ${nginx_path}/nginx-${version}.tar.gz -C ${nginx_path}
|
||||||
|
@ -71,50 +85,54 @@ cd ${nginx_path}/nginx-${version}
|
||||||
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre --add-module=${root}/fastdfs-nginx-module/src/
|
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre --add-module=${root}/fastdfs-nginx-module/src/
|
||||||
make && make install
|
make && make install
|
||||||
|
|
||||||
echo -e "\n${GREEN}>>>>>>>>> fastdfs 配置文件准备${RESET}"
|
echo -e "\n${C_GREEN}>>>>>>>>> fastdfs 配置文件准备${C_RESET}"
|
||||||
# 配置修改参考:https://github.com/happyfish100/fastdfs/wiki
|
# 配置修改参考:https://github.com/happyfish100/fastdfs/wiki
|
||||||
|
|
||||||
cp ${root}/fastdfs/conf/http.conf /etc/fdfs/ #供nginx访问使用
|
cp ${root}/fastdfs/conf/http.conf /etc/fdfs/ #供nginx访问使用
|
||||||
cp ${root}/fastdfs/conf/mime.types /etc/fdfs/ #供nginx访问使用
|
cp ${root}/fastdfs/conf/mime.types /etc/fdfs/ #供nginx访问使用
|
||||||
cp ${root}/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs
|
cp ${root}/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs
|
||||||
wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/config/fastdfs/tracker.conf -O /etc/fdfs/tracker.conf
|
wget -N https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/config/fastdfs/tracker.conf -O /etc/fdfs/tracker.conf
|
||||||
wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/config/fastdfs/storage.conf -O /etc/fdfs/storage.conf
|
wget -N https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/config/fastdfs/storage.conf -O /etc/fdfs/storage.conf
|
||||||
wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/config/fastdfs/client.conf -O /etc/fdfs/client.conf
|
wget -N https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/config/fastdfs/client.conf -O /etc/fdfs/client.conf
|
||||||
# fdfs 存储路径和服务端口(以默认形式配置)
|
# fdfs 存储路径和服务端口(以默认形式配置)
|
||||||
fdfs_store_path=/home/fdfs
|
fdfs_store_path=/home/fdfs
|
||||||
fdfs_server_port=7001
|
fdfs_server_port=7001
|
||||||
ip=$(ip addr | awk '/^[0-9]+: / {}; /inet.*global/ {print gensub(/(.*)\/(.*)/, "\\1", "g", $2)}')
|
ip=$(ip addr | awk '/^[0-9]+: / {}; /inet.*global/ {print gensub(/(.*)\/(.*)/, "\\1", "g", $2)}')
|
||||||
echo -e "\n${GREEN} - 修改 tracker.conf 配置${RESET}"
|
|
||||||
|
mkdir -p ${fdfs_store_path}
|
||||||
|
echo -e "\n${C_GREEN} - 修改 tracker.conf 配置${C_RESET}"
|
||||||
sed -i "s#^base_path=.*#base_path=${fdfs_store_path}#g" /etc/fdfs/tracker.conf
|
sed -i "s#^base_path=.*#base_path=${fdfs_store_path}#g" /etc/fdfs/tracker.conf
|
||||||
echo -e "\n${GREEN} - 修改 storage.conf 配置${RESET}"
|
echo -e "\n${C_GREEN} - 修改 storage.conf 配置${C_RESET}"
|
||||||
sed -i "s#^base_path=.*#base_path=${fdfs_store_path}#g" /etc/fdfs/storage.conf
|
sed -i "s#^base_path=.*#base_path=${fdfs_store_path}#g" /etc/fdfs/storage.conf
|
||||||
sed -i "s#^store_path0=.*#store_path0=${fdfs_store_path}#g" /etc/fdfs/storage.conf
|
sed -i "s#^store_path0=.*#store_path0=${fdfs_store_path}#g" /etc/fdfs/storage.conf
|
||||||
sed -i "s#^tracker_server=.*#tracker_server=${ip}:22122#g" /etc/fdfs/storage.conf
|
sed -i "s#^tracker_server=.*#tracker_server=${ip}:22122#g" /etc/fdfs/storage.conf
|
||||||
sed -i "s#^http.server_port=.*#http.server_port=${fdfs_server_port}#g" /etc/fdfs/storage.conf
|
sed -i "s#^http.server_port=.*#http.server_port=${fdfs_server_port}#g" /etc/fdfs/storage.conf
|
||||||
echo -e "\n${GREEN} - 修改 client.conf 配置${RESET}"
|
echo -e "\n${C_GREEN} - 修改 client.conf 配置${C_RESET}"
|
||||||
sed -i "s#^base_path=.*#base_path=${fdfs_store_path}#g" /etc/fdfs/client.conf
|
sed -i "s#^base_path=.*#base_path=${fdfs_store_path}#g" /etc/fdfs/client.conf
|
||||||
sed -i "s#^tracker_server=.*#tracker_server=${ip}:22122#g" /etc/fdfs/client.conf
|
sed -i "s#^tracker_server=.*#tracker_server=${ip}:22122#g" /etc/fdfs/client.conf
|
||||||
echo -e "\n${GREEN} - 修改 mod_fastdfs.conf 配置${RESET}"
|
echo -e "\n${C_GREEN} - 修改 mod_fastdfs.conf 配置${C_RESET}"
|
||||||
sed -i "s#^url_have_group_name=.*#url_have_group_name=true#g" /etc/fdfs/mod_fastdfs.conf
|
sed -i "s#^url_have_group_name=.*#url_have_group_name=true#g" /etc/fdfs/mod_fastdfs.conf
|
||||||
sed -i "s#^tracker_server=.*#tracker_server=${ip}:22122#g" /etc/fdfs/mod_fastdfs.conf
|
sed -i "s#^tracker_server=.*#tracker_server=${ip}:22122#g" /etc/fdfs/mod_fastdfs.conf
|
||||||
sed -i "s#^store_path0=.*#store_path0=${fdfs_store_path}#g" /etc/fdfs/mod_fastdfs.conf
|
sed -i "s#^store_path0=.*#store_path0=${fdfs_store_path}#g" /etc/fdfs/mod_fastdfs.conf
|
||||||
echo -e "\n${GREEN} - 修改 nginx.conf 配置${RESET}\n"
|
echo -e "\n${C_GREEN} - 修改 nginx.conf 配置${C_RESET}\n"
|
||||||
mkdir -p /usr/local/nginx/conf/conf
|
mkdir -p /usr/local/nginx/conf/conf
|
||||||
wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/config/nginx/nginx.conf -O /usr/local/nginx/conf/nginx.conf
|
wget -N https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/config/nginx/nginx.conf -O /usr/local/nginx/conf/nginx.conf
|
||||||
wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/config/nginx/conf/fdfs.conf -O /usr/local/nginx/conf/conf/fdfs.conf
|
wget -N https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/config/nginx/conf/fdfs.conf -O /usr/local/nginx/conf/conf/fdfs.conf
|
||||||
|
|
||||||
echo -e "\n${GREEN}>>>>>>>>> 启动 fastdfs ${RESET}"
|
echo -e "\n${C_GREEN}>>>>>>>>> 启动 fastdfs ${C_RESET}"
|
||||||
|
chmod +x /etc/init.d/fdfs_trackerd
|
||||||
/etc/init.d/fdfs_trackerd start #启动tracker服务
|
/etc/init.d/fdfs_trackerd start #启动tracker服务
|
||||||
#/etc/init.d/fdfs_trackerd restart #重启动tracker服务
|
#/etc/init.d/fdfs_trackerd restart #重启动tracker服务
|
||||||
#/etc/init.d/fdfs_trackerd stop #停止tracker服务
|
#/etc/init.d/fdfs_trackerd stop #停止tracker服务
|
||||||
chkconfig fdfs_trackerd on #自启动tracker服务
|
chkconfig fdfs_trackerd on #自启动tracker服务
|
||||||
|
|
||||||
|
chmod +x /etc/init.d/fdfs_storaged
|
||||||
/etc/init.d/fdfs_storaged start #启动storage服务
|
/etc/init.d/fdfs_storaged start #启动storage服务
|
||||||
#/etc/init.d/fdfs_storaged restart #重动storage服务
|
#/etc/init.d/fdfs_storaged restart #重动storage服务
|
||||||
#/etc/init.d/fdfs_storaged stop #停止动storage服务
|
#/etc/init.d/fdfs_storaged stop #停止动storage服务
|
||||||
chkconfig fdfs_storaged on #自启动storage服务
|
chkconfig fdfs_storaged on #自启动storage服务
|
||||||
|
|
||||||
wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/config/nginx/nginx.service -O /usr/lib/systemd/system/nginx.service
|
wget -N https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/config/nginx/nginx.service -O /usr/lib/systemd/system/nginx.service
|
||||||
chmod +x /usr/lib/systemd/system/nginx.service
|
chmod +x /usr/lib/systemd/system/nginx.service
|
||||||
#设置nginx.service为系统服务
|
#设置nginx.service为系统服务
|
||||||
systemctl enable nginx.service
|
systemctl enable nginx.service
|
||||||
|
|
|
@ -47,6 +47,6 @@ source /etc/profile
|
||||||
# 备份并替换 settings.xml,使用 aliyun 镜像加速 maven
|
# 备份并替换 settings.xml,使用 aliyun 镜像加速 maven
|
||||||
echo -e "\n>>>>>>>>> replace ${path}/conf/settings.xml"
|
echo -e "\n>>>>>>>>> replace ${path}/conf/settings.xml"
|
||||||
cp ${path}/conf/settings.xml ${path}/conf/settings.xml.bak
|
cp ${path}/conf/settings.xml ${path}/conf/settings.xml.bak
|
||||||
wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/config/settings-aliyun.xml -O ${path}/conf/settings.xml
|
wget -N https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/config/settings-aliyun.xml -O ${path}/conf/settings.xml
|
||||||
|
|
||||||
mvn -v
|
mvn -v
|
||||||
|
|
|
@ -43,7 +43,7 @@ cd ${root}/nginx-${version}
|
||||||
make && make install
|
make && make install
|
||||||
|
|
||||||
# 设置 service
|
# 设置 service
|
||||||
wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/config/nginx/nginx.service -O /usr/lib/systemd/system/nginx.service
|
wget -N https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/config/nginx/nginx.service -O /usr/lib/systemd/system/nginx.service
|
||||||
chmod +x /usr/lib/systemd/system/nginx.service
|
chmod +x /usr/lib/systemd/system/nginx.service
|
||||||
#设置nginx.service为系统服务
|
#设置nginx.service为系统服务
|
||||||
systemctl enable nginx.service
|
systemctl enable nginx.service
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
使用方法:
|
使用方法:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/nginx/install-nginx.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/nginx/install-nginx.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
脚本会下载解压 nginx 到 `/opt/nginx` 路径下。
|
脚本会下载解压 nginx 到 `/opt/nginx` 路径下。
|
||||||
|
@ -15,6 +15,6 @@ curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/lin
|
||||||
使用方法:
|
使用方法:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/nginx/install-nginx-by-yum.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/nginx/install-nginx-by-yum.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ cd -
|
||||||
|
|
||||||
echo -e "\n>>>>>>>>> config redis"
|
echo -e "\n>>>>>>>>> config redis"
|
||||||
cp ${path}/redis.conf ${path}/redis.conf.default
|
cp ${path}/redis.conf ${path}/redis.conf.default
|
||||||
wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/config/redis-remote-access.conf -O ${path}/redis.conf
|
wget -N https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/soft/config/redis-remote-access.conf -O ${path}/redis.conf
|
||||||
cp ${path}/redis.conf /etc/redis/${port}.conf
|
cp ${path}/redis.conf /etc/redis/${port}.conf
|
||||||
sed -i "s/^port 6379/port ${port}/g" /etc/redis/${port}.conf
|
sed -i "s/^port 6379/port ${port}/g" /etc/redis/${port}.conf
|
||||||
sed -i "s/^requirepass 123456/requirepass ${password}/g" /etc/redis/${port}.conf
|
sed -i "s/^requirepass 123456/requirepass ${password}/g" /etc/redis/${port}.conf
|
||||||
|
|
|
@ -20,8 +20,8 @@
|
||||||
使用方法:执行以下任意命令即可执行脚本。
|
使用方法:执行以下任意命令即可执行脚本。
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/yum/change-yum-repo.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/yum/change-yum-repo.sh | bash
|
||||||
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/yum/change-yum-repo.sh | bash
|
wget -qO- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/yum/change-yum-repo.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
## 安装基本工具(可选)
|
## 安装基本工具(可选)
|
||||||
|
@ -45,8 +45,8 @@ wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/li
|
||||||
使用方法:执行以下任意命令即可执行脚本。
|
使用方法:执行以下任意命令即可执行脚本。
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/install-tools.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/install-tools.sh | bash
|
||||||
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/install-tools.sh | bash
|
wget -qO- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/install-tools.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
## 安装常见 lib
|
## 安装常见 lib
|
||||||
|
@ -63,8 +63,8 @@ lib 清单(可以根据需要,在 install-libs.sh 中把不需要的工具
|
||||||
使用方法:执行以下任意命令即可执行脚本。
|
使用方法:执行以下任意命令即可执行脚本。
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/install-libs.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/install-libs.sh | bash
|
||||||
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/install-libs.sh | bash
|
wget -qO- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/install-libs.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
## 关闭防火墙
|
## 关闭防火墙
|
||||||
|
@ -72,8 +72,8 @@ wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/li
|
||||||
使用方法:执行以下任意命令即可执行脚本。
|
使用方法:执行以下任意命令即可执行脚本。
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/stop-firewall.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/stop-firewall.sh | bash
|
||||||
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/stop-firewall.sh | bash
|
wget -qO- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/stop-firewall.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
## 设置 DNS
|
## 设置 DNS
|
||||||
|
@ -81,8 +81,8 @@ wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/li
|
||||||
使用方法:执行以下任意命令即可执行脚本。
|
使用方法:执行以下任意命令即可执行脚本。
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/set-dns.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/set-dns.sh | bash
|
||||||
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/set-dns.sh | bash
|
wget -qO- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/set-dns.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
## 设置 ntp
|
## 设置 ntp
|
||||||
|
@ -90,6 +90,6 @@ wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/li
|
||||||
使用方法:执行以下任意命令即可执行脚本。
|
使用方法:执行以下任意命令即可执行脚本。
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/set-ntp.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/set-ntp.sh | bash
|
||||||
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/set-ntp.sh | bash
|
wget -qO- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/set-ntp.sh | bash
|
||||||
```
|
```
|
||||||
|
|
|
@ -23,7 +23,7 @@ cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
|
||||||
# 根据发型版本选择相应 yum 镜像
|
# 根据发型版本选择相应 yum 镜像
|
||||||
if [[ ${version} == 5 ]]; then
|
if [[ ${version} == 5 ]]; then
|
||||||
# Cento5 已废弃,只能使用 http://vault.CentOS.org/ 替换,但由于是国外镜像,速度较慢
|
# Cento5 已废弃,只能使用 http://vault.CentOS.org/ 替换,但由于是国外镜像,速度较慢
|
||||||
wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/yum/Centos-5.repo -O /etc/yum.repos.d/CentOS-Base.repo
|
wget -N https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/yum/Centos-5.repo -O /etc/yum.repos.d/CentOS-Base.repo
|
||||||
|
|
||||||
# 根据实际发型版本情况替换
|
# 根据实际发型版本情况替换
|
||||||
detailVersion=`lsb_release -r | awk '{print substr($2,1,3)}'`
|
detailVersion=`lsb_release -r | awk '{print substr($2,1,3)}'`
|
||||||
|
@ -32,9 +32,9 @@ if [[ ${version} == 5 ]]; then
|
||||||
# 不替换下面的开关,可能会出现错误:Could not open/read repomd.xml
|
# 不替换下面的开关,可能会出现错误:Could not open/read repomd.xml
|
||||||
sed -i 's/enabled=1/enabled=0/g' /etc/yum.repos.d/CentOS-Media.repo
|
sed -i 's/enabled=1/enabled=0/g' /etc/yum.repos.d/CentOS-Media.repo
|
||||||
elif [[ ${version} == 6 ]]; then
|
elif [[ ${version} == 6 ]]; then
|
||||||
wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/yum/Centos-6.repo -O /etc/yum.repos.d/CentOS-Base.repo
|
wget -N https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/yum/Centos-6.repo -O /etc/yum.repos.d/CentOS-Base.repo
|
||||||
elif [[ ${version} == 7 ]]; then
|
elif [[ ${version} == 7 ]]; then
|
||||||
wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/yum/Centos-7.repo -O /etc/yum.repos.d/CentOS-Base.repo
|
wget -N https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/yum/Centos-7.repo -O /etc/yum.repos.d/CentOS-Base.repo
|
||||||
else
|
else
|
||||||
echo -e "版本不支持,替换 yum repo 失败"
|
echo -e "版本不支持,替换 yum repo 失败"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -96,13 +96,13 @@ do
|
||||||
|
|
||||||
case ${ITEM} in
|
case ${ITEM} in
|
||||||
"设置 DNS")
|
"设置 DNS")
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/set-dns.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/set-dns.sh | bash
|
||||||
;;
|
;;
|
||||||
"设置 NTP")
|
"设置 NTP")
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/set-ntp.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/set-ntp.sh | bash
|
||||||
;;
|
;;
|
||||||
"关闭防火墙")
|
"关闭防火墙")
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/stop-firewall.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/stop-firewall.sh | bash
|
||||||
;;
|
;;
|
||||||
"配置 IPv4")
|
"配置 IPv4")
|
||||||
configIpv4
|
configIpv4
|
||||||
|
@ -111,9 +111,9 @@ case ${ITEM} in
|
||||||
closeIpv6
|
closeIpv6
|
||||||
;;
|
;;
|
||||||
"全部执行")
|
"全部执行")
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/set-dns.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/set-dns.sh | bash
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/set-ntp.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/set-ntp.sh | bash
|
||||||
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/stop-firewall.sh | bash
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/stop-firewall.sh | bash
|
||||||
configIpv4
|
configIpv4
|
||||||
closeIpv6
|
closeIpv6
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -1,18 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
cat << EOF
|
##############################################################################
|
||||||
###################################################################################
|
# console color
|
||||||
# 系统信息检查脚本
|
|
||||||
# @author: Zhang Peng
|
|
||||||
###################################################################################
|
|
||||||
EOF
|
|
||||||
|
|
||||||
[[ $(id -u) -gt 0 ]] && echo "请用root用户执行此脚本!" && exit 1
|
|
||||||
sysversion=$(rpm -q centos-release|cut -d- -f3)
|
|
||||||
double_line="==============================================================="
|
|
||||||
line="----------------------------------------------"
|
|
||||||
|
|
||||||
# 定义字体色彩
|
|
||||||
C_RESET="$(tput sgr0)"
|
C_RESET="$(tput sgr0)"
|
||||||
C_BLACK="\033[1;30m"
|
C_BLACK="\033[1;30m"
|
||||||
C_RED="\033[1;31m"
|
C_RED="\033[1;31m"
|
||||||
|
@ -22,6 +11,23 @@ C_BLUE="\033[1;34m"
|
||||||
C_PURPLE="\033[1;35m"
|
C_PURPLE="\033[1;35m"
|
||||||
C_CYAN="\033[1;36m"
|
C_CYAN="\033[1;36m"
|
||||||
C_WHITE="\033[1;37m"
|
C_WHITE="\033[1;37m"
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
printf "${C_PURPLE}"
|
||||||
|
cat << EOF
|
||||||
|
|
||||||
|
###################################################################################
|
||||||
|
# 系统信息检查脚本
|
||||||
|
# @author: Zhang Peng
|
||||||
|
###################################################################################
|
||||||
|
|
||||||
|
EOF
|
||||||
|
printf "${C_RESET}"
|
||||||
|
|
||||||
|
[[ $(id -u) -gt 0 ]] && echo "请用root用户执行此脚本!" && exit 1
|
||||||
|
sysversion=$(rpm -q centos-release|cut -d- -f3)
|
||||||
|
double_line="==============================================================="
|
||||||
|
line="----------------------------------------------"
|
||||||
|
|
||||||
# 打印头部信息
|
# 打印头部信息
|
||||||
printHeadInfo() {
|
printHeadInfo() {
|
||||||
|
@ -161,7 +167,7 @@ EOF
|
||||||
|
|
||||||
# 获取系统网络信息
|
# 获取系统网络信息
|
||||||
get_net_info() {
|
get_net_info() {
|
||||||
pri_ipadd=$(ip a show dev eth0|grep -w inet|awk '{print $2}'|awk -F '/' '{print $1}')
|
pri_ipadd=$(ip addr | awk '/^[0-9]+: / {}; /inet.*global/ {print gensub(/(.*)\/(.*)/, "\\1", "g", $2)}')
|
||||||
pub_ipadd=$(curl ifconfig.me -s)
|
pub_ipadd=$(curl ifconfig.me -s)
|
||||||
gateway=$(ip route | grep default | awk '{print $3}')
|
gateway=$(ip route | grep default | awk '{print $3}')
|
||||||
mac_info=$(ip link| egrep -v "lo"|grep link|awk '{print $2}')
|
mac_info=$(ip link| egrep -v "lo"|grep link|awk '{print $2}')
|
|
@ -0,0 +1,48 @@
|
||||||
|
# FastDFS
|
||||||
|
|
||||||
|
## 简介
|
||||||
|
|
||||||
|
FastDFS 是一个开源的轻量级分布式文件系统,它对文件进行管理,功能包括:文件存储、文件同步、文件访问(文件上传、文件下载)等,解决了大容量存储和负载均衡的问题。特别适合以文件为载体的在线服务,如相册网站、视频网站等等。
|
||||||
|
FastDFS 为互联网量身定制,充分考虑了冗余备份、负载均衡、线性扩容等机制,并注重高可用、高性能等指标,使用 FastDFS 很容易搭建一套高性能的文件服务器集群提供文件上传、下载等服务。
|
||||||
|
|
||||||
|
## 概念
|
||||||
|
|
||||||
|
FastDFS 服务端有三个角色:跟踪服务器(tracker server)、存储服务器(storage server)和客户端(client)。
|
||||||
|
|
||||||
|
**tracker server**:跟踪服务器,主要做调度工作,起负载均衡的作用。在内存中记录集群中所有存储组和存储服务器的状态信息,是客户端和数据服务器交互的枢纽。相比 GFS 中的 master 更为精简,不记录文件索引信息,占用的内存量很少。
|
||||||
|
|
||||||
|
Tracker 是 FastDFS 的协调者,负责管理所有的 storage server 和 group,每个 storage 在启动后会连接 Tracker,告知自己所属的 group 等信息,并保持周期性的心跳,tracker 根据 storage 的心跳信息,建立 group==>[storage server list]的映射表。
|
||||||
|
|
||||||
|
Tracker 需要管理的元信息很少,会全部存储在内存中;另外 tracker 上的元信息都是由 storage 汇报的信息生成的,本身不需要持久化任何数据,这样使得 tracker 非常容易扩展,直接增加 tracker 机器即可扩展为 tracker cluster 来服务,cluster 里每个 tracker 之间是完全对等的,所有的 tracker 都接受 stroage 的心跳信息,生成元数据信息来提供读写服务。
|
||||||
|
|
||||||
|
**storage server**:存储服务器(又称:存储节点或数据服务器),文件和文件属性(meta data)都保存到存储服务器上。Storage server 直接利用 OS 的文件系统调用管理文件。
|
||||||
|
|
||||||
|
Storage server(后简称 storage)以组(卷,group 或 volume)为单位组织,一个 group 内包含多台 storage 机器,数据互为备份,存储空间以 group 内容量最小的 storage 为准,所以建议 group 内的多个 storage 尽量配置相同,以免造成存储空间的浪费。
|
||||||
|
|
||||||
|
以 group 为单位组织存储能方便的进行应用隔离、负载均衡、副本数定制(group 内 storage server 数量即为该 group 的副本数),比如将不同应用数据存到不同的 group 就能隔离应用数据,同时还可根据应用的访问特性来将应用分配到不同的 group 来做负载均衡;缺点是 group 的容量受单机存储容量的限制,同时当 group 内有机器坏掉时,数据恢复只能依赖 group 内地其他机器,使得恢复时间会很长。
|
||||||
|
|
||||||
|
group 内每个 storage 的存储依赖于本地文件系统,storage 可配置多个数据存储目录,比如有 10 块磁盘,分别挂载在`/data/disk1-/data/disk10`,则可将这 10 个目录都配置为 storage 的数据存储目录。
|
||||||
|
|
||||||
|
storage 接受到写文件请求时,会根据配置好的规则(后面会介绍),选择其中一个存储目录来存储文件。为了避免单个目录下的文件数太多,在 storage 第一次启动时,会在每个数据存储目录里创建 2 级子目录,每级 256 个,总共 65536 个文件,新写的文件会以 hash 的方式被路由到其中某个子目录下,然后将文件数据直接作为一个本地文件存储到该目录中。
|
||||||
|
|
||||||
|
**client**:客户端,作为业务请求的发起方,通过专有接口,使用 TCP/IP 协议与跟踪器服务器或存储节点进行数据交互。FastDFS 向使用者提供基本文件访问接口,比如 upload、download、append、delete 等,以客户端库的方式提供给用户使用。
|
||||||
|
|
||||||
|
另外两个概念:
|
||||||
|
|
||||||
|
**group** :组, 也可称为卷。 同组内服务器上的文件是完全相同的 ,同一组内的 storage server 之间是对等的, 文件上传、 删除等操作可以在任意一台 storage server 上进行 。
|
||||||
|
|
||||||
|
**meta data** :文件相关属性,键值对( Key Value Pair) 方式,如:width=1024,heigth=768 。
|
||||||
|
|
||||||
|
![](http://www.ityouknow.com/assets/images/2018/fastdfs/fastdfs_arch.png)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Tracker 相当于 FastDFS 的大脑,不论是上传还是下载都是通过 tracker 来分配资源;客户端一般可以使用 ngnix 等静态服务器来调用或者做一部分的缓存;存储服务器内部分为卷(或者叫做组),卷于卷之间是平行的关系,可以根据资源的使用情况随时增加,卷内服务器文件相互同步备份,以达到容灾的目的。
|
||||||
|
|
||||||
|
## 参考资料
|
||||||
|
|
||||||
|
- [FastDFS 官方 Github](https://github.com/happyfish100/fastdfs)
|
||||||
|
- [FastDFS 官方 wiki](https://github.com/happyfish100/fastdfs/wiki)
|
||||||
|
- [分布式文件系统 FastDFS 详解](https://www.cnblogs.com/ityouknow/p/8240976.html)
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
git push origin master
|
||||||
|
git push second master
|
Loading…
Reference in New Issue