通过tengine-3.1.0访问fastdsf

一、tengine介绍

Tengine是由淘宝网发起的Web服务器项目。它在Nginx的基础上,针对大访问量网站的需求,添加了很多高级功能和特性。

二、tengine-3.1.0下载

tengine-3.1.0

三、tengine安装

3.1、下载fastdfs-nginx-module-1.23模块

fastdfs-nginx-module

3.2、解压缩tengine

...

3.3、解压缩fastdfs-nginx-module

...

3.3、安装tengine

sed -i 's#/usr/local/include#/usr/include/fastdfs /usr/include/fastcommon#' fastdfs-nginx-module-1.23/src/config

./configure --prefix=/usr/local/nginx --add-module=/usr/local/bigdata/fastdfs-nginx-module-1.23/src/
make && make install

3.5、修改tengine配置文件

[root@node5 conf]# vi /usr/local/nginx/conf/nginx.conf
 location / {
            root   html;
            index  index.html index.htm;
        }
     
        location ~/group1/M00 {
            root /data/fastdfs/fdfs_storage/data;
            ngx_fastdfs_module;
        }
cd /usr/local/bigdata/fastdfs-nginx-module-1.23/src

cp mod_fastdfs.conf /etc/fdfs/

修改mod_fastdfs.conf

[root@node5 fdfs]# cat mod_fastdfs.conf 
# connect timeout in seconds
# default value is 30s
connect_timeout=2

# network recv and send timeout in seconds
# default value is 30s
network_timeout=30

# the base path to store log files
base_path= /data/fastdfs

# if load FastDFS parameters from tracker server
# since V1.12
# default value is false
load_fdfs_parameters_from_tracker=true

# storage sync file max delay seconds
# same as tracker.conf
# valid only when load_fdfs_parameters_from_tracker is false
# since V1.12
# default value is 86400 seconds (one day)
storage_sync_file_max_delay = 86400

# if use storage ID instead of IP address
# same as tracker.conf
# valid only when load_fdfs_parameters_from_tracker is false
# default value is false
# since V1.13
use_storage_id = false

# specify storage ids filename, can use relative or absolute path
# same as tracker.conf
# valid only when load_fdfs_parameters_from_tracker is false
# since V1.13
storage_ids_filename = storage_ids.conf

# FastDFS tracker_server can ocur more than once, and tracker_server format is
#  "host:port", host can be hostname or ip address
# valid only when load_fdfs_parameters_from_tracker is true
tracker_server=node5:22122

# the port of the local storage server
# the default value is 23000
storage_server_port=23000

# the group name of the local storage server
group_name=group1

# if the url / uri including the group name
# set to false when uri like /M00/00/00/xxx
# set to true when uri like ${group_name}/M00/00/00/xxx, such as group1/M00/xxx
# default value is false
url_have_group_name = true

# path(disk or mount point) count, default value is 1
# must same as storage.conf
store_path_count=1

# store_path#, based 0, if store_path0 not exists, it's value is base_path
# the paths must be exist
# must same as storage.conf
store_path0=/data/fastdfs/fdfs_storage
#store_path1=/home/yuqing/fastdfs1

# standard log level as syslog, case insensitive, value list:
### emerg for emergency
### alert
### crit for critical
### error
### warn for warning
### notice
### info
### debug
log_level=info

# set the log filename, such as /usr/local/apache2/logs/mod_fastdfs.log
# empty for output to stderr (apache and nginx error_log file)
log_filename=

# response mode when the file not exist in the local file system
## proxy: get the content from other storage server, then send to client
## redirect: redirect to the original storage server (HTTP Header is Location)
response_mode=proxy

# the NIC alias prefix, such as eth in Linux, you can see it by ifconfig -a
# multi aliases split by comma. empty value means auto set by OS type
# this paramter used to get all ip address of the local host
# default values is empty
if_alias_prefix=

# use "#include" directive to include HTTP config file
# NOTE: #include is an include directive, do NOT remove the # before include
#include http.conf


# if support flv
# default value is false
# since v1.15
flv_support = true

# flv file extension name
# default value is flv
# since v1.15
flv_extension = flv


# set the group count
# set to none zero to support multi-group on this storage server
# set to 0  for single group only
# groups settings section as [group1], [group2], ..., [groupN]
# default value is 0
# since v1.14
group_count = 0

# group settings for group #1
# since v1.14
# when support multi-group on this storage server, uncomment following section
#[group1]
#group_name=group1
#storage_server_port=23000
#store_path_count=2
#store_path0=/home/yuqing/fastdfs
#store_path1=/home/yuqing/fastdfs1

# group settings for group #2
# since v1.14
# when support multi-group, uncomment following section as neccessary
#[group2]
#group_name=group2
#storage_server_port=23000
#store_path_count=1
#store_path0=/home/yuqing/fastdfs

上传文件

/usr/bin/fdfs_upload_file /etc/fdfs/client.conf hello.txt 

group1/M00/00/00/wKgqj2VbbjuAMZ5CAAAAVg21ZJg951.txt

访问地址

http://192.168.42.143/group1/M00/00/00/wKgqj2VbbjuAMZ5CAAAAVg21ZJg951.txt

四、问题处理

[2023-11-20 22:45:26] ERROR - file: ini_file_reader.c, line: 1051, include file "http.conf" not exists, line: "#include http.conf"
[2023-11-20 22:45:26] ERROR - file: ini_file_reader.c, line: 1051, include file "http.conf" not exists, line: "#include http.conf"
[2023-11-20 22:45:26] ERROR - file: /usr/local/bigdata/fastdfs-nginx-module-1.23/src//common.c, line: 163, load conf file "/etc/fdfs/mod_fastdfs.conf" fail, ret code: 2
[2023-11-20 22:45:26] ERROR - file: /usr/local/bigdata/fastdfs-nginx-module-1.23/src//common.c, line: 163, load conf file "/etc/fdfs/mod_fastdfs.conf" fail, ret code: 2
2023/11/20 22:45:26 [alert] 123904#0: worker process 123907 exited with fatal code 2 and cannot be respawned
2023/11/20 22:45:26 [alert] 123904#0: worker process 123906 exited with fatal code 2 and cannot be respawned
把/FastDFS/conf/http.conf 复制到 etc/fdfs/下面就可以了

cp /usr/local/bigdata/fastdfs-6.10.0/conf/http.conf /etc/fdfs
cp /usr/local/bigdata/fastdfs-6.10.0/conf/mime.types /etc/fdfs


[root@node5 fdfs]# ll
总用量 72
-rw-r--r-- 1 root root  1929 11月 20 22:02 client.conf
-rw-r--r-- 1 root root   965 11月 20 22:50 http.conf
-rw-r--r-- 1 root root 31172 11月 20 22:50 mime.types
-rw-r--r-- 1 root root  3738 11月 20 22:32 mod_fastdfs.conf
-rw-r--r-- 1 root root 10287 11月 20 21:25 storage.conf
-rw-r--r-- 1 root root   620 11月 20 21:18 storage_ids.conf
-rw-r--r-- 1 root root  9158 11月 20 21:22 tracker.conf

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值