linux下FastDFS搭建圖片服務(wù)器
目錄
- 服務(wù)器規(guī)劃
- 一、安裝系統(tǒng)組件
- 二、安裝fastdfs
- 三、配置圖片服務(wù)器文件
- 總結(jié)
服務(wù)器規(guī)劃
一、安裝系統(tǒng)組件
yum install gcc -y
二、安裝fastdfs
1、創(chuàng)建圖片服務(wù)器存儲(chǔ)目錄
mkdir -p /data/image
2、下載FastDFS依賴包libfastcommon并安裝
wget https://codeload.github.com/happyfish100/libfastcommon/zip/master
解壓
unzip master
安裝
cd libfastcommon-master/ && ./make.sh && ./make.sh install
3、下載并安裝FastDFS
解壓:
tar xf FastDFS_v5.08.tar.gz
安裝
cd FastDFS && ./make.sh && ./make.sh install
三、配置圖片服務(wù)器文件
1、配置跟蹤服務(wù)器tracker
cp /etc/fdfs/tracker.conf.sample /etc/fdfs/tracker.conf
vim /etc/fdfs/tracker.conf 修改base_path為上面創(chuàng)建的服務(wù)目錄
?2、配置client.conf
cp /etc/fdfs/client.conf.sample /etc/fdfs/client.conf
vim /etc/fdfs/client.conf?修改base_path為上面創(chuàng)建的服務(wù)目錄,tracker_server服務(wù)IP為本機(jī)
?3、測試啟動(dòng)tracker server
啟動(dòng)成功會(huì)自動(dòng)在/data/file/fastdfs/tracker目錄新建data和logs目錄
/etc/init.d/fdfs_trackerd start
/etc/init.d/fdfs_trackerd stop
4、配置存儲(chǔ)服務(wù)器(storage server)
cp /etc/fdfs/storage.conf.sample /etc/fdfs/storage.conf
vim /etc/fdfs/storage.conf?修改base_path為上面創(chuàng)建的服務(wù)目錄,tracker_server服務(wù)IP為本機(jī),base_path為上面創(chuàng)建的服務(wù)目錄
?
5、啟動(dòng)tracker server
/etc/init.d/fdfs_storaged start
/etc/init.d/fdfs_storaged stop
?查看端口
?6、文件上傳測試
/usr/bin/fdfs_upload_file /etc/fdfs/client.conf /root/docker.jpg
?
總結(jié)
到此這篇關(guān)于linux下FastDFS搭建圖片服務(wù)器的文章就介紹到這了,更多相關(guān)linux FastDFS內(nèi)容請(qǐng)搜索以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持!
