filer.toml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. # A sample TOML config file for SeaweedFS filer store
  2. # Used with "weed filer" or "weed server -filer"
  3. # Put this file to one of the location, with descending priority
  4. # ./filer.toml
  5. # $HOME/.seaweedfs/filer.toml
  6. # /etc/seaweedfs/filer.toml
  7. ####################################################
  8. # Customizable filer server options
  9. ####################################################
  10. [filer.options]
  11. # with http DELETE, by default the filer would check whether a folder is empty.
  12. # recursive_delete will delete all sub folders and files, similar to "rm -Rf"
  13. recursive_delete = false
  14. # directories under this folder will be automatically creating a separate bucket
  15. buckets_folder = "/buckets"
  16. ####################################################
  17. # The following are filer store options
  18. ####################################################
  19. [leveldb2]
  20. # local on disk, mostly for simple single-machine setup, fairly scalable
  21. # faster than previous leveldb, recommended.
  22. enabled = true
  23. dir = "./filerldb2" # directory to store level db files
  24. [leveldb3]
  25. # similar to leveldb2.
  26. # each bucket has its own meta store.
  27. enabled = false
  28. dir = "./filerldb3" # directory to store level db files
  29. [rocksdb]
  30. # local on disk, similar to leveldb
  31. # since it is using a C wrapper, you need to install rocksdb and build it by yourself
  32. enabled = false
  33. dir = "./filerrdb" # directory to store rocksdb files
  34. [sqlite]
  35. # local on disk, similar to leveldb
  36. enabled = false
  37. dbFile = "./filer.db" # sqlite db file
  38. [mysql] # or memsql, tidb
  39. # CREATE TABLE IF NOT EXISTS filemeta (
  40. # dirhash BIGINT COMMENT 'first 64 bits of MD5 hash value of directory field',
  41. # name VARCHAR(1000) BINARY COMMENT 'directory or file name',
  42. # directory TEXT COMMENT 'full path to parent directory',
  43. # meta LONGBLOB,
  44. # PRIMARY KEY (dirhash, name)
  45. # ) DEFAULT CHARSET=utf8;
  46. enabled = false
  47. hostname = "localhost"
  48. port = 3306
  49. username = "root"
  50. password = ""
  51. database = "" # create or use an existing database
  52. connection_max_idle = 2
  53. connection_max_open = 100
  54. connection_max_lifetime_seconds = 0
  55. interpolateParams = false
  56. # if insert/upsert failing, you can disable upsert or update query syntax to match your RDBMS syntax:
  57. enableUpsert = true
  58. upsertQuery = """INSERT INTO ` + "`%s`" + ` (dirhash,name,directory,meta) VALUES(?,?,?,?) ON DUPLICATE KEY UPDATE meta = VALUES(meta)"""
  59. [mysql2] # or memsql, tidb
  60. enabled = false
  61. createTable = """
  62. CREATE TABLE IF NOT EXISTS ` + "`%s`" + ` (
  63. dirhash BIGINT,
  64. name VARCHAR(1000) BINARY,
  65. directory TEXT,
  66. meta LONGBLOB,
  67. PRIMARY KEY (dirhash, name)
  68. ) DEFAULT CHARSET=utf8;
  69. """
  70. hostname = "localhost"
  71. port = 3306
  72. username = "root"
  73. password = ""
  74. database = "" # create or use an existing database
  75. connection_max_idle = 2
  76. connection_max_open = 100
  77. connection_max_lifetime_seconds = 0
  78. interpolateParams = false
  79. # if insert/upsert failing, you can disable upsert or update query syntax to match your RDBMS syntax:
  80. enableUpsert = true
  81. upsertQuery = """INSERT INTO ` + "`%s`" + ` (dirhash,name,directory,meta) VALUES(?,?,?,?) ON DUPLICATE KEY UPDATE meta = VALUES(meta)"""
  82. [postgres] # or cockroachdb, YugabyteDB
  83. # CREATE TABLE IF NOT EXISTS filemeta (
  84. # dirhash BIGINT,
  85. # name VARCHAR(65535),
  86. # directory VARCHAR(65535),
  87. # meta bytea,
  88. # PRIMARY KEY (dirhash, name)
  89. # );
  90. enabled = false
  91. hostname = "localhost"
  92. port = 5432
  93. username = "postgres"
  94. password = ""
  95. database = "postgres" # create or use an existing database
  96. schema = ""
  97. sslmode = "disable"
  98. connection_max_idle = 100
  99. connection_max_open = 100
  100. connection_max_lifetime_seconds = 0
  101. # if insert/upsert failing, you can disable upsert or update query syntax to match your RDBMS syntax:
  102. enableUpsert = true
  103. upsertQuery = """INSERT INTO "%[1]s" (dirhash,name,directory,meta) VALUES($1,$2,$3,$4) ON CONFLICT (dirhash,name) DO UPDATE SET meta = EXCLUDED.meta WHERE "%[1]s".meta != EXCLUDED.meta"""
  104. [postgres2]
  105. enabled = false
  106. createTable = """
  107. CREATE TABLE IF NOT EXISTS "%s" (
  108. dirhash BIGINT,
  109. name VARCHAR(65535),
  110. directory VARCHAR(65535),
  111. meta bytea,
  112. PRIMARY KEY (dirhash, name)
  113. );
  114. """
  115. hostname = "localhost"
  116. port = 5432
  117. username = "postgres"
  118. password = ""
  119. database = "postgres" # create or use an existing database
  120. schema = ""
  121. sslmode = "disable"
  122. connection_max_idle = 100
  123. connection_max_open = 100
  124. connection_max_lifetime_seconds = 0
  125. # if insert/upsert failing, you can disable upsert or update query syntax to match your RDBMS syntax:
  126. enableUpsert = true
  127. upsertQuery = """INSERT INTO "%[1]s" (dirhash,name,directory,meta) VALUES($1,$2,$3,$4) ON CONFLICT (dirhash,name) DO UPDATE SET meta = EXCLUDED.meta WHERE "%[1]s".meta != EXCLUDED.meta"""
  128. [cassandra]
  129. # CREATE TABLE filemeta (
  130. # directory varchar,
  131. # name varchar,
  132. # meta blob,
  133. # PRIMARY KEY (directory, name)
  134. # ) WITH CLUSTERING ORDER BY (name ASC);
  135. enabled = false
  136. keyspace = "seaweedfs"
  137. hosts = [
  138. "localhost:9042",
  139. ]
  140. username = ""
  141. password = ""
  142. # This changes the data layout. Only add new directories. Removing/Updating will cause data loss.
  143. superLargeDirectories = []
  144. # Name of the datacenter local to this filer, used as host selection fallback.
  145. localDC = ""
  146. [hbase]
  147. enabled = false
  148. zkquorum = ""
  149. table = "seaweedfs"
  150. [redis2]
  151. enabled = false
  152. address = "localhost:6379"
  153. password = ""
  154. database = 0
  155. # This changes the data layout. Only add new directories. Removing/Updating will cause data loss.
  156. superLargeDirectories = []
  157. [redis_cluster2]
  158. enabled = false
  159. addresses = [
  160. "localhost:30001",
  161. "localhost:30002",
  162. "localhost:30003",
  163. "localhost:30004",
  164. "localhost:30005",
  165. "localhost:30006",
  166. ]
  167. password = ""
  168. # allows reads from slave servers or the master, but all writes still go to the master
  169. readOnly = false
  170. # automatically use the closest Redis server for reads
  171. routeByLatency = false
  172. # This changes the data layout. Only add new directories. Removing/Updating will cause data loss.
  173. superLargeDirectories = []
  174. [etcd]
  175. enabled = false
  176. servers = "localhost:2379"
  177. timeout = "3s"
  178. [mongodb]
  179. enabled = false
  180. uri = "mongodb://localhost:27017"
  181. option_pool_size = 0
  182. database = "seaweedfs"
  183. [elastic7]
  184. enabled = false
  185. servers = [
  186. "http://localhost1:9200",
  187. "http://localhost2:9200",
  188. "http://localhost3:9200",
  189. ]
  190. username = ""
  191. password = ""
  192. sniff_enabled = false
  193. healthcheck_enabled = false
  194. # increase the value is recommend, be sure the value in Elastic is greater or equal here
  195. index.max_result_window = 10000
  196. ##########################
  197. ##########################
  198. # To add path-specific filer store:
  199. #
  200. # 1. Add a name following the store type separated by a dot ".". E.g., cassandra.tmp
  201. # 2. Add a location configuraiton. E.g., location = "/tmp/"
  202. # 3. Copy and customize all other configurations.
  203. # Make sure they are not the same if using the same store type!
  204. # 4. Set enabled to true
  205. #
  206. # The following is just using redis as an example
  207. ##########################
  208. [redis2.tmp]
  209. enabled = false
  210. location = "/tmp/"
  211. address = "localhost:6379"
  212. password = ""
  213. database = 1