aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorernado <ernado@ya.ru>2014-07-23 20:08:00 +0400
committerernado <ernado@ya.ru>2014-07-23 20:08:00 +0400
commitf90372747628af8491d1eff37a0d36002d8c8229 (patch)
tree74e9542c1f75c83667ee5f7e2bbd6c3bd36606ce
parent0812346e56ed5faca5cd2fdfc82c3e8f4b3c8382 (diff)
downloadseaweedfs-f90372747628af8491d1eff37a0d36002d8c8229.tar.xz
seaweedfs-f90372747628af8491d1eff37a0d36002d8c8229.zip
added use cases page
-rw-r--r--docs/index.rst1
-rw-r--r--docs/usecases.rst55
2 files changed, 56 insertions, 0 deletions
diff --git a/docs/index.rst b/docs/index.rst
index 9293468fb..fea0bcd8c 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -28,6 +28,7 @@ Contents:
api
replication
failover
+ usecases
Indices and tables
diff --git a/docs/usecases.rst b/docs/usecases.rst
new file mode 100644
index 000000000..c3cb8e3af
--- /dev/null
+++ b/docs/usecases.rst
@@ -0,0 +1,55 @@
+Use cases
+===================
+
+Saving image with different sizes
+#############################
+
+Each image usually store one file key in database. However, one image can have several versions, e.g., thumbnail, small, medium, large, original. And each version of the same image will have a file key. It's not ideal to store all the keys.
+
+One way to resolve this is here.
+
+Reserve a set of file keys, for example, 5
+
+.. code-block:: bash
+
+ curl http://<host>:<port>/dir/assign?count=5
+ {"fid":"3,01637037d6","url":"127.0.0.1:8080","publicUrl":"localhost:8080","count":5}
+
+Save the 5 versions of the image to the volume server. The urls for each image can be:
+
+.. code-block:: bash
+
+ http://<url>:<port>/3,01637037d6
+ http://<url>:<port>/3,01637037d6_1
+ http://<url>:<port>/3,01637037d6_2
+ http://<url>:<port>/3,01637037d6_3
+ http://<url>:<port>/3,01637037d6_4
+
+Overwriting mime types
+#############################
+
+The correct way to send mime type:
+
+
+.. code-block:: bash
+
+ curl -F "file=@myImage.png;type=image/png" http://127.0.0.1:8081/5,2730a7f18b44
+
+The wrong way to send it:
+
+.. code-block:: bash
+
+ curl -H "Content-Type:image/png" -F file=@myImage.png http://127.0.0.1:8080/5,2730a7f18b44
+
+Securing WeedFS
+#############################
+
+The simple way is to front all master and volume servers with firewall.
+
+However, if blocking servicing port is not feasible or trivial, a white list option can be used. Only traffic from the white list IP addresses have write permission.
+
+.. code-block:: bash
+
+ weed master -whiteList="::1,127.0.0.1"
+ weed volume -whiteList="::1,127.0.0.1"
+ # "::1" is for IP v6 localhost. \ No newline at end of file