1、解包
[bdc@svr001 setup]$ tar -xvf libfastcommon-1.0.36.tar.gz
[bdc@svr001 setup]$ cd libfastcommon-1.0.36
2、
[bdc@svr001 zzw_temp]$ export DESTDIR=/opt/aspire/product/bdc/fastdfs/libfastcommon #设置安装路径变量
[bdc@svr001 zzw_temp]$ echo $DESTDIR
/opt/aspire/product/bdc/fastdfs/libfastcommon
[bdc@svr001 setup]$ cd setup/libfastcommon-1.0.36 #进入解开后的tar包目录
[bdc@svr001 libfastcommon-1.0.36]$ ./make.sh
[bdc@svr001 libfastcommon-1.0.36]$ ./make.sh install
[bdc@svr001 libfastcommon-1.0.36]$ cd /opt/aspire/product/bdc/zzw_temp/libfastcommon
[bdc@svr001 libfastcommon]$ ll
总用量 4
drwxrwxr-x 5 bdc bdc 4096 11月 7 18:09 usr
安装成功!
4、 环境变量中加上库路径
export LD_LIBRARY_PATH=/opt/aspire/product/dicmp_zzw/zzw_temp/fastddd/libfastcommon/usr/lib64:$LD_LIBRARY_PATH
注意使环境变量生效。
也可以将libfastcommon.so复制到/usr/lib下: cp /opt/aspire/product/dicmp_zzw/zzw_temp/fastddd/libfastcommon/usr/lib64/libfastcommon.so /usr/lib
5、安装fastdfs-5.11.tar.gz 同样的道理
[bdc@svr001 zzw_temp]$ export DESTDIR=/opt/aspire/product/dicmp_zzw/zzw_temp/fastddd/fastdfsaaa # /opt/aspire/product/dicmp_zzw/zzw_temp/fastddd/fastdfsaaa 为安装目录
[bdc@svr001 ]$ ./make.sh
[bdc@svr001 ]$ ./make.sh install
二、安装后后目录结构
安装后的目录只用etc与usr两个文件夹。
三、配置
1、修改/opt/aspire/product/dicmp_zzw/zzw_temp/fastddd/fastdfsaaa/etc/init.d/fdfs_storaged 和 fdfs_trackerd 两个文件
# Source function library.
if [ -f /etc/init.d/functions ]; then
. /etc/init.d/functions
fi
DESTDIR=/opt/aspire/product/dicmp_zzw/zzw_temp/fastddd/fastdfsaaa #配置为安装路径
PRG=$DESTDIR/usr/bin/fdfs_storaged #加上变量
CONF=$DESTDIR/etc/fdfs/storage.conf #加上变量
四、修改配置文件
1.
修改tracker配置
# mkdir ~/fasdfs/date/Tracker -p
# cd ~/fasdfs #次路径为上面设置的安装路径
# cp etc/fdfs/tracker.conf.sample etc/fdfs/tracker.conf
# vi etc/fdfs/tracker.conf
修改配置参数如下:
base_path=~/fastdfs/date/Tracker
http.server_port=9090
启动服务
~/fastdfs/usr/bin/fdfs_trackerd ~/fastdfs/etc/fdfs/tracker.conf
2.
修改client配置
# mkdir ~/fastdfs/data/Client –p
# cp etc/fdfs/client.conf.sample etc/fdfs/client.conf
# vi /etc/fdfs/ client.conf
修改配置参数如下:
base_path=~/fastdfs/data/fdfs/Client#这块配置绝对路径请根据自己环境替换
tracker_server=10.1.4.52:22122
3.
修改Storage配置
# mkdir ~/fastdfs/data/fdfs/Storage –p
# cp etc/fdfs/storage.conf.sample etc/fdfs/
storage.conf
# vi etc/fdfs/ storage.conf
修改配置参数如下:
base_path=~/fastdfs/data/fdfs/Storage
tracker_server=10.1.4.52:22122
store_path0=~/fastdfs/data/fdfs/Storage
启动
~/fastdfs/usr/bin/fdfs_storaged ~/fastdfs/etc/fdfs/storage.conf
五、启动
1.设置开机启动
vim /etc/rc.local
/opt/aspire/product/dicmp_zzw/zzw_temp/fastddd/fastdfsaaa/usr/bin/fdfs_trackerd /opt/aspire/product/dicmp_zzw/zzw_temp/fastddd/fastdfsaaa/etc/fdfs/tracker.conf
3.启动storage
设置开机启动
vim /etc/rc.local
/opt/aspire/product/dicmp_zzw/zzw_temp/fastddd/fastdfsaaa/usr/bin/fdfs_storaged /opt/aspire/product/dicmp_zzw/zzw_temp/fastddd/fastdfsaaa/etc/fdfs/storage.conf
六、状态检查
# ~/fastdfs/usr/bin/fdfs_monitor ~/fastdfs/etc/fdfs/client.conf
七、测试一下
#cd #返回家目录
# vi test.txt
内容为hello fastdfs 保存
# ~/fastdfs/usr/bin/fdfs_test ~/fastdfs/etc/fdfs/client.conf upload /opt/aspire/product/dicmp_zzw/test.txt
完毕