You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

254 lines
7.4 KiB

3 years ago
  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 BINARY 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 BINARY,
  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. [redis3] # beta
  173. enabled = false
  174. address = "localhost:6379"
  175. password = ""
  176. database = 0
  177. [redis_cluster3] # beta
  178. enabled = false
  179. addresses = [
  180. "localhost:30001",
  181. "localhost:30002",
  182. "localhost:30003",
  183. "localhost:30004",
  184. "localhost:30005",
  185. "localhost:30006",
  186. ]
  187. password = ""
  188. # allows reads from slave servers or the master, but all writes still go to the master
  189. readOnly = false
  190. # automatically use the closest Redis server for reads
  191. routeByLatency = false
  192. [etcd]
  193. enabled = false
  194. servers = "localhost:2379"
  195. timeout = "3s"
  196. [mongodb]
  197. enabled = false
  198. uri = "mongodb://localhost:27017"
  199. option_pool_size = 0
  200. database = "seaweedfs"
  201. [elastic7]
  202. enabled = false
  203. servers = [
  204. "http://localhost1:9200",
  205. "http://localhost2:9200",
  206. "http://localhost3:9200",
  207. ]
  208. username = ""
  209. password = ""
  210. sniff_enabled = false
  211. healthcheck_enabled = false
  212. # increase the value is recommend, be sure the value in Elastic is greater or equal here
  213. index.max_result_window = 10000
  214. ##########################
  215. ##########################
  216. # To add path-specific filer store:
  217. #
  218. # 1. Add a name following the store type separated by a dot ".". E.g., cassandra.tmp
  219. # 2. Add a location configuraiton. E.g., location = "/tmp/"
  220. # 3. Copy and customize all other configurations.
  221. # Make sure they are not the same if using the same store type!
  222. # 4. Set enabled to true
  223. #
  224. # The following is just using redis as an example
  225. ##########################
  226. [redis2.tmp]
  227. enabled = false
  228. location = "/tmp/"
  229. address = "localhost:6379"
  230. password = ""
  231. database = 1