filer.toml 6.9 KB

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