seaweedfs filer show empty

1,057 views
Skip to first unread message

Ryudith IRDA

unread,
May 29, 2015, 12:24:07 AM5/29/15
to seaw...@googlegroups.com
hi,

today i try seaweedfs, first using assign to get fid then upload with curl. it result file name and file size with json format, i check with curl download file exists, downloaded and perfect. but when i want to get list dir with filer that used port 8888 it show files null. how i can get list dir or where i can go to find solution or any clue ? i google there is no clue and too few resource listed by google.


thank you.


here my step :
1. run master server by command 'D:\server\seaweedfs>weed master -mdir="./data"' and 2 volume server by command 'D:\server\seaweedfs>weed volume -dir="./volume_1" -max=5 -mserver="localhost:9333" -port=8080' and 'D:\server\seaweedfs>weed volume -dir="./volume_2" -max=10 -mserver="localhost:9333" -port=8080'
2. get fid by command "curl -X POST http://localhost:9333/dir/assign" and success get fid json data
3. upload file by command "curl -X POST -F file=@D:/server/seaweedfs/tester_file/galaxy_mac_os.jpg http://127.0.0.1:8080/5,0314aa4b40" and return file name and file size with json format.
4. checking file by command "curl -O http://127.0.0.1:8080/5,0314aa4b40" and create file with name "5,0314aa4b40". i rename to "mac_os.jpg" and open by windows photo viewer, everything ok.
5. run server filer by command 'D:\server\seaweedfs>weed filer -dir="D:/server/seaweedfs/data"', no error show here
6. get list by command "curl http://localhost:8888/?pretty=y" and result :
    {
        "Directory": "/",
        "Files": null,
        "Subdirectories": null
    }

i try re-run server filer by command 'D:\server\seaweedfs>weed filer -dir="D:/server/seaweedfs/volume_1"' and run curl agin it still result same(files null).

Chris Lu

unread,
May 29, 2015, 2:25:48 AM5/29/15
to seaw...@googlegroups.com
You are using weed master and weed volume to store files, which is at lower level for "weed filer".

Here is how to use the filer.

Chris



--
You received this message because you are subscribed to the Google Groups "Seaweed File System" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seaweedfs+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ryudith IRDA

unread,
May 29, 2015, 6:28:42 AM5/29/15
to seaw...@googlegroups.com
hello ChrisLu,

ok, i think i understand weed filer work. it is like store meta in different database/table from weed volume use. 


but weird when i run command bellow:

D:\server\curl7.40.0>curl curl -F "filename=@D:/server/seaweedfs/tester_file/galaxy_mac_os.jpg" "http://localhost:8888/image/"
curl: (6) Could not resolve host: curl
{"name":"galaxy_mac_os.jpg","size":2367660}
D:\server\curl7.40.0>curl http://localhost:8888/?pretty=y
{
  "Directory": "/",
  "Files": [
    {
      "name": "galaxy_mac_os.jpg",
      "fid": "3,05325b104f"
    }
  ],
  "Subdirectories": null
}
D:\server\curl7.40.0>curl http://localhost:8888/image/?pretty=y
{
  "Directory": "/image/",
  "Files": [
    {
      "name": "galaxy_mac_os.jpg",
      "fid": "3,05325b104f"
    }
  ],
  "Subdirectories": null
}
D:\server\curl7.40.0>


why when i scan parent dir ("/") and subdir ("/image") give same result ? why not when scan parent dir ("/") it give only subdir and when scan subdir ("/image/") it will give list of file ? i just curious. :)

sorry, i had more question, what command or parameter to setting (set interval to write from memory to disk) for weed volume to write file from memory to disk in case prevent bad luck ? i look command "weed server -h", "weed volume -h" and "weed filer -h" but did not find any or may be i missed some description.



thank you.

Chris Lu

unread,
May 29, 2015, 12:54:59 PM5/29/15
to seaw...@googlegroups.com
Mine is working fine. See logs below. It seems your first command has double "curl" in the command line.

This is actually one nice feature about SeaweedFS. The writes are not flushed because of slow fsync. However, seaweedfs appends content(add/delete/update) to big blob of volume files. If ever system crashes, only last few entries still in the not-flushed buffer cache may be lost. So you don't need to fsync for every file. 

Chris

--------------------------------------------
chrislu-mbp:Desktop chrislu$ curl -F "filename=@s.png" "http://localhost:8888/image/"
{"name":"s.png","size":280168}chrislu-mbp:Desktop chrislu$
chrislu-mbp:Desktop chrislu$ curl http://localhost:8888/?pretty=y
{
  "Directory": "/",
  "Files": null,
  "Subdirectories": [
    {
      "Name": "image",
      "Id": 1
    }
  ]
}chrislu-mbp:Desktop chrislu$ curl http://localhost:8888/image/?pretty=y
{
  "Directory": "/image/",
  "Files": [
    {
      "name": "s.png",
      "fid": "3,0142fb376a"
    }
  ],
  "Subdirectories": null
}

Ryudith IRDA

unread,
May 30, 2015, 1:36:11 PM5/30/15
to seaw...@googlegroups.com

for filer, i tried using 1 curl and it show same result as i told you before. but it just happen in windows only, because when i tried in vbox centos 7 it show correct as your log.

maybe i was wrong or made mistake, but these image show what i doing when test it. maybe i never use seaweedfs on windows but yes on linux for server, but i want to tell you this weird filer on windows. in office i using windows 8.1 and home windows 7, both show same weird log.


for write from memory to disk, i found on windows file never write to disk from memory until server volume shutdown. but on vbox centos 7, it will write when i upload file to filer. also on windows it will write to volume 1, on linux it write to volume 2 even i start volume 1 first. maybe this because on windows 1 use 4GB(office 8GB) memory and on vbox centos 7 just use 1GB memory.


that's what i found, i just want to tell you.

ChrisLu

unread,
Jul 8, 2015, 4:48:15 AM7/8/15
to seaw...@googlegroups.com, ryudith.ang...@gmail.com
FYI: This filer problem on windows has been fixed in https://github.com/chrislusf/seaweedfs/issues/161

Chris
Reply all
Reply to author
Forward
0 new messages