Cant get working mogilefs together with nginx as webdav server

67 views
Skip to first unread message

Goodwill

unread,
Sep 11, 2008, 3:28:36 PM9/11/08
to mogile
Hello, we have trouble to make working nginx as webdav server for
unknown reason it just returns error message from tracker "no_devices
No+devices+found+to+store+file", though when using perlbal as webdav
server, it works. Here is what we have installed on Gentoo:

dev-perl/mogilefs-server-2.17
dev-perl/MogileFS-Client-1.08
dev-perl/MogileFS-Utils-2.12
dev-perl/IO-AIO-3.06
dev-perl/Perlbal-1.70
www-servers/nginx-0.6.29

-------------------------------------------------------------------------
Nginx config:
-------------------------------------------------------------------------
user nginx nginx;
worker_processes 5;

error_log /var/log/nginx/error_log info;

events {
worker_connections 1024;
#use epoll;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;


##log_format main
## '$remote_addr - $remote_user [$time_local] '
## '"$request" $status $bytes_sent '
## '"$http_referer" "$http_user_agent" '
## '"$gzip_ratio"';

##client_header_timeout 10m;
##client_body_timeout 10m;
##send_timeout 10m;

client_max_body_size 100M;


##connection_pool_size 256;
##client_header_buffer_size 1k;
##large_client_header_buffers 4 2k;
##request_pool_size 4k;

##gzip on;
##gzip_min_length 1100;
##gzip_buffers 4 8k;
##gzip_types text/plain;

##output_buffers 1 32k;
#postpone_output 1460;

sendfile on;
##tcp_nopush on;
tcp_nodelay on;

keepalive_timeout 0;

##ignore_invalid_headers on;

index index.html;

server {
listen 7500;
server_name localhost;
charset utf-8;

location / {

root /home/mogdata/;

dav_methods PUT DELETE MKCOL COPY MOVE;

dav_access user:rw group:rw all:r;
}

error_page 500 502 503 504 /50x.html;
location /50x.html {
root html;
}
}
}

-----------------------------------------------------------------------
Mogstored.conf
-----------------------------------------------------------------------
# $Header: /var/cvsroot/gentoo-x86/dev-perl/mogilefs-server/files/
mogstored.conf-2.16,v 1.1 2007/05/16 11:11:17 robbat2 Exp $

# These are set inside the Gentoo conf.d/mogilefsd
#pidfile = /var/run/mogile/mogstored.pid
#daemonize = 1

# Network settings
#httplisten = 0.0.0.0:7500
mgmtlisten = 0.0.0.0:7501

# Storage
docroot = /home/mogdata

# Server type
##Mogstored::HTTPServer::None
server=none

# Tuning knobs
#max_conns = 10000
#opt_iostat 1

----------------------------------------------------------------
Mogilefsd.conf
----------------------------------------------------------------
# $Header: /var/cvsroot/gentoo-x86/dev-perl/mogilefs-server/files/
mogilefsd.conf-2.16,v 1.1 2007/05/16 11:11:17 robbat2 Exp $

# System user
user = mogile
# These are set inside the Gentoo conf.d/mogilefsd
#pidfile = /var/run/mogile/mogilefsd.pid
#daemonize = 1

# Database settings
db_dsn = DBI:mysql:mogilefs
db_user = mogile
# You must insert your password here!
db_pass = testpass

# Network settings
conf_port = 7001
listen = 0.0.0.0:7001,
listener_jobs 5

# Storage
#mog_root = /mnt/mogilefs

# Plugins
#plugins = ...

# Tuning knobs
#query_jobs = 20
#delete_jobs = 1
#replicate_jobs = 1
#monitor_jobs = 1
#reaper_jobs = 1
#min_free_space = 100
#max_disk_age = 5
#node_timeout = 2
#old_repl_compat = 1
#default_mindevcount = 2

--------------------------------------------------------------------------------
The result with nginx as webdav server is following:
--------------------------------------------------------------------------------

home # mogadm --lib=/usr/lib/perl5/5.8.8 --trackers=192.168.0.29:7001
check
Checking trackers...
192.168.0.29:7001 ... OK

Checking hosts...
[ 1] mogilestorage ... REQUEST FAILURE
No devices found on tracker(s).

--------------------------------------------------------------------------------
The result with perlbal as webdav server is following:
--------------------------------------------------------------------------------

home # mogadm --lib=/usr/lib/perl5/5.8.8 --trackers=192.168.0.29:7001
check
Checking trackers...
192.168.0.29:7001 ... OK

Checking hosts...
[ 1] mogilestorage ... OK

Checking devices...
host device size(G) used(G) free(G) use% ob
state I/O%
---- ------------ ---------- ---------- ---------- ------ ----------
-----
[ 1] dev1 560.809 0.264 560.545 0.05%
writeable 0.0
---- ------------ ---------- ---------- ---------- ------
total: 560.809 0.264 560.545 0.05%

So the problem is probably on nginx side, I will appreciate any help.

Goodwill

dormando

unread,
Sep 11, 2008, 10:05:27 PM9/11/08
to mogile
Have you searched the mail archives (at google and at lists.danga.com)?
I'm not used nginx with mogilefs myself so I can't really help, but it's
come up on the list before.

-Dormando

mike

unread,
Sep 11, 2008, 11:14:11 PM9/11/08
to mog...@googlegroups.com
On Thu, Sep 11, 2008 at 12:28 PM, Goodwill <gooo...@gmail.com> wrote:
>
> Hello, we have trouble to make working nginx as webdav server for
> unknown reason it just returns error message from tracker "no_devices
> No+devices+found+to+store+file", though when using perlbal as webdav
> server, it works. Here is what we have installed on Gentoo:


make sure to include this:
create_full_put_path on;

this works perfect for me (on ubuntu)

server {
access_log off;


listen 7500;
server_name localhost;
charset utf-8;

client_body_temp_path /var/mogdata/.tmp;
location / {
root /var/mogdata;
dav_methods put delete mkcol copy move;


dav_access user:rw group:rw all:r;

# not sure if this is needed
create_full_put_path on;
}
# these are not right

Daniel

unread,
Sep 12, 2008, 1:25:56 AM9/12/08
to mog...@googlegroups.com
I'm not sure if this apply in your case, but
try to put an index.html in the root directory.

Tuqui

Goodwill さんは書きました:


--
*********************************************************
仲宗根 ダニエル
マリーン・システム・アソシエイツ株式会社
〒900-0036 沖縄県浦添市牧港5丁目2番1号
沖縄電力本店別館6F
Tel : 098-942-5575
Fax : 098-942-5574
URL : www.telesat.co.jp
www.netfan.ne.jp
Mail : dan...@telesat.co.jp
*********************************************************
Daniel Nakasone
Marine System Associates, Inc.
Address : 5-2-1 Makiminato Annex 6F
Urasoe City,
Okinawa Japan 900-0036
Tel : +81-98-942-5575
Fax : +81-98-942-5574
URL : www.telesat.co.jp
www.netfan.ne.jp
Mail : dan...@telesat.co.jp
*********************************************************

mega

unread,
Sep 12, 2008, 7:12:51 AM9/12/08
to mogile

My storage node work on nginx with this conf:

server {
listen 192.168.0.7:7500 default;
server_name localhost;
charset utf-8;
location / {
client_body_temp_path /var/mogdata/tmp;
root /var/mogdata;
dav_methods put delete mkcol copy move;
dav_access user:rw group:rw all:r;
create_full_put_path on;
autoindex on;
index index;
}

location /dev2 {
client_body_temp_path /var/mogdata/dev2/tmp;
root /var/mogdata;
dav_methods put delete mkcol copy move;
dav_access user:rw group:rw all:r;
create_full_put_path on;
}
}

Goodwill

unread,
Sep 14, 2008, 6:16:35 PM9/14/08
to mogile
Thanks guys, we got it working with help of posted nginx config files,
though its working still partially. The file is now stored in /home/
mogdata/dev1/0/000/000/ folder everytime with increasing ID from
tempfile table, though the file gets never inserted into file table.
We tested file save using perlbal and it worked perfectly, though
nginx just inserts entry in tempfile table and no further steps are
taken. When checking mysql query log, I found it ends right here:

INSERT INTO tempfile (dmid,dkey,classid,devids,createtime) VALUES
('1','testkey','2','1',UNIX_TIMESTAMP())
SELECT COUNT(*) FROM file WHERE fid='46'

Doesnt matter if key already exist or not, it gets just stuck in
tempfile table. No error is returned from tracker nor nginx. Mogile is
cleaning these pending files after some period automatically, so they
disappear from disk and tempfile table, so no problem here also. I
wonder if we didnt forget something else to set.

Goodwill
Reply all
Reply to author
Forward
0 new messages