prologue
According to reason, follow the official steps to install FastDFS
, originally just a few commands, it should be very smooth.
- Compiler Environment
yum install git gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zlib zlib-devel openssl-devel wget vim -y
- installation
libfatscommon
git clone https://github.com/happyfish100/libfastcommon.git --depth 1 cd libfastcommon/ ./make.sh && ./make.sh install #编译安装
- installation
FastDFS
cd ../ #返回上一级目录 git clone https://github.com/happyfish100/fastdfs.git --depth 1 cd fastdfs/ ./make.sh && ./make.sh install #编译安装
By the way, the Linux distribution of this server is Ubuntu
, the official one CentOS 7.x
, well, I have to do it myself.
Fortunately, I Docker
found that some big guys have already FastDFS
packaged it into a mirror image and uploaded it. Then it will be easier to set up. Of course, the premise is still Docker
better.
If you don't need
Docker
it, you can install various compilation environments yourself. Although it is a bit more troublesome, it will be more flexible and convenient to configure. This method can refer to the following article, I am lazy, so I used it directlyDocker
.[2] Installation of FastDFS under Ubuntu
[3] fastDFS
Install FastDFS
1. The first step is to install docker
#安装docker
yum install -y docker-io
#启动docker
service docker star
# 查看docker版本
docker -v
2. Pull the image
#拉取镜像
docker pull qbanxiaoli/fastdfs
This step will take a long time, because it takes a certain amount of time to pull the image and load it, and it is related to the configuration and environment of the machine.
3. Start fastdfs
#启动镜像
docker run -d --restart=always --privileged=true --net=host --name=fastdfs -e IP=192.168.127.131 -e WEB_PORT=80 -v ${HOME}/fastdfs:/var/local/fdfs qbanxiaoli/fastdfs
-
IP
: Behind is your server's public network ip or virtual machine ip -
-e WEB_PORT=80
: Specify the nginx port
4. Test whether fastdfs is successfully built
docker exec -it fastdfs /bin/bash
echo "Hello FastDFS!">index.html
fdfs_test /etc/fdfs/client.conf upload index.html