diff --git a/centos-fastdfs/README.md b/centos-fastdfs/README.md index 78c4517..7032216 100644 --- a/centos-fastdfs/README.md +++ b/centos-fastdfs/README.md @@ -33,6 +33,7 @@ nginx_port="80" #Nginx端口号,根据实际情况修改 ### 执行一键安装脚本 ```sh +chmod +x centos-fasdfs-install.sh sh centos-fasdfs-install.sh ``` diff --git a/centos-fastdfs/centos-fasdfs-install.sh b/centos-fastdfs/centos-fasdfs-install.sh index aff47c1..d2f7f04 100644 --- a/centos-fastdfs/centos-fasdfs-install.sh +++ b/centos-fastdfs/centos-fasdfs-install.sh @@ -7,7 +7,6 @@ NC='\033[0m' #准备工作 #在生产环境中,建议不要关闭防火墙,根据实际需要开启端口即可 -#使用ifconfig查看本机ip地址 #自定义变量(注!!!执行脚本前需要进行修改) #安装包目录soft_path,即执行脚本的当前目录 @@ -20,12 +19,8 @@ fn_nginx="nginx-1.20.1.tar.gz" #定义配置参数 -# 自定义 ip +# 公网ip ip="43.135.68.128" #服务器的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端口号,根据实际情况修改 @@ -35,7 +30,6 @@ bp_fastdfs="/home/fastdfs" #base_path目录,fastdfs存放数据和日志的 bp_tracker=${bp_fastdfs}"/tracker" #tracker目录,一般不用修改 bp_storage=${bp_fastdfs}"/storage" #storage目录,一般不用修改 bp_client=${bp_fastdfs}"/client" #client目录,一般不用修改 -bp_storage0=${bp_fastdfs}"/storage0" #storage_path目录,即文件存储目录,一般不用修改 #以上部分需要根据实际情况修改 echo -e "${GREENCOLOR}下面开始安装.......${NC}" @@ -44,7 +38,6 @@ echo -e "${GREENCOLOR}创建目录${NC}" mkdir -p ${bp_tracker} mkdir -p ${bp_storage} mkdir -p ${bp_client} -mkdir -p ${bp_storage0} echo -e "${GREENCOLOR}解压缩安装包${NC}" cd ${soft_path} @@ -135,7 +128,7 @@ sed -i "s#port=23000#port=${storage_port}#g" mod_fastdfs.conf #url中是否包含group名称 sed -i "s#url_have_group_name = false#url_have_group_name = true#g" mod_fastdfs.conf #第一个文件存储目录 -sed -i "s#store_path0=/home/yuqing/fastdfs#store_path0=${bp_storage0}#g" mod_fastdfs.conf +sed -i "s#store_path0=/home/yuqing/fastdfs#store_path0=${bp_storage}#g" mod_fastdfs.conf #创建软连接:在/home/fastdfs/storage/文件存储目录下创建软连接,将其链接到实际存放数据的目录 #暂时没什么作用