Browse Source

Merge pull request #10 from ernado/master

Added docker example to docs
pull/92/head
chrislusf 11 years ago
parent
commit
78ccbbf3d0
  1. 4
      README.md
  2. 36
      docs/gettingstarted.rst

4
README.md

@ -3,9 +3,9 @@ weed-fs
[![Build Status](https://travis-ci.org/chrislusf/weed-fs.svg?branch=master)](https://travis-ci.org/chrislusf/weed-fs) [![Build Status](https://travis-ci.org/chrislusf/weed-fs.svg?branch=master)](https://travis-ci.org/chrislusf/weed-fs)
[![GoDoc](https://godoc.org/github.com/chrislusf/weed-fs/go?status.svg)](https://godoc.org/github.com/chrislusf/weed-fs/go) [![GoDoc](https://godoc.org/github.com/chrislusf/weed-fs/go?status.svg)](https://godoc.org/github.com/chrislusf/weed-fs/go)
[![RTD](https://readthedocs.org/projects/ernadoweed-fs/badge/?version=latest)](http://ernadoweed-fs.readthedocs.org/en/latest/)
[![RTD](https://readthedocs.org/projects/weed-fs/badge/?version=latest)](http://weed-fs.readthedocs.org/en/latest/)
An official mirror of code.google.com/p/weed-fs .
An official mirror of code.google.com/p/weed-fs.
Moving to github.com to make cooperations easier. Moving to github.com to make cooperations easier.
This repo and the google code repo will be kept synchronized. This repo and the google code repo will be kept synchronized.

36
docs/gettingstarted.rst

@ -76,3 +76,39 @@ This command would recursively upload all files. Or you can specify what files y
Then, you can simply check "du -m -s /some/big/folder" to see the actual disk usage by OS, and compare it with the file size under "/data". Usually if you are uploading a lot of textual files, the consumed disk size would be much smaller since textual files are gzipped automatically. Then, you can simply check "du -m -s /some/big/folder" to see the actual disk usage by OS, and compare it with the file size under "/data". Usually if you are uploading a lot of textual files, the consumed disk size would be much smaller since textual files are gzipped automatically.
Now you can use your tools to hit weed-fs as hard as you can. Now you can use your tools to hit weed-fs as hard as you can.
Using Weed-Fs in docker
####################################
You can use image "cydev/weed" or build your own with `dockerfile <https://github.com/chrislusf/weed-fs/blob/master/Dockerfile>`_ in the root of repo.
.. code-block:: bash
docker run --name weed cydev/weed server
And in another terminal
.. code-block:: bash
IP=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' weed)
curl "http://$IP:9333/cluster/status?pretty=y"
{
"IsLeader": true,
"Leader": "localhost:9333"
}
# use $IP as host for api queries
In production
**************************************************************
To gain persistency you can use docker volumes.
.. code-block:: bash
# start our weed server daemonized
docker run --name weed -d -p 9333:9333 -p 8080:8080 \
-v /opt/weedfs/data:/data cydev/weed server -dir="/data" \
-publicIp="$(curl -s cydev.ru/ip)"
Now our weed-fs server will be persistent and accessible by localhost:9333 and :8080 on host machine.
Dont forget to specify "-publicIp" for correct connectivity.
Loading…
Cancel
Save