私有化部署-自动化安装FastDFS应用

上传文件

所有需要的软件已经整理成了一个包。把包上传到每台机上的/usr/local/src/目录下

1
2
3
4
5
6
7
8
9
10
11
12
13
[root@localhost ~]# cd /usr/local/src/
[root@localhost src]# ls
FastDFS-install.tar.gz
[root@localhost src]# tar -zxvf FastDFS-install.tar.gz
./FastDFS/
./FastDFS/ngx_cache_purge-2.3.tar.gz
./FastDFS/installFastDFS.sh
./FastDFS/fastdfs-nginx-module_v1.16.tar.gz
./FastDFS/FastDFS_v5.05.tar.gz
./FastDFS/nginx-1.6.2.tar.gz
./FastDFS/libfastcommon-master.zip
[root@localhost src]# ls
FastDFS FastDFS-install.tar.gz

选择需要安装的服务

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
[root@localhost src]# cd FastDFS/
[root@localhost FastDFS]# ls
fastdfs-nginx-module_v1.16.tar.gz installFastDFS.sh nginx-1.6.2.tar.gz
FastDFS_v5.05.tar.gz libfastcommon-master.zip ngx_cache_purge-2.3.tar.gz
[root@localhost FastDFS]# sh installFastDFS.sh
***
Reminder:
Install only tracker [ Y/N ]:n
Install only storage [ Y/N ]:n
Install tracker and storage [ Y/N ]:y
***
Several groups are defined for this service
[ 1 ro 2 ... ]:2

***
Which group is the local service
[ 1 ro 2 ... ]:2

***
Enter the IP of all trackers
Format
[Tracker_ip]:ip1;ip2;ip3;ipn
[Tracker_ip]:192.168.1.92;192.168.1.93;192.168.1.94;192.168.1.95
1560222451437

启动服务

1
2
3
4
5
6
7
8
9
[root@localhost src]# /etc/init.d/fdfs_trackerd start
Starting fdfs_trackerd (via systemctl): [ 确定 ]
[root@localhost src]# /etc/init.d/fdfs_storaged start
Starting fdfs_storaged (via systemctl): [ 确定 ]
[root@localhost src]# ln -s /home/fastdfs/storage/data/ /home/fastdfs/storage/data/M00
[root@localhost src]# ll /home/fastdfs/storage/data/M00
lrwxrwxrwx 1 root root 27 5月 13 17:17 /home/fastdfs/storage/data/M00 -> /home/fastdfs/storage/data/
[root@localhost src]# /usr/local/nginx/sbin/nginx
ngx_http_fastdfs_set pid=9017
注意:建议优先启动每台的tracker服务,在启动每台的storage服务。这样不会出现在启动storage的时候出现服务无法监听23000端口的情况

上传文件测试

1
/usr/bin/fdfs_upload_file  /etc/fdfs/client.conf /usr/local/src/FastDFS_v5.05.tar.gz

浏览器访问

1
http://storage-ip:888/上传测试文件返回的值

​ 后记:如果服务器不可以正常启动或者不可以正常使用请回到之前《私有化部署-安装FastDFS应用》这篇文章查看你的配置文件否正确。

软件下载地址放在本文的下方的评论区
-------------本文结束感谢您的阅读-------------
0%