FastDFS 快速安装脚本

This commit is contained in:
2022-03-11 15:51:13 +08:00
parent a009cfa91c
commit ff5ed2c354
4 changed files with 449 additions and 0 deletions

44
centos-fastdfs/README.md Normal file
View File

@@ -0,0 +1,44 @@
## FastDFS 快速配置安装
### 依赖包
```sh
# 下载依赖包
wget http://1453788.d.cturls.net/down/1453788/fastdfs/FastDFS.tar.gz -O FastDFS.tar.gz
# 解压依赖包
tar -zxvf FastDFS.tar.gz
# 进入文件夹
cd FastDFS
```
### 脚本参数修改
根据自己的需求修改shell脚本中的定义的 `端口``ip``安装目录`等内容,除了`ip地址`外,其他都可以使用默认。
```sh
#定义配置参数
# 自定义 ip
ip="172.19.0.14" #服务器的IP根据实际情况修改
# 命令行获取当前的 ip
# ip = `ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"`
tracker_port="22122" #跟踪服务器端口号,一般使用默认,不用修改
storage_port="23000" #存储服务器端口号,一般使用默认,不用修改
nginx_port="80" #Nginx端口号根据实际情况修改
````
### 执行一键安装脚本
```sh
sh fastDFS_nginx_exec.sh
```
### 测试文件上传及访问
```sh
fdfs_upload_file /etc/fdfs/client.conf /tmp/a.txt
```
返回FID表示成功 如group1/M00/00/00/xx.txt