array(2) { ["docs"]=> array(10) { [0]=> array(10) { ["id"]=> string(3) "428" ["text"]=> string(77) "Visual Studio 2017 单独启动MSDN帮助(Microsoft Help Viewer)的方法" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(8) "DonetRen" ["tagsname"]=> string(55) "Visual Studio 2017|MSDN帮助|C#程序|.NET|Help Viewer" ["tagsid"]=> string(23) "[401,402,403,"300",404]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511400964" ["_id"]=> string(3) "428" } [1]=> array(10) { ["id"]=> string(3) "427" ["text"]=> string(42) "npm -v;报错 cannot find module "wrapp"" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(4) "zzty" ["tagsname"]=> string(50) "node.js|npm|cannot find module "wrapp“|node" ["tagsid"]=> string(19) "[398,"239",399,400]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511400760" ["_id"]=> string(3) "427" } [2]=> array(10) { ["id"]=> string(3) "426" ["text"]=> string(54) "说说css中pt、px、em、rem都扮演了什么角色" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(12) "zhengqiaoyin" ["tagsname"]=> string(0) "" ["tagsid"]=> string(2) "[]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511400640" ["_id"]=> string(3) "426" } [3]=> array(10) { ["id"]=> string(3) "425" ["text"]=> string(83) "深入学习JS执行--创建执行上下文(变量对象,作用域链,this)" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(7) "Ry-yuan" ["tagsname"]=> string(33) "Javascript|Javascript执行过程" ["tagsid"]=> string(13) "["169","191"]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511399901" ["_id"]=> string(3) "425" } [4]=> array(10) { ["id"]=> string(3) "424" ["text"]=> string(30) "C# 排序技术研究与对比" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(9) "vveiliang" ["tagsname"]=> string(0) "" ["tagsid"]=> string(2) "[]" ["catesname"]=> string(8) ".Net Dev" ["catesid"]=> string(5) "[199]" ["createtime"]=> string(10) "1511399150" ["_id"]=> string(3) "424" } [5]=> array(10) { ["id"]=> string(3) "423" ["text"]=> string(72) "【算法】小白的算法笔记:快速排序算法的编码和优化" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(9) "penghuwan" ["tagsname"]=> string(6) "算法" ["tagsid"]=> string(7) "["344"]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511398109" ["_id"]=> string(3) "423" } [6]=> array(10) { ["id"]=> string(3) "422" ["text"]=> string(64) "JavaScript数据可视化编程学习(二)Flotr2,雷达图" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(7) "chengxs" ["tagsname"]=> string(28) "数据可视化|前端学习" ["tagsid"]=> string(9) "[396,397]" ["catesname"]=> string(18) "前端基本知识" ["catesid"]=> string(5) "[198]" ["createtime"]=> string(10) "1511397800" ["_id"]=> string(3) "422" } [7]=> array(10) { ["id"]=> string(3) "421" ["text"]=> string(36) "C#表达式目录树(Expression)" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(4) "wwym" ["tagsname"]=> string(0) "" ["tagsid"]=> string(2) "[]" ["catesname"]=> string(4) ".NET" ["catesid"]=> string(7) "["119"]" ["createtime"]=> string(10) "1511397474" ["_id"]=> string(3) "421" } [8]=> array(10) { ["id"]=> string(3) "420" ["text"]=> string(47) "数据结构 队列_队列实例:事件处理" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(7) "idreamo" ["tagsname"]=> string(40) "C语言|数据结构|队列|事件处理" ["tagsid"]=> string(23) "["246","247","248",395]" ["catesname"]=> string(12) "数据结构" ["catesid"]=> string(7) "["133"]" ["createtime"]=> string(10) "1511397279" ["_id"]=> string(3) "420" } [9]=> array(10) { ["id"]=> string(3) "419" ["text"]=> string(47) "久等了,博客园官方Android客户端发布" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(3) "cmt" ["tagsname"]=> string(0) "" ["tagsid"]=> string(2) "[]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511396549" ["_id"]=> string(3) "419" } } ["count"]=> int(200) } 222 Linux系统中FastDfs安装步骤 - 爱码网

Linux系统中FastDfs安装步骤Linux系统中FastDfs安装步骤


只为自己看懂



Linux系统中进行FastDFS软件的安装配置,方法的过程中是很复杂的,所以如果不是专业的电脑高手可能是没有办法整理出来,所以为了方便网友们更好的了解这个软件的安装,一下就是详细的过程,大家一起来看看吧!
第一步:安装FastDFS 
1.解压 FastDFS_v4.07.tar.gz ==>FastDFS 
2. cd FastDFS ==>vim make.sh 
修改以下内容 
TARGET_PREFIX=/usr/local/fdfs 
TARGET_CONF_PATH=/usr/local/fdfs/conf 
mkdir -p /usr/local/fdfs 
mkdir -p /usr/local/fdfs/conf 
修改 
if [ "$uname" = "Linux" ]; then 
    if [ "$WITH_LINUX_SERVICE" = "1" ]; then 
      if [ ! -d $TARGET_CONF_PATH ]; then 
        mkdir -p $TARGET_CONF_PATH 
        cp -f conf/tracker.conf $TARGET_CONF_PATH 
        cp -f conf/storage.conf $TARGET_CONF_PATH 
        cp -f conf/client.conf $TARGET_CONF_PATH 
        cp -f conf/http.conf $TARGET_CONF_PATH 
        cp -f conf/mime.types $TARGET_CONF_PATH 
      fi 
      cp -f init.d/fdfs_trackerd /etc/rc.d/init.d/ 
      cp -f init.d/fdfs_storaged /etc/rc.d/init.d/ 
      /sbin/chkconfig --add fdfs_trackerd 
      /sbin/chkconfig --add fdfs_storaged 
    fi 
  fi 
第二步:安装libevent-2.0.19-stable.tar.gz 
1.解压 libevent-2.0.19-stable.tar.gz==>libevent-2.0.19-stable 
2.进入libevent-2.0.19-stable 安装 
./configure --prefix=/usr/local/libevent 
make 
make install 
3. 添加软连接 
ln -s /usr/local/libevent/lib/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.5 
ln -s /usr/local/libevent/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5 
ln -s /usr/local/libevent/lib/libevent-2.0.so.5 /lib64/libevent-2.0.so.5 
ln -s /usr/local/libevent/lib/libevent-2.0.so.5 /lib/libevent-2.0.so.5 
ln -s /usr/local/libevent/lib/libevent-2.0.so.5 /usr/local/lib64/libevent-2.0.so.5 
ln -s /usr/local/libevent/lib/libevent-2.0.so.5 /usr/local/lib/libevent-2.0.so.5 
第三步:安装FastDFS 
./make.sh C_INCLUDE_PATH=/usr/local/libevent/include LIBRARY_PATH=/usr/local/libevent/lib 
./make.sh install 
第四步:如果/usr/local/fastdfs/conf没有fdfs_trackerd和fdfs_storaged这两个文件,就从 /FastDFS/tracker 和FastDFS/storage/目录下复制过去 
第五步:修改配置 
mkdir -p /home/softinstall/data/tracker 
1. 修改 tracker.conf 
base_path=/home/softinstall/data/tracker 
bind_addr=192.168.9.169 
1.1 修改storage_ids.conf 
100001   group1  192.168.9.169 
2. 启动tracker 
./fdfs_trackerd ../conf/tracker.conf  
查看22122端口是否启动起来 
第六步:配置storage 
mkdir -p /home/softinstall/data/store 
mkdir -p /home/softinstall/data/store/store0 
mkdir -p /home/softinstall/data/store/store1 
mkdir -p /home/softinstall/data/store/store2 
1.修改storage.conf 
base_path=/home/softinstall/data/store 
store_path_count=3 
store_path0=/home/softinstall/data/store/store0 
store_path1=/home/softinstall/data/store/store1 
store_path2=/home/softinstall/data/store/store2 
tracker_server=192.168.9.169:22122 
#限6*6=36个目录 默认256*256 
subdir_count_per_path=6 
2. 启动storage 
./fdfs_storaged ../conf/storage.conf  
查看23000端口是否启动 
第七步:安装nginx+fastdfs模块 
1. 安装pcre-8.32  
进入pcre-8.32 
./configure 
make 
make install 
安装如果有问题缺省某些包,可以执行: 
yum groupinstall "Development Tools"  
第八步:解压fastdfs-nginx-module_v1.15.tar.gz和 nginx-1.4.2.tar.gz 
1.进入 fastdfs-nginx-module_v1.15/src 
vim fastdfs-nginx-module_v1.15/src/config 
修改成以下内容 
ngx_addon_name=ngx_http_fastdfs_module 
HTTP_MODULES="$HTTP_MODULES ngx_http_fastdfs_module" 
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_fastdfs_module.c" 
CORE_INCS="$CORE_INCS /usr/local/fdfs/include/fastdfs /usr/local/fdfs/include/fastcommon/" 
CORE_LIBS="$CORE_LIBS -L/usr/local/fdfs/lib -lfastcommon -lfdfsclient" 
CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64 -DFDFS_OUTPUT_CHUNK_SIZE='256*1024' -DFDFS_MOD_CONF_FILENAME='\"/usr/local/fdfs/conf/mod_fastdfs.conf\"'" 
2. 安装 
进入nginx-1.4.2目录 
./configure --prefix=/home/softinstall/nginx/nginx-fastdfs-install --with-pcre=/home/softinstall/nginx/pcre-8.32 --add-module=/home/softinstall/nginx/fastdfs-nginx-module/src 
安装中如果有问题 
可以执行安装以下包:yum -y install gcc gcc-c++ zlib-devel openssl-devel 
3.配置nginx.conf 
进入nginx-fastdfs-install/conf 
vim nginx.conf 配置以下内容 
      location /M00 { 
root /home/softinstall/data/store/store0/data; 
ngx_fastdfs_module; 
} 
location /M01 { 
root /home/softinstall/data/store/store1/data; 
ngx_fastdfs_module; 
} 
location /M02 { 
root /home/softinstall/data/store/store2/data; 
ngx_fastdfs_module; 
} 
4.配置mod_fastdfs.conf 
mkdir -p /home/softinstall/data/nginx_mod 
进入 /usr/local/fdfs/conf目录 
vim mod_fastdfs.conf 
base_path=/home/softinstall/data/nginx_mod 
tracker_server=192.168.9.169:22122 
store_path_count=3 
store_path0=/home/softinstall/data/store/store0 
store_path1=/home/softinstall/data/store/store1 
store_path2=/home/softinstall/data/store/store2 
5. 启动nginx 
进入 /home/softinstall/nginx/nginx-fastdfs-install/sbin 
./nginx 
如果启动找不到 
error while loading shared libraries: libfdfsclient.so: cannot open shared object file: No such file or directory 
error while loading shared libraries: libfastcommon.so: cannot open shared object file: No such file or directory 
请使用以下软连接 
ln -s /usr/local/fdfs/lib/libfastcommon.so /usr/lib/libfastcommon.so 
ln -s /usr/local/fdfs/lib/libfastcommon.so /usr/lib64/libfastcommon.so 
ln -s /usr/local/fdfs/lib/libfdfsclient.so /usr/lib64/libfdfsclient.so 
ln -s /usr/local/fdfs/lib/libfdfsclient.so /usr/lib/libfdfsclient.so 
==========================fastDHT================================ 
【第一步:】安装 Berkley DB 
【1.】 tar -zxvf db-4.7.25.tar.gz 
进入 db-4.7.25/build_unix 
../dist/configure --prefix=/usr 
【第二步:】安装FastDHT 
mkdir -p /usr/local/fdht 
mkdir -p /usr/local/fdht/conf 
1. tar -zxvf  FastDHT_v1.23.tar.gz 
进入 FastDHT_v1.23 
vim make.sh 
修改 
TARGET_PREFIX=/usr/local/fdht 
TARGET_CONF_PATH=/usr/local/fdht/conf 
if [ "$1" = "install" ]; then 
  cd .. 
  cp -f restart.sh $TARGET_PREFIX/bin 
  cp -f stop.sh $TARGET_PREFIX/bin 
  if [ "$uname" = "Linux" ]; then 
    if [ "$WITH_LINUX_SERVICE" = "1" ]; then 
      if [ ! -d $TARGET_CONF_PATH ]; then 
        mkdir -p $TARGET_CONF_PATH 
        cp -f conf/fdhtd.conf $TARGET_CONF_PATH 
        cp -f conf/fdht_servers.conf $TARGET_CONF_PATH 
        cp -f conf/fdht_client.conf $TARGET_CONF_PATH 
      fi 
      cp -f init.d/fdhtd /etc/rc.d/init.d/ 
      /sbin/chkconfig --add fdhtd 
    fi 
  fi 
fi 
【2.】 安装 
./make.sh 
------------------------------------------------------------------------------ 
如果出现 global.h:18:19: error: event.h: No such file or directory 
进入/home/softinstall/fastdfs/libevent-2.0.19-stable然后执行 
./configure --prefix=/usr 
make 
make install 
--------------------------------------------------------------------------------- 
./make.sh install 
【3.】 配置fdht 
【3.1】 vim /usr/local/fdht/conf/fdhtd.conf 
port=11411 
bash_path=/home/softinstall/data/fastdht 
cache_size = 32MB 
store_sub_keys=true 
use_storage_id=true 
#include /usr/local/fdht/conf/fdht_servers.conf (本行前有#表示打开,如果想关闭此选项,则应该为##开头) 
【3.2】 vim /usr/local/fdht/conf/fdht_server.conf 
group_count = 1 
group0 = 192.168.9.165:11411 
【3.3】 vim /usr/local/fdht/conf/fdht_client.conf 
keep_alive=1 (本选项关联 storaged.conf文件) 
base_path=/home/softinstall/data/fastdht 
#include /usr/local/fdht/conf/fdht_servers.conf 
【3.4】 配置FastDFS 的 storaged.conf文件 
vi storaged.conf (默认位置: /usr/local/fdfs/conf/storaged.conf) 
check_file_duplicate=1 
本配置项解释: 是否检测上传文件已经存在。如果已经存在,则不存在文件内容,建立一个索引链接以节省磁盘空间 
key_namespace=FastDFS 
本配置项解释: 当上个参数设定为1时 , 在FastDHT中的命名空间 
keep_alive=1 
本配置项解释: 长连接配置选项,如果为0则为短连接 1为长连接 
#include /usr/local/fdht/conf/fdht_servers.conf 
本配置项解释: 可以通过 #include filename 方式来加载 FastDHT servers 的配置 
【3.5】  
===========================总体启动流程====================================== 
    
   启动tracker    /usr/local/fdfs/bin/fdfs_trackerd /usr/local/fdfs/conf/tracker.conf  
   停止tracker    /usr/local/fdfs/bin/stop.sh /usr/local/fdfs/conf/tracker.conf  
   启动storage   /usr/local/fdfs/bin/fdfs_storaged /usr/local/fdfs/conf/storage.conf  
   停止storage   /usr/local/fdfs/bin/stop.sh /usr/local/fdfs/conf/storage.conf  
 
   启动nginx    /home/softinstall/nginx/nginx-fastdfs-install/sbin/nginx 
 
启动 
/usr/local/fdht/bin/fdhtd /usr/local/fdht/conf/fdhtd.conf 
停止 
/usr/local/fdht/bin/stop.sh  /usr/local/fdht/conf/fdhtd.conf 
 
测试 是否有错误: 
/usr/local/fdht/bin/fdht_test /usr/local/fdht/conf/fdht_client.conf 
=================================================================

相关文章: