部署fastdfs文件服务器(鲲鹏服务器)

yum install -y gcc gcc-c++
yum -y install libevent
cd /usr/local/src
         wget http://github.com/happyfish100/libfastcommon/archive/V1.0.38.tar.gz
         tar -zxvf V1.0.38.tar.gz
         cd libfastcommon-1.0.38/
         ./make.sh
         ./make.sh install
        
1.1.1            #安装FastDFS
         cd /usr/local/src
         wget https://github.com/happyfish100/fastdfs/archive/V5.11.tar.gz
         tar -zxvf V5.11.tar.gz
         cd fastdfs-5.11/
         ./make.sh
         ./make.sh install
        
         #将配置文件复制到系统为fdfs预设的目录。
         cd ./conf
         cp mime.types http.conf /etc/fdfs/
        
         #查看安装FastDFS过程中产生的可执行文件。
         ls -la /usr/bin/fdfs*
         #显示类似如下内容表示安装成功。
         -rwxr-xr-x 1 root root 381896 Jul 9 14:45 /usr/bin/fdfs_appender_test
         -rwxr-xr-x 1 root root 381680 Jul 9 14:45 /usr/bin/fdfs_appender_test1
        
         #配置FastDFS
         #分别对tracker storage client进行配置。
1.1.1.1       #1. 创建目录。
         mkdir /opt/data1/fastdfs/tracker -p
         mkdir /opt/data1/fastdfs/storage -p
         cd /etc/fdfs/
1.1.1.2       #2. 配置tracker
         cp tracker.conf.sample tracker.conf
         vi tracker.conf
         #将内容修改为“ base_path=/home/fastdfs/tracker”和“ thread_stack_size =128KB”,如下面加粗部分所示:
         # the base path to store data and log files
         base_path=/opt/data1/fastdfs/tracker
         #……
         # thread stack size, should >= 64KB
         # default value is 64KB
         thread_stack_size = 128KB
        
1.1.1.3       #3. 启动tracker
         /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf start
        
1.1.1.4       #4. 配置storage
         cd /etc/fdfs/
         cp storage.conf.sample storage.conf
         vi storage.conf
         #将内容修改为“ base_path=/opt/data1/fastdfs/storage”、“ store_path0=/opt/data1/fastdfs/storage”和“ tracker_server=127.0.0.1:22122”。
        
1.1.1.5       #5. 启动storage
         /usr/bin/fdfs_storaged /etc/fdfs/storage.conf start
        
1.1.1.6       #6. 查看storage启动日志。
         vi /opt/data1/fastdfs/storage/logs/storaged.log
         #查看最后几行,显示类似如下所示,表示启动成功。
         [2019-07-09 17:03:51] INFO – fÞǿ tracker_client_thread.c, line: 310, successfully connect to tracker
         server 192.168.1.206:2
         2122, as a tracker client, my ip is 192.168.1.206
         [2019-07-09 17:04:21] INFO – fÞǿ tracker_client_thread.c, line: 1263, tracker server
         192.168.1.206:22122, set tracker leader: 192.168.1.206:22122
        
1.1.1.7       #7. 配置client
         cd /etc/fdfs/
         cp client.conf.sample client.conf
         vi client.conf
         将内容修改为“ base_path=/opt/data1/fastdfs/tracker”和
         “ tracker_server=14.0.0.63:22122
参考: