mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 10:07:28 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a85ed3fe8f | ||
|
|
1f8e73ede7 | ||
|
|
2ea18cdcc8 | ||
|
|
fa8e33ccb8 | ||
|
|
b7de5c6c43 | ||
|
|
f2f0482dd3 | ||
|
|
05c53820b9 | ||
|
|
69ef6459c3 | ||
|
|
bfea7008f3 | ||
|
|
785223e587 | ||
|
|
57975b93ff | ||
|
|
a79f5bd0d5 | ||
|
|
3c79c77056 | ||
|
|
05510630fd | ||
|
|
2c031f2a7c | ||
|
|
f69a8127a4 | ||
|
|
9ea1d093b0 | ||
|
|
c2c9c6d60a | ||
|
|
00d5be61d3 | ||
|
|
bf924e37c1 | ||
|
|
8f7273a13c | ||
|
|
d243fa49cf | ||
|
|
92f62165ef | ||
|
|
a122baa427 | ||
|
|
5bc895673e | ||
|
|
267d45c313 | ||
|
|
dd4664e610 | ||
|
|
c349f81195 | ||
|
|
d0eb65ae7b | ||
|
|
141f662734 | ||
|
|
bee3a7c798 | ||
|
|
ddb0f6bc74 | ||
|
|
96c9d16c11 | ||
|
|
3d5f1cbc5e | ||
|
|
06a8b174b5 | ||
|
|
52580743b9 | ||
|
|
5ed8165161 | ||
|
|
413cb3d389 | ||
|
|
200a862701 | ||
|
|
ffaa2163e0 | ||
|
|
f3c4b07b8a | ||
|
|
4ae9884a6e | ||
|
|
b98556cff5 | ||
|
|
2b5b37231b | ||
|
|
e17e6ed542 | ||
|
|
bcbdc4cb37 | ||
|
|
a8abab2412 | ||
|
|
449ecc8890 | ||
|
|
c6e6e303db | ||
|
|
e22c2c8012 | ||
|
|
7c3d9d0535 | ||
|
|
61b2e3f9a2 | ||
|
|
606252472c | ||
|
|
e969370913 | ||
|
|
a79bf9d92a | ||
|
|
74c9f39d48 | ||
|
|
8d810f8305 | ||
|
|
e1b94eb6b9 | ||
|
|
4b1f48a399 | ||
|
|
4a65159250 | ||
|
|
dc6b1a52e8 | ||
|
|
3a42269da8 | ||
|
|
4be406a095 | ||
|
|
265b05c8fc | ||
|
|
f5273cdd5c | ||
|
|
a9389377b5 | ||
|
|
9bff097b01 | ||
|
|
6c20a3b622 | ||
|
|
201023dd15 | ||
|
|
d172d07212 | ||
|
|
2e3d6104e4 | ||
|
|
1a5981d583 | ||
|
|
983686bb83 | ||
|
|
b5d70669ad | ||
|
|
787103b032 | ||
|
|
cfd7c0fa78 | ||
|
|
e90a6af65e | ||
|
|
8aa19577f4 | ||
|
|
d7c3493d15 | ||
|
|
b9f7b6fb9a | ||
|
|
fdd880b111 | ||
|
|
15bfc60a88 | ||
|
|
6a2afc3a7e | ||
|
|
af23e63e3f | ||
|
|
d003bb0166 | ||
|
|
40a9634c3d | ||
|
|
cc01f71752 | ||
|
|
93dd33319f | ||
|
|
824cbe32be | ||
|
|
9dfea44aeb | ||
|
|
3142e77eca | ||
|
|
13159ad0d8 | ||
|
|
46e0b629e5 | ||
|
|
f77eda4b4f | ||
|
|
3ce46c3566 | ||
|
|
dc59ccd110 | ||
|
|
f1ea906c13 | ||
|
|
0c8e033e68 | ||
|
|
9c517d2b35 | ||
|
|
280e33092c | ||
|
|
509a9047db | ||
|
|
217d7dc377 | ||
|
|
2e782dfdcb | ||
|
|
7efaafb0ee | ||
|
|
b0aa51d7ef | ||
|
|
ea7cdb8b0e | ||
|
|
46ae28d64c | ||
|
|
5b388ed6c1 | ||
|
|
28f615dcae | ||
|
|
0c13fc873c | ||
|
|
96496d5286 | ||
|
|
52c44d646e | ||
|
|
530da0cc89 | ||
|
|
3185154d0e | ||
|
|
8a6e7a7df8 | ||
|
|
9df5ad5309 | ||
|
|
d652ce1a36 | ||
|
|
6b3beb709d | ||
|
|
c1c8dad677 | ||
|
|
4dc27e1ed5 | ||
|
|
492da3dbce | ||
|
|
41dfe27102 | ||
|
|
2295766e2c | ||
|
|
1d0c53ea56 | ||
|
|
1846d08a32 | ||
|
|
1eb7826909 | ||
|
|
bf5a5abfb1 | ||
|
|
69a2e503ab | ||
|
|
36931babf9 | ||
|
|
76f26c4b99 | ||
|
|
0d22877df9 | ||
|
|
758df5ade6 | ||
|
|
497ac1da27 | ||
|
|
a608d71523 | ||
|
|
6eed6ceaa3 | ||
|
|
2064e49842 | ||
|
|
50d564216b | ||
|
|
43f5df522f | ||
|
|
ddd261845b | ||
|
|
f800404516 | ||
|
|
ff05008083 | ||
|
|
2d75dda243 | ||
|
|
460c7cf68e | ||
|
|
1166d9dcf1 | ||
|
|
81f7f08708 | ||
|
|
be5c901bea | ||
|
|
5f5fd0bc48 | ||
|
|
9138e68208 | ||
|
|
bd63b305dd | ||
|
|
9e2d6e897e | ||
|
|
6270047202 | ||
|
|
8db9f13bc6 | ||
|
|
1d77deccd0 | ||
|
|
9e036df356 | ||
|
|
1baa7ead59 | ||
|
|
fdacd94af5 | ||
|
|
3dd60529c5 | ||
|
|
37df209195 | ||
|
|
d28f8bb88f | ||
|
|
c7c20881f5 | ||
|
|
625fd16a2e | ||
|
|
5f8d6b5f13 | ||
|
|
cd078471c4 | ||
|
|
aaa9938353 | ||
|
|
995e221e97 | ||
|
|
e024586ff1 | ||
|
|
82f3bcc65e | ||
|
|
40055211bd | ||
|
|
df0ce31a2e | ||
|
|
6449114e5e | ||
|
|
0a613876ca | ||
|
|
62f74f5e3c | ||
|
|
4bc8792643 | ||
|
|
1dbb925d29 | ||
|
|
3076ac101e | ||
|
|
097a12dfb4 | ||
|
|
55b9f281d1 | ||
|
|
78b3728169 | ||
|
|
a9f6c4b43d | ||
|
|
338705f375 | ||
|
|
31a929f7f2 | ||
|
|
4eeeb5f50d | ||
|
|
358c0c0b37 | ||
|
|
3df84cabf6 | ||
|
|
695e8c7555 | ||
|
|
b8ce05c904 | ||
|
|
4d0d1848c6 | ||
|
|
b90d213a87 | ||
|
|
42d04c581b | ||
|
|
d4ef06cdcf | ||
|
|
b347b2fb54 | ||
|
|
36d2756978 | ||
|
|
28cda854eb | ||
|
|
14e0d8613b | ||
|
|
14d82c3dea | ||
|
|
78fc9cdfa0 | ||
|
|
322dbcf372 | ||
|
|
cc5d771088 | ||
|
|
623c1a4a16 | ||
|
|
2b159c331d | ||
|
|
f2f9e4ec20 | ||
|
|
9bdd7e8725 | ||
|
|
c1ab14ec8b | ||
|
|
ef8b803e33 | ||
|
|
46d1640505 | ||
|
|
101f2da3cc | ||
|
|
b847f2bdd1 | ||
|
|
1d7c0e65a0 | ||
|
|
ba16477cef | ||
|
|
a647057969 | ||
|
|
d4156e4f26 | ||
|
|
2da2ff00a3 | ||
|
|
b22ca85fbb | ||
|
|
f01dd27752 | ||
|
|
e437ec5a68 | ||
|
|
d12f431d98 | ||
|
|
444ac21050 | ||
|
|
a74e926063 | ||
|
|
61b8c9c361 | ||
|
|
0a8b3948db | ||
|
|
83f8cdd5cb | ||
|
|
3b8306c594 | ||
|
|
eabf4d4e64 | ||
|
|
36757d28a8 | ||
|
|
9f8b72a54d | ||
|
|
fb57aa431c | ||
|
|
873830a7bf | ||
|
|
a63559ee6c | ||
|
|
37da689319 | ||
|
|
00d53c34c4 | ||
|
|
f5b0c04b14 | ||
|
|
cd5cca36a4 | ||
|
|
4a5135961f | ||
|
|
49f058da85 | ||
|
|
8a1166c021 | ||
|
|
633a4aed18 | ||
|
|
acbc0286e2 | ||
|
|
ebd6097e6f | ||
|
|
f43ec9f363 | ||
|
|
c07820178f | ||
|
|
666e620b63 | ||
|
|
7ce519d4af | ||
|
|
f37fd2f883 | ||
|
|
fba6a19d0b | ||
|
|
a99536d523 | ||
|
|
ae3a1c0235 | ||
|
|
99d5c3fddd | ||
|
|
af18bf3a3a | ||
|
|
f71cd52e2b | ||
|
|
5506986bb5 | ||
|
|
05c5230689 | ||
|
|
bcb83a03be | ||
|
|
78be3b0f6c | ||
|
|
4fd5f96598 | ||
|
|
cbf46de5f4 | ||
|
|
8402af0882 | ||
|
|
1e8d8029ec | ||
|
|
f32142f6f5 | ||
|
|
4a046e4de7 | ||
|
|
11f1e7996b | ||
|
|
d65bb2c6df | ||
|
|
746092a60b | ||
|
|
056c480eb0 | ||
|
|
ecef844dfc | ||
|
|
48cca4e54f | ||
|
|
685643d506 | ||
|
|
663bc5dc23 | ||
|
|
18b29f709c | ||
|
|
39c3cb04af | ||
|
|
f97acdd489 | ||
|
|
ff5b96f0be | ||
|
|
47d335cf8c | ||
|
|
e152dc8fae | ||
|
|
02ae102731 | ||
|
|
b86628f85d | ||
|
|
6793bc853c | ||
|
|
89948a373b | ||
|
|
8a49240d64 | ||
|
|
376b005ad3 | ||
|
|
fbd99d53c1 | ||
|
|
27732ecfa4 | ||
|
|
f4a6da6cb2 | ||
|
|
596c3860ca | ||
|
|
ca01ce0524 | ||
|
|
6adc42147f | ||
|
|
490e0850bf | ||
|
|
f0ee3e6f21 | ||
|
|
c59068d0f3 | ||
|
|
682382648e | ||
|
|
968ca95b49 | ||
|
|
f214dfb1f5 | ||
|
|
aece35a64f | ||
|
|
a2b101a737 | ||
|
|
8902fa6ff6 | ||
|
|
730c9cf601 | ||
|
|
625ee579fe | ||
|
|
ebf9a1e1d8 | ||
|
|
5b9347c938 | ||
|
|
af562e1a20 | ||
|
|
4225e577fa | ||
|
|
c0afc70e00 | ||
|
|
5d5d04e090 | ||
|
|
b15787d1b3 | ||
|
|
0d187c9a9d | ||
|
|
633166fe50 | ||
|
|
751e4e9cd9 | ||
|
|
64f381b3b2 | ||
|
|
d73c335c31 | ||
|
|
37f48717f7 | ||
|
|
ec38ff1a39 | ||
|
|
62e5e3822c | ||
|
|
26f3646961 | ||
|
|
b8f3db0d46 | ||
|
|
81d6159290 | ||
|
|
ca16fbf0ef | ||
|
|
9219664505 | ||
|
|
54356211c2 | ||
|
|
b100773afc | ||
|
|
4598581741 | ||
|
|
5b8b022985 | ||
|
|
df50afc642 | ||
|
|
0e6e72d462 | ||
|
|
1fabbe8a25 | ||
|
|
cb422d96f7 | ||
|
|
05602167f4 | ||
|
|
a67ad1e9e5 | ||
|
|
7e25a2d416 | ||
|
|
1386aa020e | ||
|
|
c9e1f3c565 | ||
|
|
730011ad3c | ||
|
|
00b46f5777 | ||
|
|
84583fe095 | ||
|
|
efbf5ac900 | ||
|
|
568855adad | ||
|
|
45a5629f84 | ||
|
|
a14728d508 | ||
|
|
a34438384e | ||
|
|
2f846777bb | ||
|
|
a5cdcc7e63 | ||
|
|
59cc3c0bfd | ||
|
|
acc318e12b | ||
|
|
076e48a676 | ||
|
|
71b2e6223e | ||
|
|
accf4d65c6 | ||
|
|
1a41691b4c | ||
|
|
3a8dadcc2d | ||
|
|
bee482d49e | ||
|
|
cb64983c6b | ||
|
|
66747ee9c9 | ||
|
|
8efe55f981 | ||
|
|
8e2426a879 | ||
|
|
92590d60ff | ||
|
|
d68a37d3e6 | ||
|
|
b12944f9c6 | ||
|
|
076595fbdd | ||
|
|
8fab39e775 | ||
|
|
36309e824d | ||
|
|
abe311e64e | ||
|
|
a045f97eea | ||
|
|
d415596be0 | ||
|
|
9a0cf3cf54 | ||
|
|
f04efe710f | ||
|
|
d3b8a82813 | ||
|
|
f496629d3b | ||
|
|
1a7e02174c | ||
|
|
e085dcfb38 | ||
|
|
397b8b20b1 | ||
|
|
07e7cf3171 | ||
|
|
f4656f677a | ||
|
|
99ffbcea7f | ||
|
|
70779df038 | ||
|
|
72e7dcde51 | ||
|
|
a84f4eefc2 | ||
|
|
b72f0634d7 | ||
|
|
de6aa9cce8 | ||
|
|
44f53ceda6 | ||
|
|
17c676cb86 | ||
|
|
10d435f2c2 | ||
|
|
279053572c | ||
|
|
ca85b66511 | ||
|
|
9ff0d99002 | ||
|
|
866fed1eab | ||
|
|
cd2d10118c | ||
|
|
271b5aed96 | ||
|
|
4076d74813 | ||
|
|
29198720f2 | ||
|
|
05f16ba4d2 | ||
|
|
6dc183824a | ||
|
|
59435e4a2e | ||
|
|
867ffc3f28 | ||
|
|
5ee51f7cbd | ||
|
|
55b525be43 | ||
|
|
8f762a1a06 | ||
|
|
ea4918394c | ||
|
|
688d55488c | ||
|
|
21c95d9b29 | ||
|
|
417d0a441d | ||
|
|
735038b2c1 | ||
|
|
1166dead00 | ||
|
|
8f103ae613 | ||
|
|
d12a423aa0 | ||
|
|
e41b11b004 | ||
|
|
f523aed3c9 | ||
|
|
bff1ccc1de | ||
|
|
76da688176 | ||
|
|
3e20336bde | ||
|
|
a85720f0f6 | ||
|
|
25559eeb92 | ||
|
|
791c29ae93 | ||
|
|
8ac959e41b | ||
|
|
167faeb9bb | ||
|
|
ba2f80d1f8 | ||
|
|
4e07afb45f | ||
|
|
37a8049e3e | ||
|
|
ffa413a16f | ||
|
|
07b1d10f26 | ||
|
|
89688d9147 | ||
|
|
ddc61a0af9 | ||
|
|
108b7faef4 | ||
|
|
6e94ff8105 | ||
|
|
13bd6794e2 | ||
|
|
f38adceb83 | ||
|
|
6a24f22c25 | ||
|
|
9b04b8bd53 | ||
|
|
7f30706fd3 | ||
|
|
51150227a0 | ||
|
|
008dc19cbd | ||
|
|
dfb8141665 | ||
|
|
82fb8f9333 | ||
|
|
3a21196fc3 | ||
|
|
607ba90f62 | ||
|
|
4093459630 | ||
|
|
a50828d8f8 | ||
|
|
5082ed7176 | ||
|
|
06cb337b82 | ||
|
|
a4ca3ed1f0 | ||
|
|
a3a718284b | ||
|
|
da2fe78ac2 | ||
|
|
8bc16f1149 | ||
|
|
bbd3c586f6 | ||
|
|
139e039c44 | ||
|
|
22fbce8fd5 | ||
|
|
10207a48a4 | ||
|
|
db33b03735 | ||
|
|
e350ba8896 | ||
|
|
71e0bcc5d5 | ||
|
|
b2a43dd044 | ||
|
|
d5fe5d12b7 | ||
|
|
362dec87a3 | ||
|
|
a69bf53405 | ||
|
|
e6d2cb5911 | ||
|
|
ef6c6c450e | ||
|
|
f7366a9668 | ||
|
|
f58adaab25 | ||
|
|
7d18b2756d | ||
|
|
f127b326bf | ||
|
|
7b544576af | ||
|
|
f17cd0d5cd | ||
|
|
b201edb9df | ||
|
|
04d5dff6bb | ||
|
|
cb3c7a3cdb | ||
|
|
8342f651f3 | ||
|
|
9271866d1e | ||
|
|
2d27afb515 | ||
|
|
e82233efa7 | ||
|
|
f6d90e12a6 | ||
|
|
34564a5818 | ||
|
|
76148ce0f7 | ||
|
|
d8925b4e83 | ||
|
|
7640e650e5 | ||
|
|
998c1973ea | ||
|
|
7f7f6f99e6 | ||
|
|
47ced6ce9c | ||
|
|
ded6fdd274 | ||
|
|
4db70080b1 | ||
|
|
80752afff3 | ||
|
|
c5717ad8c2 | ||
|
|
319d300d48 | ||
|
|
6701f2ecc2 | ||
|
|
71ea8646a6 | ||
|
|
1a7344b8a4 | ||
|
|
158c9d8106 | ||
|
|
da656a54ba | ||
|
|
94f302fb34 | ||
|
|
c772bbb704 | ||
|
|
0dc44dda63 | ||
|
|
a3e48831f3 | ||
|
|
73961e24d8 | ||
|
|
00c1dfec4f | ||
|
|
ce1e8e58ae | ||
|
|
2c0fdf3693 | ||
|
|
94635e9b5c | ||
|
|
50c4f62ed4 | ||
|
|
21033ff4c3 | ||
|
|
ec0ed41e37 | ||
|
|
4bd6bea429 | ||
|
|
6a052f6ff2 | ||
|
|
275c3bb19c | ||
|
|
5d081d5c3c | ||
|
|
1aae7a3f1b | ||
|
|
ea8a7a5584 | ||
|
|
192983b464 | ||
|
|
b2a96cee21 | ||
|
|
03aec9ce7e | ||
|
|
d71a1fd077 | ||
|
|
1a5de36257 | ||
|
|
4e97b6146a | ||
|
|
b2a6111090 | ||
|
|
ddec170bc9 | ||
|
|
306cf70c4a | ||
|
|
70e5a1b632 | ||
|
|
ffe028f8d0 | ||
|
|
37ab8909b0 | ||
|
|
b557faf175 | ||
|
|
eb49bd5638 | ||
|
|
15c7d6e7bc | ||
|
|
94f824e1ce | ||
|
|
7315d1d039 | ||
|
|
d4343ab7da | ||
|
|
ae56b2c00f | ||
|
|
6d2fda27d2 | ||
|
|
3bce568c32 | ||
|
|
e236978472 | ||
|
|
67476d830a | ||
|
|
42cc8d8aa3 | ||
|
|
b1dac20c70 | ||
|
|
6610ec739d | ||
|
|
d7cadd9e5b | ||
|
|
526e1e0b4f | ||
|
|
c18960a1d5 | ||
|
|
a178e45713 | ||
|
|
09c7564219 | ||
|
|
2aef5b8b32 | ||
|
|
8212dd58e0 | ||
|
|
14a917c262 | ||
|
|
184e982898 | ||
|
|
70ad3ccf4f | ||
|
|
8fd7b24b80 | ||
|
|
8b2552f944 | ||
|
|
09befe871f | ||
|
|
f3d4576790 | ||
|
|
57d6f2bc6b | ||
|
|
893a0eea57 | ||
|
|
520f9600b2 | ||
|
|
6ccc1095a9 | ||
|
|
32da0c330c | ||
|
|
7f049e32fe | ||
|
|
3f0a8543a8 | ||
|
|
350d80d907 | ||
|
|
2988e69b1e | ||
|
|
ad01c63b84 | ||
|
|
4aa39ef33f | ||
|
|
3885374edf | ||
|
|
6994e88192 | ||
|
|
cb1e7aa27d | ||
|
|
7c4a556940 | ||
|
|
1d6a9e66b6 | ||
|
|
d1fd403582 | ||
|
|
c57e0a98ee | ||
|
|
a4b8903210 | ||
|
|
a7df63667d | ||
|
|
bdc4d67de8 | ||
|
|
3aa4dc6ad5 | ||
|
|
4792e07228 | ||
|
|
f3fdfb07b8 | ||
|
|
8e9ad7db5a | ||
|
|
8c345bdc7f | ||
|
|
bc96e73b8d | ||
|
|
a23629b2fe | ||
|
|
3d5fc72d55 | ||
|
|
88a669dd19 | ||
|
|
f76c318a1f | ||
|
|
2364fab927 | ||
|
|
0a137e675d | ||
|
|
94ad557d97 | ||
|
|
e27e52c05b | ||
|
|
94c702402e | ||
|
|
82ee31965d | ||
|
|
e6ebafc094 | ||
|
|
60ae6082c2 | ||
|
|
868b4f8944 | ||
|
|
a71eff0694 | ||
|
|
36c5a59ed8 | ||
|
|
1e35b4929f | ||
|
|
1093e8e6d7 | ||
|
|
cdb31c5b61 | ||
|
|
8e98d7326b | ||
|
|
97c6e0efb1 | ||
|
|
9438738693 | ||
|
|
a69f0b62c2 | ||
|
|
9ae66f55fc | ||
|
|
4524ceae6b | ||
|
|
39b1e1b630 | ||
|
|
61af76c3bb | ||
|
|
89eb87c1d1 | ||
|
|
846c56e005 | ||
|
|
3551ca2fcf | ||
|
|
b597baf488 | ||
|
|
460d56d283 | ||
|
|
fd1dc1ab25 | ||
|
|
b4be56bb3b | ||
|
|
96800ffed5 | ||
|
|
7034fafb81 | ||
|
|
47eb9485b8 | ||
|
|
40ed4215f0 | ||
|
|
1384529eb7 | ||
|
|
94ea10e504 | ||
|
|
cae53cb238 | ||
|
|
4d881cdb61 | ||
|
|
9464f3b18c | ||
|
|
7a02fab289 | ||
|
|
6bc01e2f31 | ||
|
|
8ebdb0cb45 | ||
|
|
349550f41d | ||
|
|
89f633f3a9 | ||
|
|
9a21698caa | ||
|
|
4aa1fb7331 | ||
|
|
0af5c88a6e | ||
|
|
1b1c8e4af5 | ||
|
|
2c0e2e11df | ||
|
|
846858fb43 | ||
|
|
42fea7e7d6 | ||
|
|
db24ea8ad8 | ||
|
|
93f257c3c1 | ||
|
|
9b40f7f3af | ||
|
|
1f03fcccb1 | ||
|
|
dd13764a5c | ||
|
|
76b1c5ce67 | ||
|
|
72db181d68 | ||
|
|
44d810d163 | ||
|
|
180aa88a92 | ||
|
|
a4a0d56fc4 | ||
|
|
e58d48ed38 | ||
|
|
2232cfb5b7 | ||
|
|
2dfbe210e0 | ||
|
|
a87f57e47c | ||
|
|
931cb9e581 | ||
|
|
d2fe0fae33 | ||
|
|
104ea7b029 | ||
|
|
41d396edc4 | ||
|
|
a2fdb3e277 | ||
|
|
35bc67f030 | ||
|
|
f5246b748d | ||
|
|
7ff248d5cd | ||
|
|
85d80fd36d | ||
|
|
ec53eec94f | ||
|
|
14a2cc83bf | ||
|
|
357aa818fe | ||
|
|
c1aeded2dd | ||
|
|
0e796a5582 | ||
|
|
68f11b9687 | ||
|
|
1ae7f509f5 | ||
|
|
89d32a0670 | ||
|
|
7dd93a88ac | ||
|
|
17c6e8e39f | ||
|
|
b7cdde14ae | ||
|
|
622297f1a7 | ||
|
|
1a1e5778c3 | ||
|
|
14dd971890 | ||
|
|
c514710b7b | ||
|
|
7e92517571 | ||
|
|
7f1383a41e | ||
|
|
3817e05dd0 | ||
|
|
3cedb21bb7 | ||
|
|
1d9e30d8c0 | ||
|
|
549e341c6f | ||
|
|
ea0b41d91c | ||
|
|
1d47574531 | ||
|
|
ec6320b037 | ||
|
|
644a613986 | ||
|
|
ca6becfeec | ||
|
|
c464e2e0d5 | ||
|
|
9f0957b4d0 | ||
|
|
907f9b51cd | ||
|
|
7d981a1c0e | ||
|
|
71307ce2e6 | ||
|
|
6701ac3a61 | ||
|
|
391170c3f4 | ||
|
|
bc603e534f | ||
|
|
830a97475f | ||
|
|
5c9a3bb8cf | ||
|
|
b67ebe67a6 | ||
|
|
beb406bbbb | ||
|
|
411c0df3fe | ||
|
|
1cea6c73d3 | ||
|
|
25be96832a | ||
|
|
06f23aa675 | ||
|
|
0701feeb17 | ||
|
|
171c27ddf1 | ||
|
|
2f0cdcdceb | ||
|
|
423ce57cde | ||
|
|
bf745bdccb | ||
|
|
a0df993cef | ||
|
|
52ce8cc4f2 | ||
|
|
94883e2fad | ||
|
|
f3ab6769e9 | ||
|
|
31571dd96e | ||
|
|
b25d03340b | ||
|
|
390a724c0c | ||
|
|
921535001a | ||
|
|
68cf6a9229 | ||
|
|
a5bd0b3a16 |
No files matched your search
@@ -3,8 +3,8 @@ updates:
|
|||||||
- package-ecosystem: "github-actions"
|
- package-ecosystem: "github-actions"
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: "weekly"
|
||||||
- package-ecosystem: gomod
|
- package-ecosystem: gomod
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: daily
|
interval: weekly
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# What problem are we solving?
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# How are we solving the problem?
|
||||||
|
|
||||||
|
|
||||||
|
# Checks
|
||||||
|
- [ ] I have added unit tests if possible.
|
||||||
|
- [ ] I will add related wiki document changes and link to this PR after merging.
|
||||||
@@ -17,7 +17,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Delete old release assets
|
- name: Delete old release assets
|
||||||
uses: mknejp/delete-release-assets@a8aaab13272b1eaac16cc46dddd3f725b97ee05a # v1
|
uses: mknejp/delete-release-assets@v1
|
||||||
with:
|
with:
|
||||||
token: ${{ github.token }}
|
token: ${{ github.token }}
|
||||||
tag: dev
|
tag: dev
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
# This is a basic workflow to help you get started with Actions
|
||||||
|
|
||||||
|
name: "go: build versioned binaries for linux with all tags"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
# Allows you to run this workflow manually from the Actions tab
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
build-release-binaries_linux:
|
||||||
|
permissions:
|
||||||
|
contents: write # for wangyoucao577/go-release-action to upload release assets
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
goos: [linux]
|
||||||
|
goarch: [amd64]
|
||||||
|
|
||||||
|
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||||
|
steps:
|
||||||
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||||
|
- uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
|
||||||
|
- name: Go Release Binaries Normal Volume Size
|
||||||
|
uses: wangyoucao577/go-release-action@16624612d4e2b73de613857a362d294700207fff # v1.22
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
goos: ${{ matrix.goos }}
|
||||||
|
goarch: ${{ matrix.goarch }}
|
||||||
|
overwrite: true
|
||||||
|
build_flags: -tags elastic,ydb,gocdk,tikv
|
||||||
|
pre_command: export CGO_ENABLED=0 && export GODEBUG=http2client=0
|
||||||
|
# build_flags: -tags 5BytesOffset # optional, default is
|
||||||
|
ldflags: -extldflags -static -X github.com/chrislusf/seaweedfs/weed/util.COMMIT=${{github.sha}}
|
||||||
|
# Where to run `go build .`
|
||||||
|
project_path: weed
|
||||||
|
binary_name: weed
|
||||||
|
asset_name: "${{ matrix.goos }}_${{ matrix.goarch }}_full"
|
||||||
|
- name: Go Release Large Disk Binaries
|
||||||
|
uses: wangyoucao577/go-release-action@16624612d4e2b73de613857a362d294700207fff # v1.22
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
goos: ${{ matrix.goos }}
|
||||||
|
goarch: ${{ matrix.goarch }}
|
||||||
|
overwrite: true
|
||||||
|
pre_command: export CGO_ENABLED=0 && export GODEBUG=http2client=0
|
||||||
|
build_flags: -tags 5BytesOffset,elastic,ydb,gocdk,tikv
|
||||||
|
ldflags: -extldflags -static -X github.com/chrislusf/seaweedfs/weed/util.COMMIT=${{github.sha}}
|
||||||
|
# Where to run `go build .`
|
||||||
|
project_path: weed
|
||||||
|
binary_name: weed
|
||||||
|
asset_name: "${{ matrix.goos }}_${{ matrix.goarch }}_full_large_disk"
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
name: "Code Scanning - Action"
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
CodeQL-Build:
|
||||||
|
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
# required for all workflows
|
||||||
|
security-events: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
# Initializes the CodeQL tools for scanning.
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v2
|
||||||
|
# Override language selection by uncommenting this and choosing your languages
|
||||||
|
with:
|
||||||
|
languages: go
|
||||||
|
|
||||||
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||||
|
# If this step fails, then you should remove it and run the build manually (see below).
|
||||||
|
- name: Autobuild
|
||||||
|
uses: github/codeql-action/autobuild@v2
|
||||||
|
|
||||||
|
# ℹ️ Command-line programs to run using the OS shell.
|
||||||
|
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||||
|
|
||||||
|
# ✏️ If the Autobuild fails above, remove it and uncomment the following
|
||||||
|
# three lines and modify them (or add more) to build your code if your
|
||||||
|
# project uses a compiled language
|
||||||
|
|
||||||
|
#- run: |
|
||||||
|
# make bootstrap
|
||||||
|
# make release
|
||||||
|
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@v2
|
||||||
@@ -3,7 +3,7 @@ name: "docker: build dev containers"
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
workflow_dispatch: []
|
workflow_dispatch: {}
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -20,7 +20,7 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: docker_meta
|
id: docker_meta
|
||||||
uses: docker/metadata-action@f2a13332ac1ce8c0a71aeac48a150dbb1838ab67 # v3
|
uses: docker/metadata-action@69f6fc9d46f2f8bf0d5491e4aabe0bb8c6a4678a # v3
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
chrislusf/seaweedfs
|
chrislusf/seaweedfs
|
||||||
@@ -33,30 +33,30 @@ jobs:
|
|||||||
org.opencontainers.image.vendor=Chris Lu
|
org.opencontainers.image.vendor=Chris Lu
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@27d0a4f181a40b142cce983c5393082c365d1480 # v1
|
uses: docker/setup-qemu-action@8b122486cedac8393e77aa9734c3528886e4a1a8 # v1
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@94ab11c41e45d028884a99163086648e898eed25 # v1
|
uses: docker/setup-buildx-action@dc7b9719a96d48369863986a06765841d7ea23f6 # v1
|
||||||
with:
|
with:
|
||||||
buildkitd-flags: "--debug"
|
buildkitd-flags: "--debug"
|
||||||
-
|
-
|
||||||
name: Login to Docker Hub
|
name: Login to Docker Hub
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7 # v1
|
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b # v1
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
-
|
-
|
||||||
name: Login to GHCR
|
name: Login to GHCR
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7 # v1
|
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b # v1
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ secrets.GHCR_USERNAME }}
|
username: ${{ secrets.GHCR_USERNAME }}
|
||||||
password: ${{ secrets.GHCR_TOKEN }}
|
password: ${{ secrets.GHCR_TOKEN }}
|
||||||
-
|
-
|
||||||
name: Build
|
name: Build
|
||||||
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a # v2
|
uses: docker/build-push-action@e551b19e49efd4e98792db7592c17c09b89db8d8 # v2
|
||||||
with:
|
with:
|
||||||
context: ./docker
|
context: ./docker
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- '*'
|
||||||
workflow_dispatch: []
|
workflow_dispatch: {}
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -21,7 +21,7 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: docker_meta
|
id: docker_meta
|
||||||
uses: docker/metadata-action@f2a13332ac1ce8c0a71aeac48a150dbb1838ab67 # v3
|
uses: docker/metadata-action@69f6fc9d46f2f8bf0d5491e4aabe0bb8c6a4678a # v3
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
chrislusf/seaweedfs
|
chrislusf/seaweedfs
|
||||||
@@ -34,30 +34,30 @@ jobs:
|
|||||||
org.opencontainers.image.vendor=Chris Lu
|
org.opencontainers.image.vendor=Chris Lu
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@27d0a4f181a40b142cce983c5393082c365d1480 # v1
|
uses: docker/setup-qemu-action@8b122486cedac8393e77aa9734c3528886e4a1a8 # v1
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@94ab11c41e45d028884a99163086648e898eed25 # v1
|
uses: docker/setup-buildx-action@dc7b9719a96d48369863986a06765841d7ea23f6 # v1
|
||||||
with:
|
with:
|
||||||
buildkitd-flags: "--debug"
|
buildkitd-flags: "--debug"
|
||||||
-
|
-
|
||||||
name: Login to Docker Hub
|
name: Login to Docker Hub
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7 # v1
|
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b # v1
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
-
|
-
|
||||||
name: Login to GHCR
|
name: Login to GHCR
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7 # v1
|
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b # v1
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ secrets.GHCR_USERNAME }}
|
username: ${{ secrets.GHCR_USERNAME }}
|
||||||
password: ${{ secrets.GHCR_TOKEN }}
|
password: ${{ secrets.GHCR_TOKEN }}
|
||||||
-
|
-
|
||||||
name: Build
|
name: Build
|
||||||
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a # v2
|
uses: docker/build-push-action@e551b19e49efd4e98792db7592c17c09b89db8d8 # v2
|
||||||
with:
|
with:
|
||||||
context: ./docker
|
context: ./docker
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- '*'
|
||||||
workflow_dispatch: []
|
workflow_dispatch: {}
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -20,7 +20,7 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: docker_meta
|
id: docker_meta
|
||||||
uses: docker/metadata-action@f2a13332ac1ce8c0a71aeac48a150dbb1838ab67 # v3
|
uses: docker/metadata-action@69f6fc9d46f2f8bf0d5491e4aabe0bb8c6a4678a # v3
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
chrislusf/seaweedfs
|
chrislusf/seaweedfs
|
||||||
@@ -34,20 +34,20 @@ jobs:
|
|||||||
org.opencontainers.image.vendor=Chris Lu
|
org.opencontainers.image.vendor=Chris Lu
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@27d0a4f181a40b142cce983c5393082c365d1480 # v1
|
uses: docker/setup-qemu-action@8b122486cedac8393e77aa9734c3528886e4a1a8 # v1
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@94ab11c41e45d028884a99163086648e898eed25 # v1
|
uses: docker/setup-buildx-action@dc7b9719a96d48369863986a06765841d7ea23f6 # v1
|
||||||
-
|
-
|
||||||
name: Login to Docker Hub
|
name: Login to Docker Hub
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7 # v1
|
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b # v1
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
-
|
-
|
||||||
name: Build
|
name: Build
|
||||||
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a # v2
|
uses: docker/build-push-action@e551b19e49efd4e98792db7592c17c09b89db8d8 # v2
|
||||||
with:
|
with:
|
||||||
context: ./docker
|
context: ./docker
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- '*'
|
||||||
workflow_dispatch: []
|
workflow_dispatch: {}
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -21,7 +21,7 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: docker_meta
|
id: docker_meta
|
||||||
uses: docker/metadata-action@f2a13332ac1ce8c0a71aeac48a150dbb1838ab67 # v3
|
uses: docker/metadata-action@69f6fc9d46f2f8bf0d5491e4aabe0bb8c6a4678a # v3
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
chrislusf/seaweedfs
|
chrislusf/seaweedfs
|
||||||
@@ -35,24 +35,25 @@ jobs:
|
|||||||
org.opencontainers.image.vendor=Chris Lu
|
org.opencontainers.image.vendor=Chris Lu
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@27d0a4f181a40b142cce983c5393082c365d1480 # v1
|
uses: docker/setup-qemu-action@8b122486cedac8393e77aa9734c3528886e4a1a8 # v1
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@94ab11c41e45d028884a99163086648e898eed25 # v1
|
uses: docker/setup-buildx-action@dc7b9719a96d48369863986a06765841d7ea23f6 # v1
|
||||||
-
|
-
|
||||||
name: Login to Docker Hub
|
name: Login to Docker Hub
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7 # v1
|
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b # v1
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
-
|
-
|
||||||
name: Build
|
name: Build
|
||||||
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a # v2
|
uses: docker/build-push-action@e551b19e49efd4e98792db7592c17c09b89db8d8 # v2
|
||||||
with:
|
with:
|
||||||
context: ./docker
|
context: ./docker
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
file: ./docker/Dockerfile.go_build_large
|
file: ./docker/Dockerfile.go_build
|
||||||
|
build-args: TAGS=5BytesOffset
|
||||||
platforms: linux/amd64, linux/arm, linux/arm64, linux/386
|
platforms: linux/amd64, linux/arm, linux/arm64, linux/386
|
||||||
tags: ${{ steps.docker_meta.outputs.tags }}
|
tags: ${{ steps.docker_meta.outputs.tags }}
|
||||||
labels: ${{ steps.docker_meta.outputs.labels }}
|
labels: ${{ steps.docker_meta.outputs.labels }}
|
||||||
@@ -4,7 +4,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- '*'
|
||||||
workflow_dispatch: []
|
workflow_dispatch: {}
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -21,7 +21,7 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: docker_meta
|
id: docker_meta
|
||||||
uses: docker/metadata-action@f2a13332ac1ce8c0a71aeac48a150dbb1838ab67 # v3
|
uses: docker/metadata-action@69f6fc9d46f2f8bf0d5491e4aabe0bb8c6a4678a # v3
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
chrislusf/seaweedfs
|
chrislusf/seaweedfs
|
||||||
@@ -35,20 +35,20 @@ jobs:
|
|||||||
org.opencontainers.image.vendor=Chris Lu
|
org.opencontainers.image.vendor=Chris Lu
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@27d0a4f181a40b142cce983c5393082c365d1480 # v1
|
uses: docker/setup-qemu-action@8b122486cedac8393e77aa9734c3528886e4a1a8 # v1
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@94ab11c41e45d028884a99163086648e898eed25 # v1
|
uses: docker/setup-buildx-action@dc7b9719a96d48369863986a06765841d7ea23f6 # v1
|
||||||
-
|
-
|
||||||
name: Login to Docker Hub
|
name: Login to Docker Hub
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7 # v1
|
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b # v1
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
-
|
-
|
||||||
name: Build
|
name: Build
|
||||||
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a # v2
|
uses: docker/build-push-action@e551b19e49efd4e98792db7592c17c09b89db8d8 # v2
|
||||||
with:
|
with:
|
||||||
context: ./docker
|
context: ./docker
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
name: "docker: build release containers for all tags"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
workflow_dispatch: {}
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-default-release-container:
|
||||||
|
runs-on: [ubuntu-latest]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
|
||||||
|
-
|
||||||
|
name: Docker meta
|
||||||
|
id: docker_meta
|
||||||
|
uses: docker/metadata-action@69f6fc9d46f2f8bf0d5491e4aabe0bb8c6a4678a # v3
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
chrislusf/seaweedfs
|
||||||
|
tags: |
|
||||||
|
type=ref,event=tag,suffix=_full
|
||||||
|
flavor: |
|
||||||
|
latest=false
|
||||||
|
labels: |
|
||||||
|
org.opencontainers.image.title=seaweedfs
|
||||||
|
org.opencontainers.image.description=SeaweedFS is a distributed storage system for blobs, objects, files, and data lake, to store and serve billions of files fast!
|
||||||
|
org.opencontainers.image.vendor=Chris Lu
|
||||||
|
-
|
||||||
|
name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@8b122486cedac8393e77aa9734c3528886e4a1a8 # v1
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@dc7b9719a96d48369863986a06765841d7ea23f6 # v1
|
||||||
|
-
|
||||||
|
name: Login to Docker Hub
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b # v1
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
-
|
||||||
|
name: Build
|
||||||
|
uses: docker/build-push-action@e551b19e49efd4e98792db7592c17c09b89db8d8 # v2
|
||||||
|
with:
|
||||||
|
context: ./docker
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
file: ./docker/Dockerfile.go_build
|
||||||
|
build-args: TAGS=elastic,ydb,gocdk,tikv
|
||||||
|
platforms: linux/amd64
|
||||||
|
tags: ${{ steps.docker_meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.docker_meta.outputs.labels }}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
name: "docker: build release containers for all tags and large volume"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
workflow_dispatch: {}
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-default-release-container:
|
||||||
|
runs-on: [ubuntu-latest]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
|
||||||
|
-
|
||||||
|
name: Docker meta
|
||||||
|
id: docker_meta
|
||||||
|
uses: docker/metadata-action@69f6fc9d46f2f8bf0d5491e4aabe0bb8c6a4678a # v3
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
chrislusf/seaweedfs
|
||||||
|
tags: |
|
||||||
|
type=ref,event=tag,suffix=_large_disk_full
|
||||||
|
flavor: |
|
||||||
|
latest=false
|
||||||
|
labels: |
|
||||||
|
org.opencontainers.image.title=seaweedfs
|
||||||
|
org.opencontainers.image.description=SeaweedFS is a distributed storage system for blobs, objects, files, and data lake, to store and serve billions of files fast!
|
||||||
|
org.opencontainers.image.vendor=Chris Lu
|
||||||
|
-
|
||||||
|
name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@8b122486cedac8393e77aa9734c3528886e4a1a8 # v1
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@dc7b9719a96d48369863986a06765841d7ea23f6 # v1
|
||||||
|
-
|
||||||
|
name: Login to Docker Hub
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b # v1
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
-
|
||||||
|
name: Build
|
||||||
|
uses: docker/build-push-action@e551b19e49efd4e98792db7592c17c09b89db8d8 # v2
|
||||||
|
with:
|
||||||
|
context: ./docker
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
file: ./docker/Dockerfile.go_build
|
||||||
|
build-args: TAGS=5BytesOffset,elastic,ydb,gocdk,tikv
|
||||||
|
platforms: linux/amd64
|
||||||
|
tags: ${{ steps.docker_meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.docker_meta.outputs.labels }}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
name: 'Dependency Review'
|
||||||
|
on: [pull_request]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
dependency-review:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: 'Checkout Repository'
|
||||||
|
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
|
||||||
|
- name: 'Dependency Review'
|
||||||
|
uses: actions/dependency-review-action@1c59cdf2a9c7f29c90e8da32237eb04b81bad9f0
|
||||||
@@ -21,7 +21,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Set up Go 1.x
|
- name: Set up Go 1.x
|
||||||
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v2
|
uses: actions/setup-go@b22fbbc2921299758641fab08929b4ac52b32923 # v2
|
||||||
with:
|
with:
|
||||||
go-version: ^1.13
|
go-version: ^1.13
|
||||||
id: go
|
id: go
|
||||||
@@ -32,13 +32,9 @@ jobs:
|
|||||||
- name: Get dependencies
|
- name: Get dependencies
|
||||||
run: |
|
run: |
|
||||||
cd weed; go get -v -t -d ./...
|
cd weed; go get -v -t -d ./...
|
||||||
if [ -f Gopkg.toml ]; then
|
|
||||||
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
|
|
||||||
dep ensure
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cd weed; go build -v .
|
run: cd weed; go build -tags "elastic gocdk sqlite ydb tikv" -v .
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: cd weed; go test -v ./...
|
run: cd weed; go test -tags "elastic gocdk sqlite ydb tikv" -v ./...
|
||||||
@@ -55,6 +55,8 @@ Temporary Items
|
|||||||
# Mongo Explorer plugin:
|
# Mongo Explorer plugin:
|
||||||
# .idea/mongoSettings.xml
|
# .idea/mongoSettings.xml
|
||||||
|
|
||||||
|
## vscode
|
||||||
|
.vscode
|
||||||
## File-based project format:
|
## File-based project format:
|
||||||
*.ipr
|
*.ipr
|
||||||
*.iws
|
*.iws
|
||||||
@@ -75,6 +77,8 @@ com_crashlytics_export_strings.xml
|
|||||||
crashlytics.properties
|
crashlytics.properties
|
||||||
crashlytics-build.properties
|
crashlytics-build.properties
|
||||||
|
|
||||||
|
workspace/
|
||||||
|
|
||||||
test_data
|
test_data
|
||||||
build
|
build
|
||||||
target
|
target
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
BINARY = weed
|
||||||
|
|
||||||
|
SOURCE_DIR = .
|
||||||
|
|
||||||
|
all: install
|
||||||
|
|
||||||
|
install:
|
||||||
|
cd weed; go install
|
||||||
|
|
||||||
|
full_install:
|
||||||
|
cd weed; go install -tags "elastic gocdk sqlite ydb tikv"
|
||||||
|
|
||||||
|
test:
|
||||||
|
cd weed; go test -tags "elastic gocdk sqlite ydb tikv" -v ./...
|
||||||
@@ -31,17 +31,16 @@ Your support will be really appreciated by me and other supporters!
|
|||||||
</p>
|
</p>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
|
||||||
### Gold Sponsors
|
### Gold Sponsors
|
||||||
- [](https://www.nodion.com)
|
- [](https://www.nodion.com)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
- [Download Binaries for different platforms](https://github.com/chrislusf/seaweedfs/releases/latest)
|
- [Download Binaries for different platforms](https://github.com/chrislusf/seaweedfs/releases/latest)
|
||||||
- [SeaweedFS on Slack](https://join.slack.com/t/seaweedfs/shared_invite/enQtMzI4MTMwMjU2MzA3LTEyYzZmZWYzOGQ3MDJlZWMzYmI0OTE4OTJiZjJjODBmMzUxNmYwODg0YjY3MTNlMjBmZDQ1NzQ5NDJhZWI2ZmY)
|
- [SeaweedFS on Slack](https://join.slack.com/t/seaweedfs/shared_invite/enQtMzI4MTMwMjU2MzA3LTEyYzZmZWYzOGQ3MDJlZWMzYmI0OTE4OTJiZjJjODBmMzUxNmYwODg0YjY3MTNlMjBmZDQ1NzQ5NDJhZWI2ZmY)
|
||||||
- [SeaweedFS on Twitter](https://twitter.com/SeaweedFS)
|
- [SeaweedFS on Twitter](https://twitter.com/SeaweedFS)
|
||||||
- [SeaweedFS on Telegram](https://t.me/Seaweedfs)
|
- [SeaweedFS on Telegram](https://t.me/Seaweedfs)
|
||||||
|
- [SeaweedFS on Reddit](https://www.reddit.com/r/SeaweedFS/)
|
||||||
- [SeaweedFS Mailing List](https://groups.google.com/d/forum/seaweedfs)
|
- [SeaweedFS Mailing List](https://groups.google.com/d/forum/seaweedfs)
|
||||||
- [Wiki Documentation](https://github.com/chrislusf/seaweedfs/wiki)
|
- [Wiki Documentation](https://github.com/chrislusf/seaweedfs/wiki)
|
||||||
- [SeaweedFS White Paper](https://github.com/chrislusf/seaweedfs/wiki/SeaweedFS_Architecture.pdf)
|
- [SeaweedFS White Paper](https://github.com/chrislusf/seaweedfs/wiki/SeaweedFS_Architecture.pdf)
|
||||||
@@ -54,12 +53,13 @@ Table of Contents
|
|||||||
* [Quick Start](#quick-start)
|
* [Quick Start](#quick-start)
|
||||||
* [Quick Start for S3 API on Docker](#quick-start-for-s3-api-on-docker)
|
* [Quick Start for S3 API on Docker](#quick-start-for-s3-api-on-docker)
|
||||||
* [Quick Start with Single Binary](#quick-start-with-single-binary)
|
* [Quick Start with Single Binary](#quick-start-with-single-binary)
|
||||||
|
* [Quick Start SeaweedFS S3 on AWS](#quick-start-seaweedfs-s3-on-aws)
|
||||||
* [Introduction](#introduction)
|
* [Introduction](#introduction)
|
||||||
* [Features](#features)
|
* [Features](#features)
|
||||||
* [Additional Features](#additional-features)
|
* [Additional Features](#additional-features)
|
||||||
* [Filer Features](#filer-features)
|
* [Filer Features](#filer-features)
|
||||||
* [Example: Using Seaweed Object Store](#example-Using-Seaweed-Object-Store)
|
* [Example: Using Seaweed Object Store](#example-Using-Seaweed-Object-Store)
|
||||||
* [Architecture](#architecture)
|
* [Architecture](#Object-Store-Architecture)
|
||||||
* [Compared to Other File Systems](#compared-to-other-file-systems)
|
* [Compared to Other File Systems](#compared-to-other-file-systems)
|
||||||
* [Compared to HDFS](#compared-to-hdfs)
|
* [Compared to HDFS](#compared-to-hdfs)
|
||||||
* [Compared to GlusterFS, Ceph](#compared-to-glusterfs-ceph)
|
* [Compared to GlusterFS, Ceph](#compared-to-glusterfs-ceph)
|
||||||
@@ -82,6 +82,9 @@ Table of Contents
|
|||||||
|
|
||||||
Also, to increase capacity, just add more volume servers by running `weed volume -dir="/some/data/dir2" -mserver="<master_host>:9333" -port=8081` locally, or on a different machine, or on thousands of machines. That is it!
|
Also, to increase capacity, just add more volume servers by running `weed volume -dir="/some/data/dir2" -mserver="<master_host>:9333" -port=8081` locally, or on a different machine, or on thousands of machines. That is it!
|
||||||
|
|
||||||
|
## Quick Start SeaweedFS S3 on AWS ##
|
||||||
|
* Setup fast production-ready [SeaweedFS S3 on AWS with cloudformation](https://aws.amazon.com/marketplace/pp/prodview-nzelz5gprlrjc)
|
||||||
|
|
||||||
## Introduction ##
|
## Introduction ##
|
||||||
|
|
||||||
SeaweedFS is a simple and highly scalable distributed file system. There are two objectives:
|
SeaweedFS is a simple and highly scalable distributed file system. There are two objectives:
|
||||||
@@ -105,7 +108,7 @@ Also, SeaweedFS implements erasure coding with ideas from
|
|||||||
|
|
||||||
On top of the object store, optional [Filer] can support directories and POSIX attributes.
|
On top of the object store, optional [Filer] can support directories and POSIX attributes.
|
||||||
Filer is a separate linearly-scalable stateless server with customizable metadata stores,
|
Filer is a separate linearly-scalable stateless server with customizable metadata stores,
|
||||||
e.g., MySql, Postgres, Redis, Cassandra, HBase, Mongodb, Elastic Search, LevelDB, RocksDB, Sqlite, MemSql, TiDB, Etcd, CockroachDB, etc.
|
e.g., MySql, Postgres, Redis, Cassandra, HBase, Mongodb, Elastic Search, LevelDB, RocksDB, Sqlite, MemSql, TiDB, Etcd, CockroachDB, YDB, etc.
|
||||||
|
|
||||||
For any distributed key value stores, the large values can be offloaded to SeaweedFS.
|
For any distributed key value stores, the large values can be offloaded to SeaweedFS.
|
||||||
With the fast access speed and linearly scalable capacity,
|
With the fast access speed and linearly scalable capacity,
|
||||||
@@ -122,7 +125,7 @@ Faster and Cheaper than direct cloud storage!
|
|||||||
## Additional Features ##
|
## Additional Features ##
|
||||||
* Can choose no replication or different replication levels, rack and data center aware.
|
* Can choose no replication or different replication levels, rack and data center aware.
|
||||||
* Automatic master servers failover - no single point of failure (SPOF).
|
* Automatic master servers failover - no single point of failure (SPOF).
|
||||||
* Automatic Gzip compression depending on file mime type.
|
* Automatic Gzip compression depending on file MIME type.
|
||||||
* Automatic compaction to reclaim disk space after deletion or update.
|
* Automatic compaction to reclaim disk space after deletion or update.
|
||||||
* [Automatic entry TTL expiration][VolumeServerTTL].
|
* [Automatic entry TTL expiration][VolumeServerTTL].
|
||||||
* Any server with some disk spaces can add to the total storage space.
|
* Any server with some disk spaces can add to the total storage space.
|
||||||
@@ -201,7 +204,7 @@ SeaweedFS uses HTTP REST operations to read, write, and delete. The responses ar
|
|||||||
|
|
||||||
### Write File ###
|
### Write File ###
|
||||||
|
|
||||||
To upload a file: first, send a HTTP POST, PUT, or GET request to `/dir/assign` to get an `fid` and a volume server url:
|
To upload a file: first, send a HTTP POST, PUT, or GET request to `/dir/assign` to get an `fid` and a volume server URL:
|
||||||
|
|
||||||
```
|
```
|
||||||
> curl http://localhost:9333/dir/assign
|
> curl http://localhost:9333/dir/assign
|
||||||
@@ -250,7 +253,7 @@ First look up the volume server's URLs by the file's volumeId:
|
|||||||
|
|
||||||
Since (usually) there are not too many volume servers, and volumes don't move often, you can cache the results most of the time. Depending on the replication type, one volume can have multiple replica locations. Just randomly pick one location to read.
|
Since (usually) there are not too many volume servers, and volumes don't move often, you can cache the results most of the time. Depending on the replication type, one volume can have multiple replica locations. Just randomly pick one location to read.
|
||||||
|
|
||||||
Now you can take the public url, render the url or directly read from the volume server via url:
|
Now you can take the public URL, render the URL or directly read from the volume server via URL:
|
||||||
|
|
||||||
```
|
```
|
||||||
http://localhost:8080/3,01637037d6.jpg
|
http://localhost:8080/3,01637037d6.jpg
|
||||||
@@ -351,9 +354,9 @@ On each write request, the master server also generates a file key, which is a g
|
|||||||
|
|
||||||
### Write and Read files ###
|
### Write and Read files ###
|
||||||
|
|
||||||
When a client sends a write request, the master server returns (volume id, file key, file cookie, volume node url) for the file. The client then contacts the volume node and POSTs the file content.
|
When a client sends a write request, the master server returns (volume id, file key, file cookie, volume node URL) for the file. The client then contacts the volume node and POSTs the file content.
|
||||||
|
|
||||||
When a client needs to read a file based on (volume id, file key, file cookie), it asks the master server by the volume id for the (volume node url, volume node public url), or retrieves this from a cache. Then the client can GET the content, or just render the URL on web pages and let browsers fetch the content.
|
When a client needs to read a file based on (volume id, file key, file cookie), it asks the master server by the volume id for the (volume node URL, volume node public URL), or retrieves this from a cache. Then the client can GET the content, or just render the URL on web pages and let browsers fetch the content.
|
||||||
|
|
||||||
Please see the example for details on the write-read process.
|
Please see the example for details on the write-read process.
|
||||||
|
|
||||||
@@ -407,7 +410,7 @@ The architectures are mostly the same. SeaweedFS aims to store and read files fa
|
|||||||
|
|
||||||
* SeaweedFS optimizes for small files, ensuring O(1) disk seek operation, and can also handle large files.
|
* SeaweedFS optimizes for small files, ensuring O(1) disk seek operation, and can also handle large files.
|
||||||
* SeaweedFS statically assigns a volume id for a file. Locating file content becomes just a lookup of the volume id, which can be easily cached.
|
* SeaweedFS statically assigns a volume id for a file. Locating file content becomes just a lookup of the volume id, which can be easily cached.
|
||||||
* SeaweedFS Filer metadata store can be any well-known and proven data stores, e.g., Redis, Cassandra, HBase, Mongodb, Elastic Search, MySql, Postgres, Sqlite, MemSql, TiDB, CockroachDB, Etcd etc, and is easy to customized.
|
* SeaweedFS Filer metadata store can be any well-known and proven data store, e.g., Redis, Cassandra, HBase, Mongodb, Elastic Search, MySql, Postgres, Sqlite, MemSql, TiDB, CockroachDB, Etcd, YDB etc, and is easy to customize.
|
||||||
* SeaweedFS Volume server also communicates directly with clients via HTTP, supporting range queries, direct uploads, etc.
|
* SeaweedFS Volume server also communicates directly with clients via HTTP, supporting range queries, direct uploads, etc.
|
||||||
|
|
||||||
| System | File Metadata | File Content Read| POSIX | REST API | Optimized for large number of small files |
|
| System | File Metadata | File Content Read| POSIX | REST API | Optimized for large number of small files |
|
||||||
@@ -443,13 +446,13 @@ Ceph can be setup similar to SeaweedFS as a key->blob store. It is much more com
|
|||||||
|
|
||||||
SeaweedFS has a centralized master group to look up free volumes, while Ceph uses hashing and metadata servers to locate its objects. Having a centralized master makes it easy to code and manage.
|
SeaweedFS has a centralized master group to look up free volumes, while Ceph uses hashing and metadata servers to locate its objects. Having a centralized master makes it easy to code and manage.
|
||||||
|
|
||||||
Same as SeaweedFS, Ceph is also based on the object store RADOS. Ceph is rather complicated with mixed reviews.
|
Ceph, like SeaweedFS, is based on the object store RADOS. Ceph is rather complicated with mixed reviews.
|
||||||
|
|
||||||
Ceph uses CRUSH hashing to automatically manage the data placement, which is efficient to locate the data. But the data has to be placed according to the CRUSH algorithm. Any wrong configuration would cause data loss. Topology changes, such as adding new servers to increase capacity, will cause data migration with high IO cost to fit the CRUSH algorithm. SeaweedFS places data by assigning them to any writable volumes. If writes to one volume failed, just pick another volume to write. Adding more volumes are also as simple as it can be.
|
Ceph uses CRUSH hashing to automatically manage data placement, which is efficient to locate the data. But the data has to be placed according to the CRUSH algorithm. Any wrong configuration would cause data loss. Topology changes, such as adding new servers to increase capacity, will cause data migration with high IO cost to fit the CRUSH algorithm. SeaweedFS places data by assigning them to any writable volumes. If writes to one volume failed, just pick another volume to write. Adding more volumes is also as simple as it can be.
|
||||||
|
|
||||||
SeaweedFS is optimized for small files. Small files are stored as one continuous block of content, with at most 8 unused bytes between files. Small file access is O(1) disk read.
|
SeaweedFS is optimized for small files. Small files are stored as one continuous block of content, with at most 8 unused bytes between files. Small file access is O(1) disk read.
|
||||||
|
|
||||||
SeaweedFS Filer uses off-the-shelf stores, such as MySql, Postgres, Sqlite, Mongodb, Redis, Elastic Search, Cassandra, HBase, MemSql, TiDB, CockroachCB, Etcd, to manage file directories. These stores are proven, scalable, and easier to manage.
|
SeaweedFS Filer uses off-the-shelf stores, such as MySql, Postgres, Sqlite, Mongodb, Redis, Elastic Search, Cassandra, HBase, MemSql, TiDB, CockroachCB, Etcd, YDB, to manage file directories. These stores are proven, scalable, and easier to manage.
|
||||||
|
|
||||||
| SeaweedFS | comparable to Ceph | advantage |
|
| SeaweedFS | comparable to Ceph | advantage |
|
||||||
| ------------- | ------------- | ---------------- |
|
| ------------- | ------------- | ---------------- |
|
||||||
@@ -494,7 +497,7 @@ Step 1: install go on your machine and setup the environment by following the in
|
|||||||
|
|
||||||
https://golang.org/doc/install
|
https://golang.org/doc/install
|
||||||
|
|
||||||
make sure you set up your $GOPATH
|
make sure to define your $GOPATH
|
||||||
|
|
||||||
|
|
||||||
Step 2: checkout this repo:
|
Step 2: checkout this repo:
|
||||||
@@ -531,7 +534,7 @@ Write 1 million 1KB file:
|
|||||||
```
|
```
|
||||||
Concurrency Level: 16
|
Concurrency Level: 16
|
||||||
Time taken for tests: 66.753 seconds
|
Time taken for tests: 66.753 seconds
|
||||||
Complete requests: 1048576
|
Completed requests: 1048576
|
||||||
Failed requests: 0
|
Failed requests: 0
|
||||||
Total transferred: 1106789009 bytes
|
Total transferred: 1106789009 bytes
|
||||||
Requests per second: 15708.23 [#/sec]
|
Requests per second: 15708.23 [#/sec]
|
||||||
@@ -557,7 +560,7 @@ Randomly read 1 million files:
|
|||||||
```
|
```
|
||||||
Concurrency Level: 16
|
Concurrency Level: 16
|
||||||
Time taken for tests: 22.301 seconds
|
Time taken for tests: 22.301 seconds
|
||||||
Complete requests: 1048576
|
Completed requests: 1048576
|
||||||
Failed requests: 0
|
Failed requests: 0
|
||||||
Total transferred: 1106812873 bytes
|
Total transferred: 1106812873 bytes
|
||||||
Requests per second: 47019.38 [#/sec]
|
Requests per second: 47019.38 [#/sec]
|
||||||
|
|||||||
+2
-1
@@ -6,8 +6,9 @@
|
|||||||
<h2 align="center">Generous Backers ($50+)</h2>
|
<h2 align="center">Generous Backers ($50+)</h2>
|
||||||
|
|
||||||
- [Evercam Camera Management Software](https://evercam.io/)
|
- [Evercam Camera Management Software](https://evercam.io/)
|
||||||
|
- [Spherical Elephant GmbH](https://www.sphericalelephant.com)
|
||||||
|
|
||||||
<h2 align="center">Backers</h2>
|
- <h2 align="center">Backers</h2>
|
||||||
|
|
||||||
- [ColorfulClouds Tech Co. Ltd.](https://caiyunai.com/)
|
- [ColorfulClouds Tech Co. Ltd.](https://caiyunai.com/)
|
||||||
- [Haravan - Ecommerce Platform](https://www.haravan.com)
|
- [Haravan - Ecommerce Platform](https://www.haravan.com)
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
FROM golang:1.17-alpine as builder
|
FROM golang:1.18-alpine as builder
|
||||||
RUN apk add git g++ fuse
|
RUN apk add git g++ fuse
|
||||||
RUN mkdir -p /go/src/github.com/chrislusf/
|
RUN mkdir -p /go/src/github.com/chrislusf/
|
||||||
RUN git clone https://github.com/chrislusf/seaweedfs /go/src/github.com/chrislusf/seaweedfs
|
RUN git clone https://github.com/chrislusf/seaweedfs /go/src/github.com/chrislusf/seaweedfs
|
||||||
ARG BRANCH=${BRANCH:-master}
|
ARG BRANCH=${BRANCH:-master}
|
||||||
|
ARG TAGS
|
||||||
RUN cd /go/src/github.com/chrislusf/seaweedfs && git checkout $BRANCH
|
RUN cd /go/src/github.com/chrislusf/seaweedfs && git checkout $BRANCH
|
||||||
RUN cd /go/src/github.com/chrislusf/seaweedfs/weed \
|
RUN cd /go/src/github.com/chrislusf/seaweedfs/weed \
|
||||||
&& export LDFLAGS="-X github.com/chrislusf/seaweedfs/weed/util.COMMIT=$(git rev-parse --short HEAD)" \
|
&& export LDFLAGS="-X github.com/chrislusf/seaweedfs/weed/util.COMMIT=$(git rev-parse --short HEAD)" \
|
||||||
&& CGO_ENABLED=0 go install -ldflags "-extldflags -static ${LDFLAGS}"
|
&& CGO_ENABLED=0 go install -tags "$TAGS" -ldflags "-extldflags -static ${LDFLAGS}"
|
||||||
|
|
||||||
FROM alpine AS final
|
FROM alpine AS final
|
||||||
LABEL author="Chris Lu"
|
LABEL author="Chris Lu"
|
||||||
|
|||||||
@@ -1,43 +0,0 @@
|
|||||||
FROM golang:1.17-alpine as builder
|
|
||||||
RUN apk add git g++ fuse
|
|
||||||
RUN mkdir -p /go/src/github.com/chrislusf/
|
|
||||||
RUN git clone https://github.com/chrislusf/seaweedfs /go/src/github.com/chrislusf/seaweedfs
|
|
||||||
ARG BRANCH=${BRANCH:-master}
|
|
||||||
RUN cd /go/src/github.com/chrislusf/seaweedfs && git checkout $BRANCH
|
|
||||||
RUN cd /go/src/github.com/chrislusf/seaweedfs/weed \
|
|
||||||
&& export LDFLAGS="-X github.com/chrislusf/seaweedfs/weed/util.COMMIT=$(git rev-parse --short HEAD)" \
|
|
||||||
&& CGO_ENABLED=0 go install -tags 5BytesOffset -ldflags "-extldflags -static ${LDFLAGS}"
|
|
||||||
|
|
||||||
FROM alpine AS final
|
|
||||||
LABEL author="Chris Lu"
|
|
||||||
COPY --from=builder /go/bin/weed /usr/bin/
|
|
||||||
RUN mkdir -p /etc/seaweedfs
|
|
||||||
COPY --from=builder /go/src/github.com/chrislusf/seaweedfs/docker/filer.toml /etc/seaweedfs/filer.toml
|
|
||||||
COPY --from=builder /go/src/github.com/chrislusf/seaweedfs/docker/entrypoint.sh /entrypoint.sh
|
|
||||||
RUN apk add fuse # for weed mount
|
|
||||||
|
|
||||||
# volume server gprc port
|
|
||||||
EXPOSE 18080
|
|
||||||
# volume server http port
|
|
||||||
EXPOSE 8080
|
|
||||||
# filer server gprc port
|
|
||||||
EXPOSE 18888
|
|
||||||
# filer server http port
|
|
||||||
EXPOSE 8888
|
|
||||||
# master server shared gprc port
|
|
||||||
EXPOSE 19333
|
|
||||||
# master server shared http port
|
|
||||||
EXPOSE 9333
|
|
||||||
# s3 server http port
|
|
||||||
EXPOSE 8333
|
|
||||||
# webdav server http port
|
|
||||||
EXPOSE 7333
|
|
||||||
|
|
||||||
RUN mkdir -p /data/filerldb2
|
|
||||||
|
|
||||||
VOLUME /data
|
|
||||||
WORKDIR /data
|
|
||||||
|
|
||||||
RUN chmod +x /entrypoint.sh
|
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
FROM golang:1.17-buster as builder
|
FROM golang:1.18-buster as builder
|
||||||
|
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get install -y build-essential libsnappy-dev zlib1g-dev libbz2-dev libgflags-dev liblz4-dev libzstd-dev
|
RUN apt-get install -y build-essential libsnappy-dev zlib1g-dev libbz2-dev libgflags-dev liblz4-dev libzstd-dev
|
||||||
|
|
||||||
ENV ROCKSDB_VERSION v7.0.4
|
ENV ROCKSDB_VERSION v7.2.2
|
||||||
|
|
||||||
# build RocksDB
|
# build RocksDB
|
||||||
RUN cd /tmp && \
|
RUN cd /tmp && \
|
||||||
|
|||||||
@@ -28,4 +28,4 @@ ENV \
|
|||||||
S3TEST_CONF="/s3test.conf"
|
S3TEST_CONF="/s3test.conf"
|
||||||
|
|
||||||
ENTRYPOINT ["/bin/bash", "-c"]
|
ENTRYPOINT ["/bin/bash", "-c"]
|
||||||
CMD ["sleep 10 && exec ./virtualenv/bin/nosetests ${NOSETESTS_OPTIONS-} ${NOSETESTS_ATTR:+-a $NOSETESTS_ATTR} ${NOSETESTS_EXCLUDE:+-e $NOSETESTS_EXCLUDE}"]
|
CMD ["sleep 30 && exec ./virtualenv/bin/nosetests ${NOSETESTS_OPTIONS-} ${NOSETESTS_ATTR:+-a $NOSETESTS_ATTR} ${NOSETESTS_EXCLUDE:+-e $NOSETESTS_EXCLUDE}"]
|
||||||
+24
-4
@@ -7,14 +7,17 @@ gen: dev
|
|||||||
binary:
|
binary:
|
||||||
export SWCOMMIT=$(shell git rev-parse --short HEAD)
|
export SWCOMMIT=$(shell git rev-parse --short HEAD)
|
||||||
export SWLDFLAGS="-X github.com/chrislusf/seaweedfs/weed/util.COMMIT=$(SWCOMMIT)"
|
export SWLDFLAGS="-X github.com/chrislusf/seaweedfs/weed/util.COMMIT=$(SWCOMMIT)"
|
||||||
cd ../weed; CGO_ENABLED=0 GOOS=linux go build -ldflags "-extldflags -static $(SWLDFLAGS)"; mv weed ../docker/
|
cd ../weed; CGO_ENABLED=0 GOOS=linux go build -tags "$(tags)" -ldflags "-extldflags -static $(SWLDFLAGS)"; mv weed ../docker/
|
||||||
|
|
||||||
build: binary
|
build: binary
|
||||||
docker build --no-cache -t chrislusf/seaweedfs:local -f Dockerfile.local .
|
docker build --no-cache -t chrislusf/seaweedfs:local -f Dockerfile.local .
|
||||||
rm ./weed
|
rm ./weed
|
||||||
|
|
||||||
build_gorocksdb:
|
go_build: # make go_build tags=elastic,ydb,gocdk,hdfs,5BytesOffset
|
||||||
docker build --no-cache -t chrislusf/gorocksdb -f Dockerfile.go_rocksdb .
|
docker build --build-arg TAGS=$(tags) --no-cache -t chrislusf/seaweedfs:go_build -f Dockerfile.go_build .
|
||||||
|
|
||||||
|
go_build_large_disk:
|
||||||
|
docker build --build-arg TAGS=large_disk --no-cache -t chrislusf/seaweedfs:large_disk -f Dockerfile.go_build .
|
||||||
|
|
||||||
build_rocksdb:
|
build_rocksdb:
|
||||||
docker build --no-cache -t chrislusf/seaweedfs:rocksdb -f Dockerfile.rocksdb_large .
|
docker build --no-cache -t chrislusf/seaweedfs:rocksdb -f Dockerfile.rocksdb_large .
|
||||||
@@ -49,18 +52,35 @@ dev_replicate: build
|
|||||||
dev_auditlog: build
|
dev_auditlog: build
|
||||||
docker-compose -f compose/local-auditlog-compose.yml -p seaweedfs up
|
docker-compose -f compose/local-auditlog-compose.yml -p seaweedfs up
|
||||||
|
|
||||||
|
dev_nextcloud: build
|
||||||
|
docker-compose -f compose/local-nextcloud-compose.yml -p seaweedfs up
|
||||||
|
|
||||||
cluster: build
|
cluster: build
|
||||||
docker-compose -f compose/local-cluster-compose.yml -p seaweedfs up
|
docker-compose -f compose/local-cluster-compose.yml -p seaweedfs up
|
||||||
|
|
||||||
2clusters: build
|
2clusters: build
|
||||||
docker-compose -f compose/local-clusters-compose.yml -p seaweedfs up
|
docker-compose -f compose/local-clusters-compose.yml -p seaweedfs up
|
||||||
|
|
||||||
|
2mount: build
|
||||||
|
docker-compose -f compose/local-sync-mount-compose.yml -p seaweedfs up
|
||||||
|
|
||||||
|
hashicorp_raft: build
|
||||||
|
docker-compose -f compose/local-hashicorp-raft-compose.yml -p seaweedfs up
|
||||||
|
|
||||||
s3tests: build s3tests_build
|
s3tests: build s3tests_build
|
||||||
docker-compose -f compose/local-s3tests-compose.yml -p seaweedfs up
|
docker-compose -f compose/local-s3tests-compose.yml -p seaweedfs up
|
||||||
|
|
||||||
filer_etcd: build
|
filer_etcd: build
|
||||||
docker stack deploy -c compose/swarm-etcd.yml fs
|
docker stack deploy -c compose/swarm-etcd.yml fs
|
||||||
|
|
||||||
|
test_etcd: build
|
||||||
|
docker-compose -f compose/test-etcd-filer.yml -p seaweedfs up
|
||||||
|
|
||||||
|
test_ydb: tags = ydb
|
||||||
|
test_ydb: build
|
||||||
|
export
|
||||||
|
docker-compose -f compose/test-ydb-filer.yml -p seaweedfs up
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm ./weed
|
rm ./weed
|
||||||
|
|
||||||
@@ -74,4 +94,4 @@ certstrap:
|
|||||||
certstrap --depot-path compose/tls sign --CA "SeaweedFS CA" volume01.dev || true
|
certstrap --depot-path compose/tls sign --CA "SeaweedFS CA" volume01.dev || true
|
||||||
certstrap --depot-path compose/tls sign --CA "SeaweedFS CA" master01.dev || true
|
certstrap --depot-path compose/tls sign --CA "SeaweedFS CA" master01.dev || true
|
||||||
certstrap --depot-path compose/tls sign --CA "SeaweedFS CA" filer01.dev || true
|
certstrap --depot-path compose/tls sign --CA "SeaweedFS CA" filer01.dev || true
|
||||||
certstrap --depot-path compose/tls sign --CA "SeaweedFS CA" client01.dev || true
|
certstrap --depot-path compose/tls sign --CA "SeaweedFS CA" client01.dev || true
|
||||||
@@ -28,6 +28,13 @@ cd $GOPATH/src/github.com/chrislusf/seaweedfs/docker
|
|||||||
make
|
make
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### S3 cmd
|
||||||
|
|
||||||
|
list
|
||||||
|
```
|
||||||
|
s3cmd --no-ssl --host=127.0.0.1:8333 ls s3://
|
||||||
|
```
|
||||||
|
|
||||||
## Build and push a multiarch build
|
## Build and push a multiarch build
|
||||||
|
|
||||||
Make sure that `docker buildx` is supported (might be an experimental docker feature)
|
Make sure that `docker buildx` is supported (might be an experimental docker feature)
|
||||||
@@ -37,3 +44,8 @@ docker buildx build --pull --push --platform linux/386,linux/amd64,linux/arm64,l
|
|||||||
docker buildx stop $BUILDER
|
docker buildx stop $BUILDER
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Minio debuging
|
||||||
|
```
|
||||||
|
mc config host add local http://127.0.0.1:9000 some_access_key1 some_secret_key1
|
||||||
|
mc admin trace --all --verbose local
|
||||||
|
```
|
||||||
@@ -29,7 +29,7 @@ services:
|
|||||||
- 8111:8111
|
- 8111:8111
|
||||||
- 8888:8888
|
- 8888:8888
|
||||||
- 18888:18888
|
- 18888:18888
|
||||||
command: '-v=1 filer -master="master:9333" -iam'
|
command: '-v=1 filer -ip.bind=0.0.0.0 -master="master:9333" -iam -iam.ip=filer'
|
||||||
depends_on:
|
depends_on:
|
||||||
- master
|
- master
|
||||||
- volume
|
- volume
|
||||||
@@ -41,7 +41,7 @@ services:
|
|||||||
image: chrislusf/seaweedfs:local
|
image: chrislusf/seaweedfs:local
|
||||||
ports:
|
ports:
|
||||||
- 8333:8333
|
- 8333:8333
|
||||||
command: '-v=1 s3 -filer="filer:8888"'
|
command: '-v=1 s3 -filer="filer:8888" -ip.bind=s3'
|
||||||
depends_on:
|
depends_on:
|
||||||
- master
|
- master
|
||||||
- volume
|
- volume
|
||||||
|
|||||||
@@ -0,0 +1,89 @@
|
|||||||
|
version: '2'
|
||||||
|
|
||||||
|
services:
|
||||||
|
master0:
|
||||||
|
image: chrislusf/seaweedfs:local
|
||||||
|
ports:
|
||||||
|
- 9333:9333
|
||||||
|
- 19333:19333
|
||||||
|
command: "-v=4 master -volumeSizeLimitMB 100 -raftHashicorp -ip=master0 -port=9333 -peers=master1:9334,master2:9335 -mdir=/data"
|
||||||
|
volumes:
|
||||||
|
- ./master/0:/data
|
||||||
|
environment:
|
||||||
|
WEED_MASTER_VOLUME_GROWTH_COPY_1: 1
|
||||||
|
WEED_MASTER_VOLUME_GROWTH_COPY_2: 2
|
||||||
|
WEED_MASTER_VOLUME_GROWTH_COPY_OTHER: 1
|
||||||
|
master1:
|
||||||
|
image: chrislusf/seaweedfs:local
|
||||||
|
ports:
|
||||||
|
- 9334:9334
|
||||||
|
- 19334:19334
|
||||||
|
command: "-v=4 master -volumeSizeLimitMB 100 -raftHashicorp -ip=master1 -port=9334 -peers=master0:9333,master2:9335 -mdir=/data"
|
||||||
|
volumes:
|
||||||
|
- ./master/1:/data
|
||||||
|
environment:
|
||||||
|
WEED_MASTER_VOLUME_GROWTH_COPY_1: 1
|
||||||
|
WEED_MASTER_VOLUME_GROWTH_COPY_2: 2
|
||||||
|
WEED_MASTER_VOLUME_GROWTH_COPY_OTHER: 1
|
||||||
|
master2:
|
||||||
|
image: chrislusf/seaweedfs:local
|
||||||
|
ports:
|
||||||
|
- 9335:9335
|
||||||
|
- 19335:19335
|
||||||
|
command: "-v=4 master -volumeSizeLimitMB 100 -raftHashicorp -ip=master2 -port=9335 -peers=master0:9333,master1:9334 -mdir=/data"
|
||||||
|
volumes:
|
||||||
|
- ./master/2:/data
|
||||||
|
environment:
|
||||||
|
WEED_MASTER_VOLUME_GROWTH_COPY_1: 1
|
||||||
|
WEED_MASTER_VOLUME_GROWTH_COPY_2: 2
|
||||||
|
WEED_MASTER_VOLUME_GROWTH_COPY_OTHER: 1
|
||||||
|
volume1:
|
||||||
|
image: chrislusf/seaweedfs:local
|
||||||
|
ports:
|
||||||
|
- 8080:8080
|
||||||
|
- 18080:18080
|
||||||
|
command: 'volume -dataCenter=dc1 -rack=v1 -mserver="master0:9333,master1:9334,master2:9335" -port=8080 -ip=volume1 -publicUrl=localhost:8080 -preStopSeconds=1'
|
||||||
|
depends_on:
|
||||||
|
- master0
|
||||||
|
- master1
|
||||||
|
volume2:
|
||||||
|
image: chrislusf/seaweedfs:local
|
||||||
|
ports:
|
||||||
|
- 8082:8082
|
||||||
|
- 18082:18082
|
||||||
|
command: 'volume -dataCenter=dc2 -rack=v2 -mserver="master0:9333,master1:9334,master2:9335" -port=8082 -ip=volume2 -publicUrl=localhost:8082 -preStopSeconds=1'
|
||||||
|
depends_on:
|
||||||
|
- master0
|
||||||
|
- master1
|
||||||
|
volume3:
|
||||||
|
image: chrislusf/seaweedfs:local
|
||||||
|
ports:
|
||||||
|
- 8083:8083
|
||||||
|
- 18083:18083
|
||||||
|
command: 'volume -dataCenter=dc3 -rack=v3 -mserver="master0:9333,master1:9334,master2:9335" -port=8083 -ip=volume3 -publicUrl=localhost:8083 -preStopSeconds=1'
|
||||||
|
depends_on:
|
||||||
|
- master0
|
||||||
|
- master1
|
||||||
|
filer:
|
||||||
|
image: chrislusf/seaweedfs:local
|
||||||
|
ports:
|
||||||
|
- 8888:8888
|
||||||
|
- 18888:18888
|
||||||
|
- 8111:8111
|
||||||
|
command: 'filer -defaultReplicaPlacement=100 -iam -master="master0:9333,master1:9334,master2:9335"'
|
||||||
|
depends_on:
|
||||||
|
- master0
|
||||||
|
- master1
|
||||||
|
- volume1
|
||||||
|
- volume2
|
||||||
|
s3:
|
||||||
|
image: chrislusf/seaweedfs:local
|
||||||
|
ports:
|
||||||
|
- 8333:8333
|
||||||
|
command: '-v=9 s3 -ip.bind="s3" -filer="filer:8888"'
|
||||||
|
depends_on:
|
||||||
|
- master0
|
||||||
|
- master1
|
||||||
|
- volume1
|
||||||
|
- volume2
|
||||||
|
- filer
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
version: '2'
|
||||||
|
|
||||||
|
services:
|
||||||
|
master:
|
||||||
|
image: chrislusf/seaweedfs:local
|
||||||
|
ports:
|
||||||
|
- 9333:9333
|
||||||
|
- 19333:19333
|
||||||
|
command: "master -ip=master"
|
||||||
|
volume:
|
||||||
|
image: chrislusf/seaweedfs:local
|
||||||
|
ports:
|
||||||
|
- 8080:8080
|
||||||
|
- 18080:18080
|
||||||
|
command: "volume -mserver=master:9333 -port=8080 -ip=volume"
|
||||||
|
depends_on:
|
||||||
|
- master
|
||||||
|
s3:
|
||||||
|
image: chrislusf/seaweedfs:local
|
||||||
|
ports:
|
||||||
|
- 8888:8888
|
||||||
|
- 18888:18888
|
||||||
|
- 8333:8333
|
||||||
|
command: '-v 9 filer -master="master:9333" -s3'
|
||||||
|
depends_on:
|
||||||
|
- master
|
||||||
|
- volume
|
||||||
|
nextcloud:
|
||||||
|
image: nextcloud:23.0.5-apache
|
||||||
|
environment:
|
||||||
|
- OBJECTSTORE_S3_HOST=s3
|
||||||
|
- OBJECTSTORE_S3_BUCKET=nextcloud
|
||||||
|
- OBJECTSTORE_S3_KEY=some_access_key1
|
||||||
|
- OBJECTSTORE_S3_SECRET=some_secret_key1
|
||||||
|
- OBJECTSTORE_S3_PORT=8333
|
||||||
|
- OBJECTSTORE_S3_SSL=false
|
||||||
|
- OBJECTSTORE_S3_USEPATH_STYLE=true
|
||||||
|
- SQLITE_DATABASE=nextcloud
|
||||||
|
- NEXTCLOUD_ADMIN_USER=admin
|
||||||
|
- NEXTCLOUD_ADMIN_PASSWORD=admin
|
||||||
|
ports:
|
||||||
|
- 80:80
|
||||||
|
depends_on:
|
||||||
|
- s3
|
||||||
@@ -37,8 +37,8 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
S3TEST_CONF: "s3tests.conf"
|
S3TEST_CONF: "s3tests.conf"
|
||||||
NOSETESTS_OPTIONS: "--verbose --logging-level=ERROR --with-xunit --failure-detail s3tests_boto3.functional.test_s3"
|
NOSETESTS_OPTIONS: "--verbose --logging-level=ERROR --with-xunit --failure-detail s3tests_boto3.functional.test_s3"
|
||||||
NOSETESTS_ATTR: "!tagging,!fails_on_aws,!encryption,!bucket-policy,!versioning,!fails_on_rgw,!bucket-policy,!fails_with_subdomain,!policy_status,!object-lock,!lifecycle,!cors,!user-policy"
|
NOSETESTS_ATTR: "!fails_on_aws,!encryption,!bucket-policy,!versioning,!fails_on_rgw,!bucket-policy,!fails_with_subdomain,!policy_status,!object-lock,!lifecycle,!cors,!user-policy"
|
||||||
NOSETESTS_EXCLUDE: "(get_bucket_encryption|put_bucket_encryption|bucket_list_delimiter_basic|bucket_listv2_delimiter_basic|bucket_listv2_encoding_basic|bucket_list_encoding_basic|bucket_list_delimiter_prefix|bucket_listv2_delimiter_prefix_ends_with_delimiter|bucket_list_delimiter_prefix_ends_with_delimiter|bucket_list_delimiter_alt|bucket_listv2_delimiter_alt|bucket_list_delimiter_prefix_underscore|bucket_list_delimiter_percentage|bucket_listv2_delimiter_percentage|bucket_list_delimiter_whitespace|bucket_listv2_delimiter_whitespace|bucket_list_delimiter_dot|bucket_listv2_delimiter_dot|bucket_list_delimiter_unreadable|bucket_listv2_delimiter_unreadable|bucket_listv2_fetchowner_defaultempty|bucket_listv2_fetchowner_empty|bucket_list_prefix_delimiter_alt|bucket_listv2_prefix_delimiter_alt|bucket_list_prefix_delimiter_prefix_not_exist|bucket_listv2_prefix_delimiter_prefix_not_exist|bucket_list_prefix_delimiter_delimiter_not_exist|bucket_listv2_prefix_delimiter_delimiter_not_exist|bucket_list_prefix_delimiter_prefix_delimiter_not_exist|bucket_listv2_prefix_delimiter_prefix_delimiter_not_exist|bucket_list_maxkeys_none|bucket_listv2_maxkeys_none|bucket_list_maxkeys_invalid|bucket_listv2_continuationtoken_empty|bucket_list_return_data|bucket_list_objects_anonymous|bucket_listv2_objects_anonymous|bucket_concurrent_set_canned_acl|object_write_to_nonexist_bucket|object_requestid_matches_header_on_error|object_set_get_metadata_none_to_good|object_set_get_metadata_none_to_empty|object_set_get_metadata_overwrite_to_empty|post_object_anonymous_request|post_object_authenticated_request|post_object_authenticated_no_content_type|post_object_authenticated_request_bad_access_key|post_object_set_success_code|post_object_set_invalid_success_code|post_object_upload_larger_than_chunk|post_object_set_key_from_filename|post_object_ignored_header|post_object_case_insensitive_condition_fields|post_object_escaped_field_values|post_object_success_redirect_action|post_object_invalid_signature|post_object_invalid_access_key|post_object_missing_policy_condition|post_object_user_specified_header|post_object_request_missing_policy_specified_field|post_object_expired_policy|post_object_invalid_request_field_value|get_object_ifunmodifiedsince_good|put_object_ifmatch_failed|object_raw_get_bucket_gone|object_delete_key_bucket_gone|object_raw_get_bucket_acl|object_raw_get_object_acl|object_raw_response_headers|object_raw_authenticated_bucket_gone|object_raw_get_x_amz_expires_out_max_range|object_raw_get_x_amz_expires_out_positive_range|object_anon_put_write_access|object_raw_put_authenticated_expired|bucket_create_exists|bucket_create_naming_bad_short_one|bucket_create_naming_bad_short_two|bucket_get_location|bucket_acl_default|bucket_acl_canned|bucket_acl_canned_publicreadwrite|bucket_acl_canned_authenticatedread|object_acl_default|object_acl_canned_during_create|object_acl_canned|object_acl_canned_publicreadwrite|object_acl_canned_authenticatedread|object_acl_canned_bucketownerread|object_acl_canned_bucketownerfullcontrol|object_acl_full_control_verify_attributes|bucket_acl_canned_private_to_private|bucket_acl_grant_nonexist_user|bucket_acl_no_grants|bucket_acl_grant_email_not_exist|bucket_acl_revoke_all|bucket_recreate_not_overriding|object_copy_verify_contenttype|object_copy_to_itself_with_metadata|object_copy_not_owned_bucket|object_copy_not_owned_object_bucket|object_copy_retaining_metadata|object_copy_replacing_metadata|multipart_upload_empty|multipart_copy_invalid_range|multipart_copy_special_names|multipart_upload_resend_part|multipart_upload_size_too_small|abort_multipart_upload_not_found|multipart_upload_missing_part|100_continue|ranged_request_invalid_range|ranged_request_empty_object|access_bucket|list_multipart_upload_owner|multipart_upload_small)"
|
NOSETESTS_EXCLUDE: "(post_object_tags_anonymous_request|get_obj_tagging|set_bucket_tagging|post_object_tags_authenticated_request|put_max_tags|put_modify_tags|test_put_obj_with_tags|get_bucket_encryption|delete_bucket_encryption|put_bucket_encryption|bucket_list_delimiter_basic|bucket_listv2_delimiter_basic|bucket_listv2_encoding_basic|bucket_list_encoding_basic|bucket_list_delimiter_prefix|bucket_listv2_delimiter_prefix_ends_with_delimiter|bucket_list_delimiter_prefix_ends_with_delimiter|bucket_list_delimiter_alt|bucket_listv2_delimiter_alt|bucket_list_delimiter_prefix_underscore|bucket_list_delimiter_percentage|bucket_listv2_delimiter_percentage|bucket_list_delimiter_whitespace|bucket_listv2_delimiter_whitespace|bucket_list_delimiter_dot|bucket_listv2_delimiter_dot|bucket_list_delimiter_unreadable|bucket_listv2_delimiter_unreadable|bucket_listv2_fetchowner_defaultempty|bucket_listv2_fetchowner_empty|bucket_list_prefix_delimiter_alt|bucket_listv2_prefix_delimiter_alt|bucket_list_prefix_delimiter_prefix_not_exist|bucket_listv2_prefix_delimiter_prefix_not_exist|bucket_list_prefix_delimiter_delimiter_not_exist|bucket_listv2_prefix_delimiter_delimiter_not_exist|bucket_list_prefix_delimiter_prefix_delimiter_not_exist|bucket_listv2_prefix_delimiter_prefix_delimiter_not_exist|bucket_list_maxkeys_none|bucket_listv2_maxkeys_none|bucket_list_maxkeys_invalid|bucket_listv2_continuationtoken_empty|bucket_list_return_data|bucket_list_objects_anonymous|bucket_listv2_objects_anonymous|bucket_concurrent_set_canned_acl|object_write_to_nonexist_bucket|object_requestid_matches_header_on_error|object_set_get_metadata_none_to_good|object_set_get_metadata_none_to_empty|object_set_get_metadata_overwrite_to_empty|post_object_anonymous_request|post_object_authenticated_request|post_object_authenticated_no_content_type|post_object_authenticated_request_bad_access_key|post_object_set_success_code|post_object_set_invalid_success_code|post_object_upload_larger_than_chunk|post_object_set_key_from_filename|post_object_ignored_header|post_object_case_insensitive_condition_fields|post_object_escaped_field_values|post_object_success_redirect_action|post_object_invalid_signature|post_object_invalid_access_key|post_object_missing_policy_condition|post_object_user_specified_header|post_object_request_missing_policy_specified_field|post_object_expired_policy|post_object_invalid_request_field_value|get_object_ifunmodifiedsince_good|put_object_ifmatch_failed|object_raw_get_bucket_gone|object_delete_key_bucket_gone|object_raw_get_bucket_acl|object_raw_get_object_acl|object_raw_response_headers|object_raw_authenticated_bucket_gone|object_raw_get_x_amz_expires_out_max_range|object_raw_get_x_amz_expires_out_positive_range|object_anon_put_write_access|object_raw_put_authenticated_expired|bucket_create_exists|bucket_create_naming_bad_short_one|bucket_create_naming_bad_short_two|bucket_get_location|bucket_acl_default|bucket_acl_canned|bucket_acl_canned_publicreadwrite|bucket_acl_canned_authenticatedread|object_acl_default|object_acl_canned_during_create|object_acl_canned|object_acl_canned_publicreadwrite|object_acl_canned_authenticatedread|object_acl_canned_bucketownerread|object_acl_canned_bucketownerfullcontrol|object_acl_full_control_verify_attributes|bucket_acl_canned_private_to_private|bucket_acl_grant_nonexist_user|bucket_acl_no_grants|bucket_acl_grant_email_not_exist|bucket_acl_revoke_all|bucket_recreate_not_overriding|object_copy_verify_contenttype|object_copy_to_itself_with_metadata|object_copy_not_owned_bucket|object_copy_not_owned_object_bucket|object_copy_retaining_metadata|object_copy_replacing_metadata|multipart_upload_empty|multipart_copy_invalid_range|multipart_copy_special_names|multipart_upload_resend_part|multipart_upload_size_too_small|abort_multipart_upload_not_found|multipart_upload_missing_part|100_continue|ranged_request_invalid_range|ranged_request_empty_object|access_bucket|list_multipart_upload_owner|multipart_upload_small)"
|
||||||
depends_on:
|
depends_on:
|
||||||
- master
|
- master
|
||||||
- volume
|
- volume
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
version: '3.9'
|
||||||
|
services:
|
||||||
|
node1:
|
||||||
|
image: chrislusf/seaweedfs:local
|
||||||
|
command: "server -master -volume -filer"
|
||||||
|
mount1:
|
||||||
|
image: chrislusf/seaweedfs:local
|
||||||
|
privileged: true
|
||||||
|
command: "mount -filer=node1:8888 -dir=/mnt -dirAutoCreate"
|
||||||
|
node2:
|
||||||
|
image: chrislusf/seaweedfs:local
|
||||||
|
ports:
|
||||||
|
- 7888:8888
|
||||||
|
command: "server -master -volume -filer"
|
||||||
|
mount2:
|
||||||
|
image: chrislusf/seaweedfs:local
|
||||||
|
privileged: true
|
||||||
|
command: "mount -filer=node2:8888 -dir=/mnt -dirAutoCreate"
|
||||||
|
sync:
|
||||||
|
image: chrislusf/seaweedfs:local
|
||||||
|
command: "-v=4 filer.sync -a=node1:8888 -b=node2:8888 -a.debug -b.debug"
|
||||||
@@ -28,3 +28,4 @@ sleep_minutes = 17 # sleep minutes between each script execution
|
|||||||
region = "us-east-2"
|
region = "us-east-2"
|
||||||
bucket = "volume_bucket" # an existing bucket
|
bucket = "volume_bucket" # an existing bucket
|
||||||
endpoint = "http://server2:8333"
|
endpoint = "http://server2:8333"
|
||||||
|
storage_class = "STANDARD_IA"
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
version: '2'
|
||||||
|
|
||||||
|
services:
|
||||||
|
etcd:
|
||||||
|
image: quay.io/coreos/etcd:v3.5.4
|
||||||
|
command: "etcd --advertise-client-urls http://etcd:2379 --listen-client-urls http://0.0.0.0:2379"
|
||||||
|
ports:
|
||||||
|
- 2379:2379
|
||||||
|
master:
|
||||||
|
image: chrislusf/seaweedfs:local
|
||||||
|
ports:
|
||||||
|
- 9333:9333
|
||||||
|
- 19333:19333
|
||||||
|
command: "master -ip=master -volumeSizeLimitMB=1024"
|
||||||
|
volume:
|
||||||
|
image: chrislusf/seaweedfs:local
|
||||||
|
ports:
|
||||||
|
- 8080:8080
|
||||||
|
- 18080:18080
|
||||||
|
command: "volume -mserver=master:9333 -port=8080 -ip=volume -max=0 -preStopSeconds=1"
|
||||||
|
depends_on:
|
||||||
|
- master
|
||||||
|
s3:
|
||||||
|
image: chrislusf/seaweedfs:local
|
||||||
|
ports:
|
||||||
|
- 8888:8888
|
||||||
|
- 18888:18888
|
||||||
|
- 8333:8333
|
||||||
|
command: '-v 9 filer -master="master:9333" -s3 -s3.config=/etc/seaweedfs/s3.json -s3.port=8333'
|
||||||
|
environment:
|
||||||
|
WEED_LEVELDB2_ENABLED: 'false'
|
||||||
|
WEED_ETCD_ENABLED: 'true'
|
||||||
|
WEED_ETCD_SERVERS: "http://etcd:2379"
|
||||||
|
volumes:
|
||||||
|
- ./s3.json:/etc/seaweedfs/s3.json
|
||||||
|
depends_on:
|
||||||
|
- etcd
|
||||||
|
- master
|
||||||
|
- volume
|
||||||
|
registry:
|
||||||
|
image: registry:2
|
||||||
|
environment:
|
||||||
|
REGISTRY_HTTP_ADDR: "0.0.0.0:5001" # seaweedfs s3
|
||||||
|
REGISTRY_LOG_LEVEL: "debug"
|
||||||
|
REGISTRY_STORAGE: "s3"
|
||||||
|
REGISTRY_STORAGE_S3_REGION: "us-east-1"
|
||||||
|
REGISTRY_STORAGE_S3_REGIONENDPOINT: "http://s3:8333"
|
||||||
|
REGISTRY_STORAGE_S3_BUCKET: "registry"
|
||||||
|
REGISTRY_STORAGE_S3_ACCESSKEY: "some_access_key1"
|
||||||
|
REGISTRY_STORAGE_S3_SECRETKEY: "some_secret_key1"
|
||||||
|
REGISTRY_STORAGE_S3_V4AUTH: "true"
|
||||||
|
REGISTRY_STORAGE_S3_SECURE: "false"
|
||||||
|
REGISTRY_STORAGE_S3_SKIPVERIFY: "true"
|
||||||
|
REGISTRY_STORAGE_S3_ROOTDIRECTORY: "/"
|
||||||
|
REGISTRY_STORAGE_DELETE_ENABLED: "true"
|
||||||
|
REGISTRY_STORAGE_REDIRECT_DISABLE: "true"
|
||||||
|
REGISTRY_VALIDATION_DISABLED: "true"
|
||||||
|
ports:
|
||||||
|
- 5001:5001
|
||||||
|
depends_on:
|
||||||
|
- s3
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
version: '2'
|
||||||
|
|
||||||
|
services:
|
||||||
|
ydb:
|
||||||
|
image: cr.yandex/yc/yandex-docker-local-ydb
|
||||||
|
ports:
|
||||||
|
- 2135:2135
|
||||||
|
- 8765:8765
|
||||||
|
- 2136:2136
|
||||||
|
environment:
|
||||||
|
- YDB_DEFAULT_LOG_LEVEL=DEBUG
|
||||||
|
- GRPC_TLS_PORT=2135
|
||||||
|
- GRPC_PORT=2136
|
||||||
|
- MON_PORT=8765
|
||||||
|
s3:
|
||||||
|
image: chrislusf/seaweedfs:local
|
||||||
|
ports:
|
||||||
|
- 9333:9333
|
||||||
|
- 19333:19333
|
||||||
|
- 8888:8888
|
||||||
|
- 8000:8000
|
||||||
|
- 18888:18888
|
||||||
|
command: "server -ip=s3 -filer -master.volumeSizeLimitMB=16 -volume.max=0 -volume -volume.preStopSeconds=1 -s3 -s3.config=/etc/seaweedfs/s3.json -s3.port=8000 -s3.allowEmptyFolder=false -s3.allowDeleteBucketNotEmpty=false"
|
||||||
|
volumes:
|
||||||
|
- ./s3.json:/etc/seaweedfs/s3.json
|
||||||
|
environment:
|
||||||
|
WEED_LEVELDB2_ENABLED: "false"
|
||||||
|
WEED_YDB_ENABLED: "true"
|
||||||
|
WEED_YDB_DSN: "grpc://ydb:2136/?database=local"
|
||||||
|
WEED_YDB_PREFIX: "seaweedfs"
|
||||||
|
YDB_ANONYMOUS_CREDENTIALS: 1
|
||||||
|
WEED_MASTER_VOLUME_GROWTH_COPY_1: 1
|
||||||
|
WEED_MASTER_VOLUME_GROWTH_COPY_OTHER: 1
|
||||||
|
depends_on:
|
||||||
|
- ydb
|
||||||
@@ -11,4 +11,6 @@ WEED_GRPC_CLIENT_KEY=/etc/seaweedfs/tls/client01.dev.key
|
|||||||
WEED_GRPC_MASTER_ALLOWED_COMMONNAMES="volume01.dev,master01.dev,filer01.dev,client01.dev"
|
WEED_GRPC_MASTER_ALLOWED_COMMONNAMES="volume01.dev,master01.dev,filer01.dev,client01.dev"
|
||||||
WEED_GRPC_VOLUME_ALLOWED_COMMONNAMES="volume01.dev,master01.dev,filer01.dev,client01.dev"
|
WEED_GRPC_VOLUME_ALLOWED_COMMONNAMES="volume01.dev,master01.dev,filer01.dev,client01.dev"
|
||||||
WEED_GRPC_FILER_ALLOWED_COMMONNAMES="volume01.dev,master01.dev,filer01.dev,client01.dev"
|
WEED_GRPC_FILER_ALLOWED_COMMONNAMES="volume01.dev,master01.dev,filer01.dev,client01.dev"
|
||||||
WEED_GRPC_CLIENT_ALLOWED_COMMONNAMES="volume01.dev,master01.dev,filer01.dev,client01.dev"
|
WEED_GRPC_CLIENT_ALLOWED_COMMONNAMES="volume01.dev,master01.dev,filer01.dev,client01.dev"
|
||||||
|
#GRPC_GO_LOG_SEVERITY_LEVEL=info
|
||||||
|
#GRPC_GO_LOG_VERBOSITY_LEVEL=2
|
||||||
@@ -57,6 +57,12 @@ case "$1" in
|
|||||||
exec /usr/bin/weed -logtostderr=true s3 $ARGS $@
|
exec /usr/bin/weed -logtostderr=true s3 $ARGS $@
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
'shell')
|
||||||
|
ARGS="-cluster=$SHELL_CLUSTER -filer=$SHELL_FILER -filerGroup=$SHELL_FILER_GROUP -master=$SHELL_MASTER -options=$SHELL_OPTIONS"
|
||||||
|
shift
|
||||||
|
exec echo "$@" | /usr/bin/weed -logtostderr=true shell $ARGS
|
||||||
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
exec /usr/bin/weed $@
|
exec /usr/bin/weed $@
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ scrape_configs:
|
|||||||
static_configs:
|
static_configs:
|
||||||
- targets:
|
- targets:
|
||||||
- 'prometheus:9090'
|
- 'prometheus:9090'
|
||||||
|
- 'master:9324'
|
||||||
- 'volume:9325'
|
- 'volume:9325'
|
||||||
- 'filer:9326'
|
- 'filer:9326'
|
||||||
- 's3:9327'
|
- 's3:9327'
|
||||||
@@ -6,14 +6,15 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 9333:9333
|
- 9333:9333
|
||||||
- 19333:19333
|
- 19333:19333
|
||||||
command: "master -ip=master"
|
- 9324:9324
|
||||||
|
command: "master -ip=master -ip.bind=0.0.0.0 -metricsPort=9324"
|
||||||
volume:
|
volume:
|
||||||
image: chrislusf/seaweedfs # use a remote image
|
image: chrislusf/seaweedfs # use a remote image
|
||||||
ports:
|
ports:
|
||||||
- 8080:8080
|
- 8080:8080
|
||||||
- 18080:18080
|
- 18080:18080
|
||||||
- 9325:9325
|
- 9325:9325
|
||||||
command: 'volume -mserver="master:9333" -port=8080 -metricsPort=9325'
|
command: 'volume -mserver="master:9333" -ip.bind=0.0.0.0 -port=8080 -metricsPort=9325'
|
||||||
depends_on:
|
depends_on:
|
||||||
- master
|
- master
|
||||||
filer:
|
filer:
|
||||||
@@ -22,7 +23,7 @@ services:
|
|||||||
- 8888:8888
|
- 8888:8888
|
||||||
- 18888:18888
|
- 18888:18888
|
||||||
- 9326:9326
|
- 9326:9326
|
||||||
command: 'filer -master="master:9333" -metricsPort=9326'
|
command: 'filer -master="master:9333" -ip.bind=0.0.0.0 -metricsPort=9326'
|
||||||
tty: true
|
tty: true
|
||||||
stdin_open: true
|
stdin_open: true
|
||||||
depends_on:
|
depends_on:
|
||||||
@@ -33,7 +34,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 8333:8333
|
- 8333:8333
|
||||||
- 9327:9327
|
- 9327:9327
|
||||||
command: 's3 -filer="filer:8888" -metricsPort=9327'
|
command: 's3 -filer="filer:8888" -ip.bind=0.0.0.0 -metricsPort=9327'
|
||||||
depends_on:
|
depends_on:
|
||||||
- master
|
- master
|
||||||
- volume
|
- volume
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 8888:8888
|
- 8888:8888
|
||||||
- 18888:18888
|
- 18888:18888
|
||||||
command: 'filer -master="master:9333"'
|
command: 'filer -master="master:9333" -ip.bind=0.0.0.0'
|
||||||
depends_on:
|
depends_on:
|
||||||
- master
|
- master
|
||||||
- volume
|
- volume
|
||||||
@@ -28,7 +28,7 @@ services:
|
|||||||
image: chrislusf/seaweedfs:dev # use a remote dev image
|
image: chrislusf/seaweedfs:dev # use a remote dev image
|
||||||
ports:
|
ports:
|
||||||
- 8333:8333
|
- 8333:8333
|
||||||
command: 's3 -filer="filer:8888"'
|
command: 's3 -filer="filer:8888" -ip.bind=0.0.0.0'
|
||||||
depends_on:
|
depends_on:
|
||||||
- master
|
- master
|
||||||
- volume
|
- volume
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
CREATE DATABASE IF NOT EXISTS seaweedfs;
|
CREATE DATABASE IF NOT EXISTS seaweedfs;
|
||||||
CREATE USER IF NOT EXISTS 'seaweedfs'@'%' IDENTIFIED BY 'secret';
|
CREATE USER IF NOT EXISTS 'seaweedfs'@'%' IDENTIFIED BY 'secret';
|
||||||
GRANT ALL PRIVILEGES ON seaweedfs_fast.* TO 'seaweedfs'@'%';
|
GRANT ALL PRIVILEGES ON seaweedfs.* TO 'seaweedfs'@'%';
|
||||||
FLUSH PRIVILEGES;
|
FLUSH PRIVILEGES;
|
||||||
USE seaweedfs;
|
USE seaweedfs;
|
||||||
CREATE TABLE IF NOT EXISTS filemeta (
|
CREATE TABLE IF NOT EXISTS filemeta (
|
||||||
|
|||||||
@@ -3,21 +3,20 @@ module github.com/chrislusf/seaweedfs
|
|||||||
go 1.18
|
go 1.18
|
||||||
|
|
||||||
require (
|
require (
|
||||||
cloud.google.com/go v0.100.2 // indirect
|
cloud.google.com/go v0.102.1 // indirect
|
||||||
cloud.google.com/go/pubsub v1.19.0
|
cloud.google.com/go/pubsub v1.23.1
|
||||||
cloud.google.com/go/storage v1.22.0
|
cloud.google.com/go/storage v1.23.0
|
||||||
github.com/Azure/azure-pipeline-go v0.2.3
|
github.com/Azure/azure-pipeline-go v0.2.3
|
||||||
github.com/Azure/azure-storage-blob-go v0.14.0
|
github.com/Azure/azure-storage-blob-go v0.15.0
|
||||||
github.com/OneOfOne/xxhash v1.2.8
|
github.com/OneOfOne/xxhash v1.2.8
|
||||||
github.com/Shopify/sarama v1.32.0
|
github.com/Shopify/sarama v1.34.1
|
||||||
github.com/aws/aws-sdk-go v1.43.35
|
github.com/aws/aws-sdk-go v1.44.47
|
||||||
github.com/beorn7/perks v1.0.1 // indirect
|
github.com/beorn7/perks v1.0.1 // indirect
|
||||||
github.com/buraksezer/consistent v0.0.0-20191006190839-693edf70fd72
|
github.com/buraksezer/consistent v0.0.0-20191006190839-693edf70fd72
|
||||||
github.com/bwmarrin/snowflake v0.3.0
|
github.com/bwmarrin/snowflake v0.3.0
|
||||||
github.com/cespare/xxhash v1.1.0
|
github.com/cespare/xxhash v1.1.0
|
||||||
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
||||||
github.com/chrislusf/raft v1.0.8
|
github.com/chrislusf/raft v1.0.9
|
||||||
github.com/colinmarc/hdfs/v2 v2.3.0
|
|
||||||
github.com/coreos/go-semver v0.3.0 // indirect
|
github.com/coreos/go-semver v0.3.0 // indirect
|
||||||
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
|
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||||
@@ -32,60 +31,58 @@ require (
|
|||||||
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 // indirect
|
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 // indirect
|
||||||
github.com/facebookgo/stats v0.0.0-20151006221625-1b76add642e4
|
github.com/facebookgo/stats v0.0.0-20151006221625-1b76add642e4
|
||||||
github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 // indirect
|
github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 // indirect
|
||||||
github.com/fclairamb/ftpserverlib v0.17.0
|
github.com/fclairamb/ftpserverlib v0.18.0
|
||||||
github.com/fsnotify/fsnotify v1.5.1 // indirect
|
github.com/fsnotify/fsnotify v1.5.4 // indirect
|
||||||
github.com/go-errors/errors v1.1.1 // indirect
|
github.com/go-errors/errors v1.1.1 // indirect
|
||||||
github.com/go-redis/redis/v8 v8.11.5
|
github.com/go-redis/redis/v8 v8.11.5
|
||||||
github.com/go-redsync/redsync/v4 v4.5.0
|
github.com/go-redsync/redsync/v4 v4.5.1
|
||||||
github.com/go-sql-driver/mysql v1.6.0
|
github.com/go-sql-driver/mysql v1.6.0
|
||||||
github.com/go-stack/stack v1.8.0 // indirect
|
github.com/go-stack/stack v1.8.1 // indirect
|
||||||
github.com/go-zookeeper/zk v1.0.2 // indirect
|
github.com/go-zookeeper/zk v1.0.2 // indirect
|
||||||
github.com/gocql/gocql v0.0.0-20210707082121-9a3953d1826d
|
github.com/gocql/gocql v0.0.0-20210707082121-9a3953d1826d
|
||||||
github.com/golang-jwt/jwt v3.2.2+incompatible
|
github.com/golang-jwt/jwt v3.2.2+incompatible
|
||||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||||
github.com/golang/protobuf v1.5.2
|
github.com/golang/protobuf v1.5.2
|
||||||
github.com/golang/snappy v0.0.4 // indirect
|
github.com/golang/snappy v0.0.4 // indirect
|
||||||
github.com/google/btree v1.0.1
|
github.com/google/btree v1.1.2
|
||||||
github.com/google/go-cmp v0.5.7 // indirect
|
github.com/google/go-cmp v0.5.8 // indirect
|
||||||
github.com/google/uuid v1.3.0
|
github.com/google/uuid v1.3.0
|
||||||
github.com/google/wire v0.5.0 // indirect
|
github.com/google/wire v0.5.0 // indirect
|
||||||
github.com/googleapis/gax-go/v2 v2.2.0 // indirect
|
github.com/googleapis/gax-go/v2 v2.4.0 // indirect
|
||||||
github.com/gorilla/mux v1.8.0
|
github.com/gorilla/mux v1.8.0
|
||||||
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
|
|
||||||
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect
|
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect
|
||||||
github.com/hashicorp/errwrap v1.0.0 // indirect
|
github.com/hashicorp/errwrap v1.0.0 // indirect
|
||||||
github.com/hashicorp/go-multierror v1.1.0 // indirect
|
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||||
github.com/hashicorp/go-uuid v1.0.2 // indirect
|
github.com/hashicorp/go-uuid v1.0.2 // indirect
|
||||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||||
github.com/jcmturner/gofork v1.0.0 // indirect
|
github.com/jcmturner/gofork v1.0.0 // indirect
|
||||||
github.com/jcmturner/gokrb5/v8 v8.4.2
|
github.com/jcmturner/gokrb5/v8 v8.4.2 // indirect
|
||||||
github.com/jinzhu/copier v0.3.5
|
github.com/jinzhu/copier v0.3.5
|
||||||
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
||||||
github.com/json-iterator/go v1.1.12
|
github.com/json-iterator/go v1.1.12
|
||||||
github.com/karlseguin/ccache/v2 v2.0.8
|
github.com/karlseguin/ccache/v2 v2.0.8
|
||||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
|
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
|
||||||
github.com/klauspost/compress v1.15.1 // indirect
|
github.com/klauspost/compress v1.15.6 // indirect
|
||||||
github.com/klauspost/reedsolomon v1.9.16
|
github.com/klauspost/reedsolomon v1.10.0
|
||||||
github.com/kurin/blazer v0.5.3
|
github.com/kurin/blazer v0.5.3
|
||||||
github.com/lib/pq v1.10.5
|
github.com/lib/pq v1.10.6
|
||||||
github.com/linxGnu/grocksdb v1.7.0
|
github.com/linxGnu/grocksdb v1.7.3
|
||||||
github.com/magiconair/properties v1.8.5 // indirect
|
github.com/magiconair/properties v1.8.6 // indirect
|
||||||
github.com/mailru/easyjson v0.7.7 // indirect
|
github.com/mailru/easyjson v0.7.7 // indirect
|
||||||
github.com/mattn/go-ieproxy v0.0.3 // indirect
|
github.com/mattn/go-ieproxy v0.0.3 // indirect
|
||||||
github.com/mattn/go-isatty v0.0.14 // indirect
|
github.com/mattn/go-isatty v0.0.14 // indirect
|
||||||
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
|
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
|
||||||
github.com/mitchellh/mapstructure v1.4.3 // indirect
|
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||||
github.com/olivere/elastic/v7 v7.0.32
|
github.com/olivere/elastic/v7 v7.0.32
|
||||||
github.com/pelletier/go-toml v1.9.4 // indirect
|
github.com/pelletier/go-toml v1.9.5 // indirect
|
||||||
github.com/peterh/liner v1.2.2
|
github.com/peterh/liner v1.2.2
|
||||||
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
|
|
||||||
github.com/pkg/errors v0.9.1 // indirect
|
github.com/pkg/errors v0.9.1 // indirect
|
||||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||||
github.com/posener/complete v1.2.3
|
github.com/posener/complete v1.2.3
|
||||||
github.com/pquerna/cachecontrol v0.1.0
|
github.com/pquerna/cachecontrol v0.1.0
|
||||||
github.com/prometheus/client_golang v1.12.1
|
github.com/prometheus/client_golang v1.12.2
|
||||||
github.com/prometheus/client_model v0.2.0 // indirect
|
github.com/prometheus/client_model v0.2.0 // indirect
|
||||||
github.com/prometheus/common v0.32.1 // indirect
|
github.com/prometheus/common v0.32.1 // indirect
|
||||||
github.com/prometheus/procfs v0.7.3 // indirect
|
github.com/prometheus/procfs v0.7.3 // indirect
|
||||||
@@ -94,15 +91,15 @@ require (
|
|||||||
github.com/seaweedfs/goexif v2.0.0+incompatible
|
github.com/seaweedfs/goexif v2.0.0+incompatible
|
||||||
github.com/sirupsen/logrus v1.8.1 // indirect
|
github.com/sirupsen/logrus v1.8.1 // indirect
|
||||||
github.com/spaolacci/murmur3 v1.1.0 // indirect
|
github.com/spaolacci/murmur3 v1.1.0 // indirect
|
||||||
github.com/spf13/afero v1.7.0 // indirect
|
github.com/spf13/afero v1.8.2 // indirect
|
||||||
github.com/spf13/cast v1.4.1 // indirect
|
github.com/spf13/cast v1.5.0 // indirect
|
||||||
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
||||||
github.com/spf13/viper v1.10.1
|
github.com/spf13/viper v1.12.0
|
||||||
github.com/streadway/amqp v1.0.0
|
github.com/streadway/amqp v1.0.0
|
||||||
github.com/stretchr/testify v1.7.1
|
github.com/stretchr/testify v1.8.0
|
||||||
github.com/stvp/tempredis v0.0.0-20181119212430-b82af8480203
|
github.com/stvp/tempredis v0.0.0-20181119212430-b82af8480203
|
||||||
github.com/syndtr/goleveldb v1.0.1-0.20190318030020-c3a204f8e965
|
github.com/syndtr/goleveldb v1.0.1-0.20190318030020-c3a204f8e965
|
||||||
github.com/tidwall/gjson v1.14.0
|
github.com/tidwall/gjson v1.14.1
|
||||||
github.com/tidwall/match v1.1.1
|
github.com/tidwall/match v1.1.1
|
||||||
github.com/tidwall/pretty v1.2.0 // indirect
|
github.com/tidwall/pretty v1.2.0 // indirect
|
||||||
github.com/tsuna/gohbase v0.0.0-20201125011725-348991136365
|
github.com/tsuna/gohbase v0.0.0-20201125011725-348991136365
|
||||||
@@ -112,49 +109,60 @@ require (
|
|||||||
github.com/viant/ptrie v0.3.0
|
github.com/viant/ptrie v0.3.0
|
||||||
github.com/viant/toolbox v0.33.2 // indirect
|
github.com/viant/toolbox v0.33.2 // indirect
|
||||||
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
|
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
|
||||||
github.com/xdg-go/scram v1.1.0 // indirect
|
github.com/xdg-go/scram v1.1.1 // indirect
|
||||||
github.com/xdg-go/stringprep v1.0.2 // indirect
|
github.com/xdg-go/stringprep v1.0.3 // indirect
|
||||||
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
|
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
|
||||||
go.etcd.io/etcd/client/v3 v3.5.2
|
go.etcd.io/etcd/client/v3 v3.5.4
|
||||||
go.mongodb.org/mongo-driver v1.9.0
|
go.mongodb.org/mongo-driver v1.9.1
|
||||||
go.opencensus.io v0.23.0 // indirect
|
go.opencensus.io v0.23.0 // indirect
|
||||||
gocloud.dev v0.25.0
|
gocloud.dev v0.25.0
|
||||||
gocloud.dev/pubsub/natspubsub v0.25.0
|
gocloud.dev/pubsub/natspubsub v0.25.0
|
||||||
gocloud.dev/pubsub/rabbitpubsub v0.25.0
|
gocloud.dev/pubsub/rabbitpubsub v0.25.0
|
||||||
golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 // indirect
|
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect
|
||||||
|
golang.org/x/exp v0.0.0-20220414153411-bcd21879b8fd
|
||||||
golang.org/x/image v0.0.0-20200119044424-58c23975cae1
|
golang.org/x/image v0.0.0-20200119044424-58c23975cae1
|
||||||
golang.org/x/net v0.0.0-20220401154927-543a649e0bdd
|
golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e
|
||||||
golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a // indirect
|
golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 // indirect
|
||||||
golang.org/x/sys v0.0.0-20220330033206-e17cdc41300f
|
golang.org/x/sys v0.0.0-20220624220833-87e55d714810
|
||||||
golang.org/x/text v0.3.7 // indirect
|
golang.org/x/text v0.3.7 // indirect
|
||||||
golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2
|
golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023
|
||||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
|
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect
|
||||||
google.golang.org/api v0.74.0
|
google.golang.org/api v0.86.0
|
||||||
google.golang.org/appengine v1.6.7 // indirect
|
google.golang.org/appengine v1.6.7 // indirect
|
||||||
google.golang.org/genproto v0.0.0-20220405205423-9d709892a2bf // indirect
|
google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f // indirect
|
||||||
google.golang.org/grpc v1.45.0
|
google.golang.org/grpc v1.47.0
|
||||||
google.golang.org/protobuf v1.28.0
|
google.golang.org/protobuf v1.28.0
|
||||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||||
modernc.org/b v1.0.0 // indirect
|
modernc.org/b v1.0.0 // indirect
|
||||||
modernc.org/cc/v3 v3.35.24 // indirect
|
modernc.org/cc/v3 v3.36.0 // indirect
|
||||||
modernc.org/ccgo/v3 v3.15.18 // indirect
|
modernc.org/ccgo/v3 v3.16.6 // indirect
|
||||||
modernc.org/libc v1.14.12 // indirect
|
modernc.org/libc v1.16.7 // indirect
|
||||||
modernc.org/mathutil v1.4.1 // indirect
|
modernc.org/mathutil v1.4.1 // indirect
|
||||||
modernc.org/memory v1.0.7 // indirect
|
modernc.org/memory v1.1.1 // indirect
|
||||||
modernc.org/opt v0.1.1 // indirect
|
modernc.org/opt v0.1.1 // indirect
|
||||||
modernc.org/sqlite v1.16.0
|
modernc.org/sqlite v1.17.3
|
||||||
modernc.org/strutil v1.1.1 // indirect
|
modernc.org/strutil v1.1.2
|
||||||
modernc.org/token v1.0.0 // indirect
|
modernc.org/token v1.0.0 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
github.com/Jille/raft-grpc-transport v1.2.0
|
||||||
|
github.com/arangodb/go-driver v1.3.2
|
||||||
github.com/fluent/fluent-logger-golang v1.9.0
|
github.com/fluent/fluent-logger-golang v1.9.0
|
||||||
github.com/hanwen/go-fuse/v2 v2.1.0
|
github.com/hanwen/go-fuse/v2 v2.1.1-0.20220627082937-d01fda7edf17
|
||||||
|
github.com/hashicorp/raft v1.3.9
|
||||||
|
github.com/hashicorp/raft-boltdb v0.0.0-20220329195025-15018e9b97e0
|
||||||
|
github.com/tikv/client-go/v2 v2.0.1
|
||||||
|
github.com/ydb-platform/ydb-go-sdk-auth-environ v0.1.2
|
||||||
|
github.com/ydb-platform/ydb-go-sdk/v3 v3.27.0
|
||||||
|
google.golang.org/grpc/security/advancedtls v0.0.0-20220622233350-5cdb09fa29c1
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
cloud.google.com/go/compute v1.5.0 // indirect
|
cloud.google.com/go/compute v1.7.0 // indirect
|
||||||
cloud.google.com/go/iam v0.3.0 // indirect
|
cloud.google.com/go/iam v0.3.0 // indirect
|
||||||
|
github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e // indirect
|
||||||
|
github.com/armon/go-metrics v0.3.10 // indirect
|
||||||
github.com/aws/aws-sdk-go-v2 v1.16.2 // indirect
|
github.com/aws/aws-sdk-go-v2 v1.16.2 // indirect
|
||||||
github.com/aws/aws-sdk-go-v2/config v1.15.3 // indirect
|
github.com/aws/aws-sdk-go-v2/config v1.15.3 // indirect
|
||||||
github.com/aws/aws-sdk-go-v2/credentials v1.11.2 // indirect
|
github.com/aws/aws-sdk-go-v2/credentials v1.11.2 // indirect
|
||||||
@@ -168,37 +176,62 @@ require (
|
|||||||
github.com/aws/aws-sdk-go-v2/service/sso v1.11.3 // indirect
|
github.com/aws/aws-sdk-go-v2/service/sso v1.11.3 // indirect
|
||||||
github.com/aws/aws-sdk-go-v2/service/sts v1.16.3 // indirect
|
github.com/aws/aws-sdk-go-v2/service/sts v1.16.3 // indirect
|
||||||
github.com/aws/smithy-go v1.11.2 // indirect
|
github.com/aws/smithy-go v1.11.2 // indirect
|
||||||
|
github.com/benbjohnson/clock v1.1.0 // indirect
|
||||||
|
github.com/boltdb/bolt v1.3.1 // indirect
|
||||||
|
github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548 // indirect
|
||||||
github.com/d4l3k/messagediff v1.2.1 // indirect
|
github.com/d4l3k/messagediff v1.2.1 // indirect
|
||||||
github.com/fclairamb/go-log v0.1.0 // indirect
|
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 // indirect
|
||||||
|
github.com/fatih/color v1.13.0 // indirect
|
||||||
|
github.com/fclairamb/go-log v0.3.0 // indirect
|
||||||
github.com/gogo/protobuf v1.3.2 // indirect
|
github.com/gogo/protobuf v1.3.2 // indirect
|
||||||
|
github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect
|
||||||
github.com/googleapis/go-type-adapters v1.0.0 // indirect
|
github.com/googleapis/go-type-adapters v1.0.0 // indirect
|
||||||
github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8 // indirect
|
github.com/grpc-ecosystem/go-grpc-middleware v1.1.0 // indirect
|
||||||
|
github.com/hashicorp/go-hclog v1.2.0 // indirect
|
||||||
|
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
|
||||||
|
github.com/hashicorp/go-msgpack v1.1.5 // indirect
|
||||||
|
github.com/hashicorp/golang-lru v0.5.4 // indirect
|
||||||
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
|
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
|
||||||
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
|
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
|
||||||
github.com/jcmturner/goidentity/v6 v6.0.1 // indirect
|
|
||||||
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
|
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
|
||||||
|
github.com/jonboulle/clockwork v0.2.2 // indirect
|
||||||
github.com/josharian/intern v1.0.0 // indirect
|
github.com/josharian/intern v1.0.0 // indirect
|
||||||
github.com/klauspost/cpuid/v2 v2.0.6 // indirect
|
github.com/klauspost/cpuid/v2 v2.0.14 // indirect
|
||||||
|
github.com/mattn/go-colorable v0.1.12 // indirect
|
||||||
github.com/mattn/go-runewidth v0.0.7 // indirect
|
github.com/mattn/go-runewidth v0.0.7 // indirect
|
||||||
github.com/mattn/go-sqlite3 v2.0.1+incompatible // indirect
|
github.com/mattn/go-sqlite3 v2.0.1+incompatible // indirect
|
||||||
github.com/nats-io/nats.go v1.13.1-0.20220121202836-972a071d373d // indirect
|
github.com/nats-io/nats.go v1.13.1-0.20220121202836-972a071d373d // indirect
|
||||||
github.com/nats-io/nkeys v0.3.0 // indirect
|
github.com/nats-io/nkeys v0.3.0 // indirect
|
||||||
github.com/nats-io/nuid v1.0.1 // indirect
|
github.com/nats-io/nuid v1.0.1 // indirect
|
||||||
|
github.com/opentracing/opentracing-go v1.2.0 // indirect
|
||||||
|
github.com/pelletier/go-toml/v2 v2.0.1 // indirect
|
||||||
github.com/philhofer/fwd v1.1.1 // indirect
|
github.com/philhofer/fwd v1.1.1 // indirect
|
||||||
|
github.com/pierrec/lz4/v4 v4.1.14 // indirect
|
||||||
|
github.com/pingcap/errors v0.11.5-0.20211224045212-9687c2b0f87c // indirect
|
||||||
|
github.com/pingcap/failpoint v0.0.0-20210918120811-547c13e3eb00 // indirect
|
||||||
|
github.com/pingcap/kvproto v0.0.0-20220106070556-3fa8fa04f898 // indirect
|
||||||
|
github.com/pingcap/log v0.0.0-20211215031037-e024ba4eb0ee // indirect
|
||||||
github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd // indirect
|
github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd // indirect
|
||||||
github.com/spf13/pflag v1.0.5 // indirect
|
github.com/spf13/pflag v1.0.5 // indirect
|
||||||
github.com/subosito/gotenv v1.2.0 // indirect
|
github.com/subosito/gotenv v1.3.0 // indirect
|
||||||
|
github.com/tikv/pd/client v0.0.0-20220216070739-26c668271201 // indirect
|
||||||
github.com/tinylib/msgp v1.1.6 // indirect
|
github.com/tinylib/msgp v1.1.6 // indirect
|
||||||
go.etcd.io/etcd/api/v3 v3.5.2 // indirect
|
github.com/twmb/murmur3 v1.1.3 // indirect
|
||||||
go.etcd.io/etcd/client/pkg/v3 v3.5.2 // indirect
|
github.com/yandex-cloud/go-genproto v0.0.0-20211115083454-9ca41db5ed9e // indirect
|
||||||
|
github.com/ydb-platform/ydb-go-genproto v0.0.0-20220531094121-36ca6bddb9f7 // indirect
|
||||||
|
github.com/ydb-platform/ydb-go-yc v0.8.3 // indirect
|
||||||
|
github.com/ydb-platform/ydb-go-yc-metadata v0.5.2 // indirect
|
||||||
|
go.etcd.io/etcd/api/v3 v3.5.4 // indirect
|
||||||
|
go.etcd.io/etcd/client/pkg/v3 v3.5.4 // indirect
|
||||||
go.uber.org/atomic v1.9.0 // indirect
|
go.uber.org/atomic v1.9.0 // indirect
|
||||||
go.uber.org/multierr v1.8.0 // indirect
|
go.uber.org/multierr v1.8.0 // indirect
|
||||||
go.uber.org/zap v1.21.0 // indirect
|
go.uber.org/zap v1.21.0 // indirect
|
||||||
golang.org/x/mod v0.5.0 // indirect
|
golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57 // indirect
|
||||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
|
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect
|
||||||
gopkg.in/ini.v1 v1.66.2 // indirect
|
gopkg.in/ini.v1 v1.66.4 // indirect
|
||||||
|
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
|
||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
lukechampine.com/uint128 v1.1.1 // indirect
|
lukechampine.com/uint128 v1.1.1 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
description: SeaweedFS
|
description: SeaweedFS
|
||||||
name: seaweedfs
|
name: seaweedfs
|
||||||
appVersion: "2.98"
|
appVersion: "3.14"
|
||||||
version: "2.98"
|
version: "3.14"
|
||||||
@@ -154,13 +154,16 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
-master={{ range $index := until (.Values.master.replicas | int) }}${SEAWEEDFS_FULLNAME}-master-{{ $index }}.${SEAWEEDFS_FULLNAME}-master:{{ $.Values.master.port }}{{ if lt $index (sub ($.Values.master.replicas | int) 1) }},{{ end }}{{ end }}
|
-master={{ range $index := until (.Values.master.replicas | int) }}${SEAWEEDFS_FULLNAME}-master-{{ $index }}.${SEAWEEDFS_FULLNAME}-master:{{ $.Values.master.port }}{{ if lt $index (sub ($.Values.master.replicas | int) 1) }},{{ end }}{{ end }}
|
||||||
{{- if or (.Values.global.enableSecurity) (.Values.filer.extraVolumeMounts) }}
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: seaweedfs-filer-log-volume
|
- name: seaweedfs-filer-log-volume
|
||||||
mountPath: "/logs/"
|
mountPath: "/logs/"
|
||||||
- mountPath: /etc/sw
|
- mountPath: /etc/sw
|
||||||
name: config-users
|
name: config-users
|
||||||
readOnly: true
|
readOnly: true
|
||||||
|
{{- if .Values.filer.enablePVC }}
|
||||||
|
- name: data-filer
|
||||||
|
mountPath: /data
|
||||||
|
{{- end }}
|
||||||
{{- if .Values.global.enableSecurity }}
|
{{- if .Values.global.enableSecurity }}
|
||||||
- name: security-config
|
- name: security-config
|
||||||
readOnly: true
|
readOnly: true
|
||||||
@@ -183,7 +186,6 @@ spec:
|
|||||||
mountPath: /usr/local/share/ca-certificates/client/
|
mountPath: /usr/local/share/ca-certificates/client/
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{ tpl .Values.filer.extraVolumeMounts . | nindent 12 | trim }}
|
{{ tpl .Values.filer.extraVolumeMounts . | nindent 12 | trim }}
|
||||||
{{- end }}
|
|
||||||
ports:
|
ports:
|
||||||
- containerPort: {{ .Values.filer.port }}
|
- containerPort: {{ .Values.filer.port }}
|
||||||
name: swfs-filer
|
name: swfs-filer
|
||||||
@@ -250,16 +252,18 @@ spec:
|
|||||||
nodeSelector:
|
nodeSelector:
|
||||||
{{ tpl .Values.filer.nodeSelector . | indent 8 | trim }}
|
{{ tpl .Values.filer.nodeSelector . | indent 8 | trim }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{/* volumeClaimTemplates:*/}}
|
{{- if .Values.filer.enablePVC }}
|
||||||
{{/* - metadata:*/}}
|
volumeClaimTemplates:
|
||||||
{{/* name: data-{{ .Release.Namespace }}*/}}
|
- metadata:
|
||||||
{{/* spec:*/}}
|
name: data-filer
|
||||||
{{/* accessModes:*/}}
|
spec:
|
||||||
{{/* - ReadWriteOnce*/}}
|
accessModes:
|
||||||
{{/* resources:*/}}
|
- ReadWriteOnce
|
||||||
{{/* requests:*/}}
|
resources:
|
||||||
{{/* storage: {{ .Values.filer.storage }}*/}}
|
requests:
|
||||||
{{/* {{- if .Values.filer.storageClass }}*/}}
|
storage: {{ .Values.filer.storage }}
|
||||||
{{/* storageClassName: {{ .Values.filer.storageClass }}*/}}
|
{{- if .Values.filer.storageClass }}
|
||||||
{{/* {{- end }}*/}}
|
storageClassName: {{ .Values.filer.storageClass }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -10,7 +10,6 @@ metadata:
|
|||||||
heritage: {{ .Release.Service }}
|
heritage: {{ .Release.Service }}
|
||||||
release: {{ .Release.Name }}
|
release: {{ .Release.Name }}
|
||||||
spec:
|
spec:
|
||||||
serviceName: {{ template "seaweedfs.name" . }}-s3
|
|
||||||
replicas: {{ .Values.s3.replicas }}
|
replicas: {{ .Values.s3.replicas }}
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
|
|||||||
@@ -275,6 +275,9 @@ filer:
|
|||||||
# Disable http request, only gRpc operations are allowed
|
# Disable http request, only gRpc operations are allowed
|
||||||
disableHttp: false
|
disableHttp: false
|
||||||
|
|
||||||
|
# enablePVC will create a pvc for filer for data persistence.
|
||||||
|
enablePVC: false
|
||||||
|
|
||||||
# storage and storageClass are the settings for configuring stateful
|
# storage and storageClass are the settings for configuring stateful
|
||||||
# storage for the master pods. storage should be set to the disk size of
|
# storage for the master pods. storage should be set to the disk size of
|
||||||
# the attached volume. storageClass is the class of storage which defaults
|
# the attached volume. storageClass is the class of storage which defaults
|
||||||
@@ -357,6 +360,7 @@ filer:
|
|||||||
WEED_MYSQL_CONNECTION_MAX_LIFETIME_SECONDS: "600"
|
WEED_MYSQL_CONNECTION_MAX_LIFETIME_SECONDS: "600"
|
||||||
# enable usage of memsql as filer backend
|
# enable usage of memsql as filer backend
|
||||||
WEED_MYSQL_INTERPOLATEPARAMS: "true"
|
WEED_MYSQL_INTERPOLATEPARAMS: "true"
|
||||||
|
# if you want to use leveldb2, then should enable "enablePVC". or you may lose your data.
|
||||||
WEED_LEVELDB2_ENABLED: "false"
|
WEED_LEVELDB2_ENABLED: "false"
|
||||||
# with http DELETE, by default the filer would check whether a folder is empty.
|
# with http DELETE, by default the filer would check whether a folder is empty.
|
||||||
# recursive_delete will delete all sub folders and files, similar to "rm -Rf"
|
# recursive_delete will delete all sub folders and files, similar to "rm -Rf"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<groupId>com.github.chrislusf</groupId>
|
<groupId>com.github.chrislusf</groupId>
|
||||||
<artifactId>seaweedfs-client</artifactId>
|
<artifactId>seaweedfs-client</artifactId>
|
||||||
<version>2.85</version>
|
<version>3.13</version>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.sonatype.oss</groupId>
|
<groupId>org.sonatype.oss</groupId>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<groupId>com.github.chrislusf</groupId>
|
<groupId>com.github.chrislusf</groupId>
|
||||||
<artifactId>seaweedfs-client</artifactId>
|
<artifactId>seaweedfs-client</artifactId>
|
||||||
<version>2.85</version>
|
<version>3.13</version>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.sonatype.oss</groupId>
|
<groupId>org.sonatype.oss</groupId>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<groupId>com.github.chrislusf</groupId>
|
<groupId>com.github.chrislusf</groupId>
|
||||||
<artifactId>seaweedfs-client</artifactId>
|
<artifactId>seaweedfs-client</artifactId>
|
||||||
<version>2.85</version>
|
<version>3.13</version>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.sonatype.oss</groupId>
|
<groupId>org.sonatype.oss</groupId>
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public class SeaweedCipher {
|
|||||||
byte[] encryptedText = AES_cipherInstance.doFinal(clearTextbytes, offset, length);
|
byte[] encryptedText = AES_cipherInstance.doFinal(clearTextbytes, offset, length);
|
||||||
|
|
||||||
byte[] iv = AES_cipherInstance.getIV();
|
byte[] iv = AES_cipherInstance.getIV();
|
||||||
byte[] message = new byte[GCM_NONCE_LENGTH + clearTextbytes.length + GCM_TAG_LENGTH];
|
byte[] message = new byte[GCM_NONCE_LENGTH + length + GCM_TAG_LENGTH];
|
||||||
System.arraycopy(iv, 0, message, 0, GCM_NONCE_LENGTH);
|
System.arraycopy(iv, 0, message, 0, GCM_NONCE_LENGTH);
|
||||||
System.arraycopy(encryptedText, 0, message, GCM_NONCE_LENGTH, encryptedText.length);
|
System.arraycopy(encryptedText, 0, message, GCM_NONCE_LENGTH, encryptedText.length);
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ public class SeaweedOutputStream extends OutputStream {
|
|||||||
.setIsDirectory(false)
|
.setIsDirectory(false)
|
||||||
.setAttributes(FilerProto.FuseAttributes.newBuilder()
|
.setAttributes(FilerProto.FuseAttributes.newBuilder()
|
||||||
.setFileMode(0755)
|
.setFileMode(0755)
|
||||||
.setReplication(replication)
|
|
||||||
.setCrtime(now)
|
.setCrtime(now)
|
||||||
.setMtime(now)
|
.setMtime(now)
|
||||||
.clearGroupName()
|
.clearGroupName()
|
||||||
|
|||||||
@@ -166,14 +166,11 @@ message FuseAttributes {
|
|||||||
uint32 gid = 5;
|
uint32 gid = 5;
|
||||||
int64 crtime = 6; // unix time in seconds
|
int64 crtime = 6; // unix time in seconds
|
||||||
string mime = 7;
|
string mime = 7;
|
||||||
string replication = 8;
|
|
||||||
string collection = 9;
|
|
||||||
int32 ttl_sec = 10;
|
int32 ttl_sec = 10;
|
||||||
string user_name = 11; // for hdfs
|
string user_name = 11; // for hdfs
|
||||||
repeated string group_name = 12; // for hdfs
|
repeated string group_name = 12; // for hdfs
|
||||||
string symlink_target = 13;
|
string symlink_target = 13;
|
||||||
bytes md5 = 14;
|
bytes md5 = 14;
|
||||||
string disk_type = 15;
|
|
||||||
uint32 rdev = 16;
|
uint32 rdev = 16;
|
||||||
uint64 inode = 17;
|
uint64 inode = 17;
|
||||||
}
|
}
|
||||||
@@ -319,6 +316,9 @@ message PingRequest {
|
|||||||
string target_type = 2;
|
string target_type = 2;
|
||||||
}
|
}
|
||||||
message PingResponse {
|
message PingResponse {
|
||||||
|
int64 start_time_ns = 1;
|
||||||
|
int64 remote_time_ns = 2;
|
||||||
|
int64 stop_time_ns = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetFilerConfigurationRequest {
|
message GetFilerConfigurationRequest {
|
||||||
@@ -335,6 +335,7 @@ message GetFilerConfigurationResponse {
|
|||||||
int32 metrics_interval_sec = 10;
|
int32 metrics_interval_sec = 10;
|
||||||
string version = 11;
|
string version = 11;
|
||||||
string cluster_id = 12;
|
string cluster_id = 12;
|
||||||
|
string filer_group = 13;
|
||||||
}
|
}
|
||||||
|
|
||||||
message SubscribeMetadataRequest {
|
message SubscribeMetadataRequest {
|
||||||
@@ -344,6 +345,7 @@ message SubscribeMetadataRequest {
|
|||||||
int32 signature = 4;
|
int32 signature = 4;
|
||||||
repeated string path_prefixes = 6;
|
repeated string path_prefixes = 6;
|
||||||
int32 client_id = 7;
|
int32 client_id = 7;
|
||||||
|
int64 until_ns = 8;
|
||||||
}
|
}
|
||||||
message SubscribeMetadataResponse {
|
message SubscribeMetadataResponse {
|
||||||
string directory = 1;
|
string directory = 1;
|
||||||
|
|||||||
@@ -11,13 +11,13 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.chrislusf</groupId>
|
<groupId>com.github.chrislusf</groupId>
|
||||||
<artifactId>seaweedfs-client</artifactId>
|
<artifactId>seaweedfs-client</artifactId>
|
||||||
<version>2.85</version>
|
<version>3.13</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.chrislusf</groupId>
|
<groupId>com.github.chrislusf</groupId>
|
||||||
<artifactId>seaweedfs-hadoop2-client</artifactId>
|
<artifactId>seaweedfs-hadoop2-client</artifactId>
|
||||||
<version>2.85</version>
|
<version>3.13</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.hadoop</groupId>
|
<groupId>org.apache.hadoop</groupId>
|
||||||
<artifactId>hadoop-common</artifactId>
|
<artifactId>hadoop-common</artifactId>
|
||||||
<version>3.2.2</version>
|
<version>3.2.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.hadoop</groupId>
|
<groupId>org.apache.hadoop</groupId>
|
||||||
|
|||||||
@@ -124,7 +124,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.hadoop</groupId>
|
<groupId>org.apache.hadoop</groupId>
|
||||||
<artifactId>hadoop-client</artifactId>
|
<artifactId>hadoop-client</artifactId>
|
||||||
<version>2.9.2</version>
|
<version>2.10.1</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
@@ -156,7 +156,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.hadoop</groupId>
|
<groupId>org.apache.hadoop</groupId>
|
||||||
<artifactId>hadoop-common</artifactId>
|
<artifactId>hadoop-common</artifactId>
|
||||||
<version>2.9.2</version>
|
<version>2.10.1</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
@@ -231,6 +231,14 @@
|
|||||||
<artifactId>commons-configuration</artifactId>
|
<artifactId>commons-configuration</artifactId>
|
||||||
<groupId>commons-configuration</groupId>
|
<groupId>commons-configuration</groupId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>commons-digester</artifactId>
|
||||||
|
<groupId>commons-digester</groupId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>commons-beanutils</artifactId>
|
||||||
|
<groupId>commons-beanutils</groupId>
|
||||||
|
</exclusion>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<artifactId>commons-lang3</artifactId>
|
<artifactId>commons-lang3</artifactId>
|
||||||
<groupId>org.apache.commons</groupId>
|
<groupId>org.apache.commons</groupId>
|
||||||
@@ -301,7 +309,7 @@
|
|||||||
</snapshotRepository>
|
</snapshotRepository>
|
||||||
</distributionManagement>
|
</distributionManagement>
|
||||||
<properties>
|
<properties>
|
||||||
<seaweedfs.client.version>2.85</seaweedfs.client.version>
|
<seaweedfs.client.version>3.13</seaweedfs.client.version>
|
||||||
<hadoop.version>2.9.2</hadoop.version>
|
<hadoop.version>2.10.1</hadoop.version>
|
||||||
</properties>
|
</properties>
|
||||||
</project>
|
</project>
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<seaweedfs.client.version>2.85</seaweedfs.client.version>
|
<seaweedfs.client.version>3.13</seaweedfs.client.version>
|
||||||
<hadoop.version>2.10.1</hadoop.version>
|
<hadoop.version>2.10.1</hadoop.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
|||||||
@@ -200,7 +200,6 @@ public class SeaweedFileSystemStore {
|
|||||||
entry.getAttributesBuilder().setMtime(now);
|
entry.getAttributesBuilder().setMtime(now);
|
||||||
LOG.debug("createFile merged entry path:{} entry:{} from:{}", path, entry, existingEntry);
|
LOG.debug("createFile merged entry path:{} entry:{} from:{}", path, entry, existingEntry);
|
||||||
writePosition = SeaweedRead.fileSize(existingEntry);
|
writePosition = SeaweedRead.fileSize(existingEntry);
|
||||||
replication = existingEntry.getAttributes().getReplication();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (entry == null) {
|
if (entry == null) {
|
||||||
@@ -209,7 +208,6 @@ public class SeaweedFileSystemStore {
|
|||||||
.setIsDirectory(false)
|
.setIsDirectory(false)
|
||||||
.setAttributes(FilerProto.FuseAttributes.newBuilder()
|
.setAttributes(FilerProto.FuseAttributes.newBuilder()
|
||||||
.setFileMode(permissionToMode(permission, false))
|
.setFileMode(permissionToMode(permission, false))
|
||||||
.setReplication(replication)
|
|
||||||
.setCrtime(now)
|
.setCrtime(now)
|
||||||
.setMtime(now)
|
.setMtime(now)
|
||||||
.setUserName(userGroupInformation.getUserName())
|
.setUserName(userGroupInformation.getUserName())
|
||||||
|
|||||||
@@ -124,7 +124,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.hadoop</groupId>
|
<groupId>org.apache.hadoop</groupId>
|
||||||
<artifactId>hadoop-client</artifactId>
|
<artifactId>hadoop-client</artifactId>
|
||||||
<version>3.1.1</version>
|
<version>3.2.3</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
@@ -156,7 +156,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.hadoop</groupId>
|
<groupId>org.apache.hadoop</groupId>
|
||||||
<artifactId>hadoop-common</artifactId>
|
<artifactId>hadoop-common</artifactId>
|
||||||
<version>3.1.1</version>
|
<version>3.2.3</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
@@ -183,6 +183,10 @@
|
|||||||
<artifactId>javax.servlet-api</artifactId>
|
<artifactId>javax.servlet-api</artifactId>
|
||||||
<groupId>javax.servlet</groupId>
|
<groupId>javax.servlet</groupId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>javax.activation-api</artifactId>
|
||||||
|
<groupId>javax.activation</groupId>
|
||||||
|
</exclusion>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<artifactId>jetty-server</artifactId>
|
<artifactId>jetty-server</artifactId>
|
||||||
<groupId>org.eclipse.jetty</groupId>
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
@@ -223,10 +227,6 @@
|
|||||||
<artifactId>log4j</artifactId>
|
<artifactId>log4j</artifactId>
|
||||||
<groupId>log4j</groupId>
|
<groupId>log4j</groupId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
<exclusion>
|
|
||||||
<artifactId>commons-lang</artifactId>
|
|
||||||
<groupId>commons-lang</groupId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<artifactId>commons-beanutils</artifactId>
|
<artifactId>commons-beanutils</artifactId>
|
||||||
<groupId>commons-beanutils</groupId>
|
<groupId>commons-beanutils</groupId>
|
||||||
@@ -239,6 +239,10 @@
|
|||||||
<artifactId>commons-lang3</artifactId>
|
<artifactId>commons-lang3</artifactId>
|
||||||
<groupId>org.apache.commons</groupId>
|
<groupId>org.apache.commons</groupId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>commons-text</artifactId>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
</exclusion>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<artifactId>slf4j-log4j12</artifactId>
|
<artifactId>slf4j-log4j12</artifactId>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
@@ -295,6 +299,10 @@
|
|||||||
<artifactId>woodstox-core</artifactId>
|
<artifactId>woodstox-core</artifactId>
|
||||||
<groupId>com.fasterxml.woodstox</groupId>
|
<groupId>com.fasterxml.woodstox</groupId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>dnsjava</artifactId>
|
||||||
|
<groupId>dnsjava</groupId>
|
||||||
|
</exclusion>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<artifactId>hadoop-annotations</artifactId>
|
<artifactId>hadoop-annotations</artifactId>
|
||||||
<groupId>org.apache.hadoop</groupId>
|
<groupId>org.apache.hadoop</groupId>
|
||||||
@@ -309,7 +317,7 @@
|
|||||||
</snapshotRepository>
|
</snapshotRepository>
|
||||||
</distributionManagement>
|
</distributionManagement>
|
||||||
<properties>
|
<properties>
|
||||||
<seaweedfs.client.version>2.85</seaweedfs.client.version>
|
<seaweedfs.client.version>3.13</seaweedfs.client.version>
|
||||||
<hadoop.version>3.1.1</hadoop.version>
|
<hadoop.version>3.2.3</hadoop.version>
|
||||||
</properties>
|
</properties>
|
||||||
</project>
|
</project>
|
||||||
@@ -5,8 +5,8 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<seaweedfs.client.version>2.85</seaweedfs.client.version>
|
<seaweedfs.client.version>3.13</seaweedfs.client.version>
|
||||||
<hadoop.version>3.1.4</hadoop.version>
|
<hadoop.version>3.2.3</hadoop.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<groupId>com.github.chrislusf</groupId>
|
<groupId>com.github.chrislusf</groupId>
|
||||||
|
|||||||
@@ -200,7 +200,6 @@ public class SeaweedFileSystemStore {
|
|||||||
entry.getAttributesBuilder().setMtime(now);
|
entry.getAttributesBuilder().setMtime(now);
|
||||||
LOG.debug("createFile merged entry path:{} entry:{} from:{}", path, entry, existingEntry);
|
LOG.debug("createFile merged entry path:{} entry:{} from:{}", path, entry, existingEntry);
|
||||||
writePosition = SeaweedRead.fileSize(existingEntry);
|
writePosition = SeaweedRead.fileSize(existingEntry);
|
||||||
replication = existingEntry.getAttributes().getReplication();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (entry == null) {
|
if (entry == null) {
|
||||||
@@ -209,7 +208,6 @@ public class SeaweedFileSystemStore {
|
|||||||
.setIsDirectory(false)
|
.setIsDirectory(false)
|
||||||
.setAttributes(FilerProto.FuseAttributes.newBuilder()
|
.setAttributes(FilerProto.FuseAttributes.newBuilder()
|
||||||
.setFileMode(permissionToMode(permission, false))
|
.setFileMode(permissionToMode(permission, false))
|
||||||
.setReplication(replication)
|
|
||||||
.setCrtime(now)
|
.setCrtime(now)
|
||||||
.setMtime(now)
|
.setMtime(now)
|
||||||
.setUserName(userGroupInformation.getUserName())
|
.setUserName(userGroupInformation.getUserName())
|
||||||
|
|||||||
@@ -539,11 +539,12 @@
|
|||||||
"step": 60
|
"step": 60
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expr": "histogram_quantile(0.90, sum(rate(SeaweedFS_s3_request_seconds_bucket[1m])) by (le, type))",
|
"expr": "histogram_quantile(0.90, sum(rate(SeaweedFS_s3_request_seconds_bucket[1m])) by (le, type, bucket))",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"hide": false,
|
"hide": false,
|
||||||
|
"interval": "",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{type}}",
|
"legendFormat": "{{bucket}} {{type}}",
|
||||||
"refId": "B",
|
"refId": "B",
|
||||||
"step": 60
|
"step": 60
|
||||||
}
|
}
|
||||||
@@ -645,11 +646,12 @@
|
|||||||
"step": 60
|
"step": 60
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expr": "histogram_quantile(0.95, sum(rate(SeaweedFS_s3_request_seconds_bucket[1m])) by (le, type))",
|
"expr": "histogram_quantile(0.95, sum(rate(SeaweedFS_s3_request_seconds_bucket[1m])) by (le, type, bucket))",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"hide": false,
|
"hide": false,
|
||||||
|
"interval": "",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{type}}",
|
"legendFormat": "{{bucket}} {{type}}",
|
||||||
"refId": "B",
|
"refId": "B",
|
||||||
"step": 60
|
"step": 60
|
||||||
}
|
}
|
||||||
@@ -751,11 +753,11 @@
|
|||||||
"step": 60
|
"step": 60
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expr": "histogram_quantile(0.99, sum(rate(SeaweedFS_s3_request_seconds_bucket[1m])) by (le, type))",
|
"expr": "histogram_quantile(0.99, sum(rate(SeaweedFS_s3_request_seconds_bucket[1m])) by (le, type, bucket))",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"hide": false,
|
"hide": false,
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{type}}",
|
"legendFormat": "{{bucket}} {{type}}",
|
||||||
"refId": "B",
|
"refId": "B",
|
||||||
"step": 60
|
"step": 60
|
||||||
}
|
}
|
||||||
@@ -864,7 +866,7 @@
|
|||||||
"expr": "rate(SeaweedFS_s3_request_total[1m])",
|
"expr": "rate(SeaweedFS_s3_request_total[1m])",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{type}}",
|
"legendFormat": "{{bucket}} {{type}}",
|
||||||
"refId": "A",
|
"refId": "A",
|
||||||
"step": 30
|
"step": 30
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ mkdir tmp
|
|||||||
docker stop s3test-instance || echo "already stopped"
|
docker stop s3test-instance || echo "already stopped"
|
||||||
|
|
||||||
ulimit -n 10000
|
ulimit -n 10000
|
||||||
../../../weed/weed server -filer -s3 -volume.max 0 -master.volumeSizeLimitMB 5 -dir "$(pwd)/tmp" 1>&2>weed.log &
|
../../../weed/weed server -filer -s3 -volume.max 0 -master.volumeSizeLimitMB 5 -dir "$(pwd)/tmp" 1>&2>weed.log &
|
||||||
|
|
||||||
until $(curl --output /dev/null --silent --head --fail http://127.0.0.1:9333); do
|
until curl --output /dev/null --silent --head --fail http://127.0.0.1:9333; do
|
||||||
printf '.'
|
printf '.'
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
@@ -18,7 +18,7 @@ sleep 3
|
|||||||
|
|
||||||
rm -Rf logs-full.txt logs-summary.txt
|
rm -Rf logs-full.txt logs-summary.txt
|
||||||
# docker run --name s3test-instance --rm -e S3TEST_CONF=s3tests.conf -v `pwd`/s3tests.conf:/s3-tests/s3tests.conf -it s3tests ./virtualenv/bin/nosetests s3tests_boto3/functional/test_s3.py:test_get_obj_tagging -v -a 'resource=object,!bucket-policy,!versioning,!encryption'
|
# docker run --name s3test-instance --rm -e S3TEST_CONF=s3tests.conf -v `pwd`/s3tests.conf:/s3-tests/s3tests.conf -it s3tests ./virtualenv/bin/nosetests s3tests_boto3/functional/test_s3.py:test_get_obj_tagging -v -a 'resource=object,!bucket-policy,!versioning,!encryption'
|
||||||
docker run --name s3test-instance --rm -e S3TEST_CONF=s3tests.conf -v `pwd`/s3tests.conf:/s3-tests/s3tests.conf -it s3tests ./virtualenv/bin/nosetests s3tests_boto3/functional/test_s3.py -v -a 'resource=object,!bucket-policy,!versioning,!encryption' | sed -n -e '/botocore.hooks/!p;//q' | tee logs-summary.txt
|
docker run --name s3test-instance --rm -e S3TEST_CONF=s3tests.conf -v "$(pwd)"/s3tests.conf:/s3-tests/s3tests.conf -it s3tests ./virtualenv/bin/nosetests s3tests_boto3/functional/test_s3.py -v -a 'resource=object,!bucket-policy,!versioning,!encryption' | sed -n -e '/botocore.hooks/!p;//q' | tee logs-summary.txt
|
||||||
|
|
||||||
docker stop s3test-instance || echo "already stopped"
|
docker stop s3test-instance || echo "already stopped"
|
||||||
killall -9 weed
|
killall -9 weed
|
||||||
@@ -24,7 +24,7 @@ var (
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
This is to resolve an one-time issue that caused inconsistency with .dat and .idx files.
|
This is to resolve an one-time issue that caused inconsistency with .dat and .idx files.
|
||||||
In this case, the .dat file contains all data, but some of deletion caused incorrect offset.
|
In this case, the .dat file contains all data, but some deletion caused incorrect offset.
|
||||||
The .idx has all correct offsets.
|
The .idx has all correct offsets.
|
||||||
|
|
||||||
1. fix the .dat file, a new .dat_fixed file will be generated.
|
1. fix the .dat file, a new .dat_fixed file will be generated.
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ func startGenerateMetadata() {
|
|||||||
|
|
||||||
func startSubscribeMetadata(eachEntryFunc func(event *filer_pb.SubscribeMetadataResponse) error) {
|
func startSubscribeMetadata(eachEntryFunc func(event *filer_pb.SubscribeMetadataResponse) error) {
|
||||||
|
|
||||||
tailErr := pb.FollowMetadata(pb.ServerAddress(*tailFiler), grpc.WithInsecure(), "tail", 0, *dir, nil, 0, 0, eachEntryFunc, false)
|
tailErr := pb.FollowMetadata(pb.ServerAddress(*tailFiler), grpc.WithInsecure(), "tail", 0, *dir, nil, 0, 0, 0, eachEntryFunc, pb.TrivialOnError)
|
||||||
|
|
||||||
if tailErr != nil {
|
if tailErr != nil {
|
||||||
fmt.Printf("tail %s: %v\n", *tailFiler, tailErr)
|
fmt.Printf("tail %s: %v\n", *tailFiler, tailErr)
|
||||||
|
|||||||
+103
-51
@@ -15,49 +15,66 @@ const (
|
|||||||
BrokerType = "broker"
|
BrokerType = "broker"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ClusterNode struct {
|
type FilerGroup string
|
||||||
Address pb.ServerAddress
|
type Filers struct {
|
||||||
Version string
|
filers map[pb.ServerAddress]*ClusterNode
|
||||||
counter int
|
leaders *Leaders
|
||||||
createdTs time.Time
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type Leaders struct {
|
type Leaders struct {
|
||||||
leaders [3]pb.ServerAddress
|
leaders [3]pb.ServerAddress
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ClusterNode struct {
|
||||||
|
Address pb.ServerAddress
|
||||||
|
Version string
|
||||||
|
counter int
|
||||||
|
CreatedTs time.Time
|
||||||
|
}
|
||||||
|
|
||||||
type Cluster struct {
|
type Cluster struct {
|
||||||
filers map[pb.ServerAddress]*ClusterNode
|
filerGroup2filers map[FilerGroup]*Filers
|
||||||
filersLock sync.RWMutex
|
filersLock sync.RWMutex
|
||||||
filerLeaders *Leaders
|
brokers map[pb.ServerAddress]*ClusterNode
|
||||||
brokers map[pb.ServerAddress]*ClusterNode
|
brokersLock sync.RWMutex
|
||||||
brokersLock sync.RWMutex
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewCluster() *Cluster {
|
func NewCluster() *Cluster {
|
||||||
return &Cluster{
|
return &Cluster{
|
||||||
filers: make(map[pb.ServerAddress]*ClusterNode),
|
filerGroup2filers: make(map[FilerGroup]*Filers),
|
||||||
filerLeaders: &Leaders{},
|
brokers: make(map[pb.ServerAddress]*ClusterNode),
|
||||||
brokers: make(map[pb.ServerAddress]*ClusterNode),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cluster *Cluster) AddClusterNode(nodeType string, address pb.ServerAddress, version string) []*master_pb.KeepConnectedResponse {
|
func (cluster *Cluster) getFilers(filerGroup FilerGroup, createIfNotFound bool) *Filers {
|
||||||
|
filers, found := cluster.filerGroup2filers[filerGroup]
|
||||||
|
if !found && createIfNotFound {
|
||||||
|
filers = &Filers{
|
||||||
|
filers: make(map[pb.ServerAddress]*ClusterNode),
|
||||||
|
leaders: &Leaders{},
|
||||||
|
}
|
||||||
|
cluster.filerGroup2filers[filerGroup] = filers
|
||||||
|
}
|
||||||
|
return filers
|
||||||
|
}
|
||||||
|
|
||||||
|
func (cluster *Cluster) AddClusterNode(ns, nodeType string, address pb.ServerAddress, version string) []*master_pb.KeepConnectedResponse {
|
||||||
|
filerGroup := FilerGroup(ns)
|
||||||
switch nodeType {
|
switch nodeType {
|
||||||
case FilerType:
|
case FilerType:
|
||||||
cluster.filersLock.Lock()
|
cluster.filersLock.Lock()
|
||||||
defer cluster.filersLock.Unlock()
|
defer cluster.filersLock.Unlock()
|
||||||
if existingNode, found := cluster.filers[address]; found {
|
filers := cluster.getFilers(filerGroup, true)
|
||||||
|
if existingNode, found := filers.filers[address]; found {
|
||||||
existingNode.counter++
|
existingNode.counter++
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
cluster.filers[address] = &ClusterNode{
|
filers.filers[address] = &ClusterNode{
|
||||||
Address: address,
|
Address: address,
|
||||||
Version: version,
|
Version: version,
|
||||||
counter: 1,
|
counter: 1,
|
||||||
createdTs: time.Now(),
|
CreatedTs: time.Now(),
|
||||||
}
|
}
|
||||||
return cluster.ensureFilerLeaders(true, nodeType, address)
|
return cluster.ensureFilerLeaders(filers, true, filerGroup, nodeType, address)
|
||||||
case BrokerType:
|
case BrokerType:
|
||||||
cluster.brokersLock.Lock()
|
cluster.brokersLock.Lock()
|
||||||
defer cluster.brokersLock.Unlock()
|
defer cluster.brokersLock.Unlock()
|
||||||
@@ -69,7 +86,7 @@ func (cluster *Cluster) AddClusterNode(nodeType string, address pb.ServerAddress
|
|||||||
Address: address,
|
Address: address,
|
||||||
Version: version,
|
Version: version,
|
||||||
counter: 1,
|
counter: 1,
|
||||||
createdTs: time.Now(),
|
CreatedTs: time.Now(),
|
||||||
}
|
}
|
||||||
return []*master_pb.KeepConnectedResponse{
|
return []*master_pb.KeepConnectedResponse{
|
||||||
{
|
{
|
||||||
@@ -81,22 +98,36 @@ func (cluster *Cluster) AddClusterNode(nodeType string, address pb.ServerAddress
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
case MasterType:
|
case MasterType:
|
||||||
|
return []*master_pb.KeepConnectedResponse{
|
||||||
|
{
|
||||||
|
ClusterNodeUpdate: &master_pb.ClusterNodeUpdate{
|
||||||
|
NodeType: nodeType,
|
||||||
|
Address: string(address),
|
||||||
|
IsAdd: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cluster *Cluster) RemoveClusterNode(nodeType string, address pb.ServerAddress) []*master_pb.KeepConnectedResponse {
|
func (cluster *Cluster) RemoveClusterNode(ns string, nodeType string, address pb.ServerAddress) []*master_pb.KeepConnectedResponse {
|
||||||
|
filerGroup := FilerGroup(ns)
|
||||||
switch nodeType {
|
switch nodeType {
|
||||||
case FilerType:
|
case FilerType:
|
||||||
cluster.filersLock.Lock()
|
cluster.filersLock.Lock()
|
||||||
defer cluster.filersLock.Unlock()
|
defer cluster.filersLock.Unlock()
|
||||||
if existingNode, found := cluster.filers[address]; !found {
|
filers := cluster.getFilers(filerGroup, false)
|
||||||
|
if filers == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if existingNode, found := filers.filers[address]; !found {
|
||||||
return nil
|
return nil
|
||||||
} else {
|
} else {
|
||||||
existingNode.counter--
|
existingNode.counter--
|
||||||
if existingNode.counter <= 0 {
|
if existingNode.counter <= 0 {
|
||||||
delete(cluster.filers, address)
|
delete(filers.filers, address)
|
||||||
return cluster.ensureFilerLeaders(false, nodeType, address)
|
return cluster.ensureFilerLeaders(filers, false, filerGroup, nodeType, address)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case BrokerType:
|
case BrokerType:
|
||||||
@@ -120,16 +151,29 @@ func (cluster *Cluster) RemoveClusterNode(nodeType string, address pb.ServerAddr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
case MasterType:
|
case MasterType:
|
||||||
|
return []*master_pb.KeepConnectedResponse{
|
||||||
|
{
|
||||||
|
ClusterNodeUpdate: &master_pb.ClusterNodeUpdate{
|
||||||
|
NodeType: nodeType,
|
||||||
|
Address: string(address),
|
||||||
|
IsAdd: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cluster *Cluster) ListClusterNode(nodeType string) (nodes []*ClusterNode) {
|
func (cluster *Cluster) ListClusterNode(filerGroup FilerGroup, nodeType string) (nodes []*ClusterNode) {
|
||||||
switch nodeType {
|
switch nodeType {
|
||||||
case FilerType:
|
case FilerType:
|
||||||
cluster.filersLock.RLock()
|
cluster.filersLock.RLock()
|
||||||
defer cluster.filersLock.RUnlock()
|
defer cluster.filersLock.RUnlock()
|
||||||
for _, node := range cluster.filers {
|
filers := cluster.getFilers(filerGroup, false)
|
||||||
|
if filers == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
for _, node := range filers.filers {
|
||||||
nodes = append(nodes, node)
|
nodes = append(nodes, node)
|
||||||
}
|
}
|
||||||
case BrokerType:
|
case BrokerType:
|
||||||
@@ -143,41 +187,48 @@ func (cluster *Cluster) ListClusterNode(nodeType string) (nodes []*ClusterNode)
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cluster *Cluster) IsOneLeader(address pb.ServerAddress) bool {
|
func (cluster *Cluster) IsOneLeader(filerGroup FilerGroup, address pb.ServerAddress) bool {
|
||||||
return cluster.filerLeaders.isOneLeader(address)
|
filers := cluster.getFilers(filerGroup, false)
|
||||||
|
if filers == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return filers.leaders.isOneLeader(address)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cluster *Cluster) ensureFilerLeaders(isAdd bool, nodeType string, address pb.ServerAddress) (result []*master_pb.KeepConnectedResponse) {
|
func (cluster *Cluster) ensureFilerLeaders(filers *Filers, isAdd bool, filerGroup FilerGroup, nodeType string, address pb.ServerAddress) (result []*master_pb.KeepConnectedResponse) {
|
||||||
if isAdd {
|
if isAdd {
|
||||||
if cluster.filerLeaders.addLeaderIfVacant(address) {
|
if filers.leaders.addLeaderIfVacant(address) {
|
||||||
// has added the address as one leader
|
// has added the address as one leader
|
||||||
result = append(result, &master_pb.KeepConnectedResponse{
|
result = append(result, &master_pb.KeepConnectedResponse{
|
||||||
ClusterNodeUpdate: &master_pb.ClusterNodeUpdate{
|
ClusterNodeUpdate: &master_pb.ClusterNodeUpdate{
|
||||||
NodeType: nodeType,
|
FilerGroup: string(filerGroup),
|
||||||
Address: string(address),
|
NodeType: nodeType,
|
||||||
IsLeader: true,
|
Address: string(address),
|
||||||
IsAdd: true,
|
IsLeader: true,
|
||||||
|
IsAdd: true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
result = append(result, &master_pb.KeepConnectedResponse{
|
result = append(result, &master_pb.KeepConnectedResponse{
|
||||||
ClusterNodeUpdate: &master_pb.ClusterNodeUpdate{
|
ClusterNodeUpdate: &master_pb.ClusterNodeUpdate{
|
||||||
NodeType: nodeType,
|
FilerGroup: string(filerGroup),
|
||||||
Address: string(address),
|
NodeType: nodeType,
|
||||||
IsLeader: false,
|
Address: string(address),
|
||||||
IsAdd: true,
|
IsLeader: false,
|
||||||
|
IsAdd: true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if cluster.filerLeaders.removeLeaderIfExists(address) {
|
if filers.leaders.removeLeaderIfExists(address) {
|
||||||
|
|
||||||
result = append(result, &master_pb.KeepConnectedResponse{
|
result = append(result, &master_pb.KeepConnectedResponse{
|
||||||
ClusterNodeUpdate: &master_pb.ClusterNodeUpdate{
|
ClusterNodeUpdate: &master_pb.ClusterNodeUpdate{
|
||||||
NodeType: nodeType,
|
FilerGroup: string(filerGroup),
|
||||||
Address: string(address),
|
NodeType: nodeType,
|
||||||
IsLeader: true,
|
Address: string(address),
|
||||||
IsAdd: false,
|
IsLeader: true,
|
||||||
|
IsAdd: false,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -185,18 +236,18 @@ func (cluster *Cluster) ensureFilerLeaders(isAdd bool, nodeType string, address
|
|||||||
var shortestDuration int64 = math.MaxInt64
|
var shortestDuration int64 = math.MaxInt64
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
var candidateAddress pb.ServerAddress
|
var candidateAddress pb.ServerAddress
|
||||||
for _, node := range cluster.filers {
|
for _, node := range filers.filers {
|
||||||
if cluster.filerLeaders.isOneLeader(node.Address) {
|
if filers.leaders.isOneLeader(node.Address) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
duration := now.Sub(node.createdTs).Nanoseconds()
|
duration := now.Sub(node.CreatedTs).Nanoseconds()
|
||||||
if duration < shortestDuration {
|
if duration < shortestDuration {
|
||||||
shortestDuration = duration
|
shortestDuration = duration
|
||||||
candidateAddress = node.Address
|
candidateAddress = node.Address
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if candidateAddress != "" {
|
if candidateAddress != "" {
|
||||||
cluster.filerLeaders.addLeaderIfVacant(candidateAddress)
|
filers.leaders.addLeaderIfVacant(candidateAddress)
|
||||||
// added a new leader
|
// added a new leader
|
||||||
result = append(result, &master_pb.KeepConnectedResponse{
|
result = append(result, &master_pb.KeepConnectedResponse{
|
||||||
ClusterNodeUpdate: &master_pb.ClusterNodeUpdate{
|
ClusterNodeUpdate: &master_pb.ClusterNodeUpdate{
|
||||||
@@ -210,10 +261,11 @@ func (cluster *Cluster) ensureFilerLeaders(isAdd bool, nodeType string, address
|
|||||||
} else {
|
} else {
|
||||||
result = append(result, &master_pb.KeepConnectedResponse{
|
result = append(result, &master_pb.KeepConnectedResponse{
|
||||||
ClusterNodeUpdate: &master_pb.ClusterNodeUpdate{
|
ClusterNodeUpdate: &master_pb.ClusterNodeUpdate{
|
||||||
NodeType: nodeType,
|
FilerGroup: string(filerGroup),
|
||||||
Address: string(address),
|
NodeType: nodeType,
|
||||||
IsLeader: false,
|
Address: string(address),
|
||||||
IsAdd: false,
|
IsLeader: false,
|
||||||
|
IsAdd: false,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,45 +3,79 @@ package cluster
|
|||||||
import (
|
import (
|
||||||
"github.com/chrislusf/seaweedfs/weed/pb"
|
"github.com/chrislusf/seaweedfs/weed/pb"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
"strconv"
|
||||||
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestClusterAddRemoveNodes(t *testing.T) {
|
func TestClusterAddRemoveNodes(t *testing.T) {
|
||||||
c := NewCluster()
|
c := NewCluster()
|
||||||
|
|
||||||
c.AddClusterNode("filer", pb.ServerAddress("111:1"), "23.45")
|
c.AddClusterNode("", "filer", pb.ServerAddress("111:1"), "23.45")
|
||||||
c.AddClusterNode("filer", pb.ServerAddress("111:2"), "23.45")
|
c.AddClusterNode("", "filer", pb.ServerAddress("111:2"), "23.45")
|
||||||
assert.Equal(t, []pb.ServerAddress{
|
assert.Equal(t, []pb.ServerAddress{
|
||||||
pb.ServerAddress("111:1"),
|
pb.ServerAddress("111:1"),
|
||||||
pb.ServerAddress("111:2"),
|
pb.ServerAddress("111:2"),
|
||||||
}, c.filerLeaders.GetLeaders())
|
}, c.getFilers("", false).leaders.GetLeaders())
|
||||||
|
|
||||||
c.AddClusterNode("filer", pb.ServerAddress("111:3"), "23.45")
|
c.AddClusterNode("", "filer", pb.ServerAddress("111:3"), "23.45")
|
||||||
c.AddClusterNode("filer", pb.ServerAddress("111:4"), "23.45")
|
c.AddClusterNode("", "filer", pb.ServerAddress("111:4"), "23.45")
|
||||||
assert.Equal(t, []pb.ServerAddress{
|
assert.Equal(t, []pb.ServerAddress{
|
||||||
pb.ServerAddress("111:1"),
|
pb.ServerAddress("111:1"),
|
||||||
pb.ServerAddress("111:2"),
|
pb.ServerAddress("111:2"),
|
||||||
pb.ServerAddress("111:3"),
|
pb.ServerAddress("111:3"),
|
||||||
}, c.filerLeaders.GetLeaders())
|
}, c.getFilers("", false).leaders.GetLeaders())
|
||||||
|
|
||||||
c.AddClusterNode("filer", pb.ServerAddress("111:5"), "23.45")
|
c.AddClusterNode("", "filer", pb.ServerAddress("111:5"), "23.45")
|
||||||
c.AddClusterNode("filer", pb.ServerAddress("111:6"), "23.45")
|
c.AddClusterNode("", "filer", pb.ServerAddress("111:6"), "23.45")
|
||||||
c.RemoveClusterNode("filer", pb.ServerAddress("111:4"))
|
c.RemoveClusterNode("", "filer", pb.ServerAddress("111:4"))
|
||||||
assert.Equal(t, []pb.ServerAddress{
|
assert.Equal(t, []pb.ServerAddress{
|
||||||
pb.ServerAddress("111:1"),
|
pb.ServerAddress("111:1"),
|
||||||
pb.ServerAddress("111:2"),
|
pb.ServerAddress("111:2"),
|
||||||
pb.ServerAddress("111:3"),
|
pb.ServerAddress("111:3"),
|
||||||
}, c.filerLeaders.GetLeaders())
|
}, c.getFilers("", false).leaders.GetLeaders())
|
||||||
|
|
||||||
// remove oldest
|
// remove oldest
|
||||||
c.RemoveClusterNode("filer", pb.ServerAddress("111:1"))
|
c.RemoveClusterNode("", "filer", pb.ServerAddress("111:1"))
|
||||||
assert.Equal(t, []pb.ServerAddress{
|
assert.Equal(t, []pb.ServerAddress{
|
||||||
pb.ServerAddress("111:6"),
|
pb.ServerAddress("111:6"),
|
||||||
pb.ServerAddress("111:2"),
|
pb.ServerAddress("111:2"),
|
||||||
pb.ServerAddress("111:3"),
|
pb.ServerAddress("111:3"),
|
||||||
}, c.filerLeaders.GetLeaders())
|
}, c.getFilers("", false).leaders.GetLeaders())
|
||||||
|
|
||||||
// remove oldest
|
// remove oldest
|
||||||
c.RemoveClusterNode("filer", pb.ServerAddress("111:1"))
|
c.RemoveClusterNode("", "filer", pb.ServerAddress("111:1"))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestConcurrentAddRemoveNodes(t *testing.T) {
|
||||||
|
c := NewCluster()
|
||||||
|
var wg sync.WaitGroup
|
||||||
|
for i := 0; i < 50; i++ {
|
||||||
|
wg.Add(1)
|
||||||
|
go func(i int) {
|
||||||
|
defer wg.Done()
|
||||||
|
address := strconv.Itoa(i)
|
||||||
|
c.AddClusterNode("", "filer", pb.ServerAddress(address), "23.45")
|
||||||
|
}(i)
|
||||||
|
}
|
||||||
|
wg.Wait()
|
||||||
|
|
||||||
|
for i := 0; i < 50; i++ {
|
||||||
|
wg.Add(1)
|
||||||
|
go func(i int) {
|
||||||
|
defer wg.Done()
|
||||||
|
address := strconv.Itoa(i)
|
||||||
|
node := c.RemoveClusterNode("", "filer", pb.ServerAddress(address))
|
||||||
|
|
||||||
|
if len(node) == 0 {
|
||||||
|
t.Errorf("TestConcurrentAddRemoveNodes: node[%s] not found", address)
|
||||||
|
return
|
||||||
|
} else if node[0].ClusterNodeUpdate.Address != address {
|
||||||
|
t.Errorf("TestConcurrentAddRemoveNodes: expect:%s, actual:%s", address, node[0].ClusterNodeUpdate.Address)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}(i)
|
||||||
|
}
|
||||||
|
wg.Wait()
|
||||||
|
}
|
||||||
@@ -41,7 +41,7 @@ func AutocompleteMain(commands []*Command) bool {
|
|||||||
|
|
||||||
func installAutoCompletion() bool {
|
func installAutoCompletion() bool {
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
fmt.Println("windows is not supported")
|
fmt.Println("Windows is not supported")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ func installAutoCompletion() bool {
|
|||||||
|
|
||||||
func uninstallAutoCompletion() bool {
|
func uninstallAutoCompletion() bool {
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
fmt.Println("windows is not supported")
|
fmt.Println("Windows is not supported")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ func uninstallAutoCompletion() bool {
|
|||||||
fmt.Printf("uninstall failed! %s\n", err)
|
fmt.Printf("uninstall failed! %s\n", err)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
fmt.Printf("autocompletion is disable. Please restart your shell.\n")
|
fmt.Printf("autocompletion is disabled. Please restart your shell.\n")
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ func runBackup(cmd *Command, args []string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if v.SuperBlock.CompactionRevision < uint16(stats.CompactRevision) {
|
if v.SuperBlock.CompactionRevision < uint16(stats.CompactRevision) {
|
||||||
if err = v.Compact2(30*1024*1024*1024, 0, nil); err != nil {
|
if err = v.Compact2(0, 0, nil); err != nil {
|
||||||
fmt.Printf("Compact Volume before synchronizing %v\n", err)
|
fmt.Printf("Compact Volume before synchronizing %v\n", err)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,14 +74,14 @@ func init() {
|
|||||||
|
|
||||||
var cmdBenchmark = &Command{
|
var cmdBenchmark = &Command{
|
||||||
UsageLine: "benchmark -master=localhost:9333 -c=10 -n=100000",
|
UsageLine: "benchmark -master=localhost:9333 -c=10 -n=100000",
|
||||||
Short: "benchmark on writing millions of files and read out",
|
Short: "benchmark by writing millions of files and reading them out",
|
||||||
Long: `benchmark on an empty SeaweedFS file system.
|
Long: `benchmark on an empty SeaweedFS file system.
|
||||||
|
|
||||||
Two tests during benchmark:
|
Two tests during benchmark:
|
||||||
1) write lots of small files to the system
|
1) write lots of small files to the system
|
||||||
2) read the files out
|
2) read the files out
|
||||||
|
|
||||||
The file content is mostly zero, but no compression is done.
|
The file content is mostly zeros, but no compression is done.
|
||||||
|
|
||||||
You can choose to only benchmark read or write.
|
You can choose to only benchmark read or write.
|
||||||
During write, the list of uploaded file ids is stored in "-list" specified file.
|
During write, the list of uploaded file ids is stored in "-list" specified file.
|
||||||
@@ -129,7 +129,7 @@ func runBenchmark(cmd *Command, args []string) bool {
|
|||||||
defer pprof.StopCPUProfile()
|
defer pprof.StopCPUProfile()
|
||||||
}
|
}
|
||||||
|
|
||||||
b.masterClient = wdclient.NewMasterClient(b.grpcDialOption, "client", "", "", pb.ServerAddresses(*b.masters).ToAddressMap())
|
b.masterClient = wdclient.NewMasterClient(b.grpcDialOption, "", "client", "", "", pb.ServerAddresses(*b.masters).ToAddressMap())
|
||||||
go b.masterClient.KeepConnectedToMaster()
|
go b.masterClient.KeepConnectedToMaster()
|
||||||
b.masterClient.WaitUntilConnected()
|
b.masterClient.WaitUntilConnected()
|
||||||
|
|
||||||
@@ -468,7 +468,7 @@ func (s *stats) printStats() {
|
|||||||
timeTaken := float64(int64(s.end.Sub(s.start))) / 1000000000
|
timeTaken := float64(int64(s.end.Sub(s.start))) / 1000000000
|
||||||
fmt.Printf("\nConcurrency Level: %d\n", *b.concurrency)
|
fmt.Printf("\nConcurrency Level: %d\n", *b.concurrency)
|
||||||
fmt.Printf("Time taken for tests: %.3f seconds\n", timeTaken)
|
fmt.Printf("Time taken for tests: %.3f seconds\n", timeTaken)
|
||||||
fmt.Printf("Complete requests: %d\n", completed)
|
fmt.Printf("Completed requests: %d\n", completed)
|
||||||
fmt.Printf("Failed requests: %d\n", failed)
|
fmt.Printf("Failed requests: %d\n", failed)
|
||||||
fmt.Printf("Total transferred: %d bytes\n", transferred)
|
fmt.Printf("Total transferred: %d bytes\n", transferred)
|
||||||
fmt.Printf("Requests per second: %.2f [#/sec]\n", float64(completed)/timeTaken)
|
fmt.Printf("Requests per second: %.2f [#/sec]\n", float64(completed)/timeTaken)
|
||||||
|
|||||||
@@ -2,9 +2,10 @@ package command
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
flag "github.com/chrislusf/seaweedfs/weed/util/fla9"
|
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
flag "github.com/chrislusf/seaweedfs/weed/util/fla9"
|
||||||
)
|
)
|
||||||
|
|
||||||
var Commands = []*Command{
|
var Commands = []*Command{
|
||||||
@@ -36,6 +37,7 @@ var Commands = []*Command{
|
|||||||
cmdScaffold,
|
cmdScaffold,
|
||||||
cmdServer,
|
cmdServer,
|
||||||
cmdShell,
|
cmdShell,
|
||||||
|
cmdUpdate,
|
||||||
cmdUpload,
|
cmdUpload,
|
||||||
cmdVersion,
|
cmdVersion,
|
||||||
cmdVolume,
|
cmdVolume,
|
||||||
|
|||||||
+45
-22
@@ -5,10 +5,14 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
|
"sort"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"google.golang.org/grpc/reflection"
|
"google.golang.org/grpc/reflection"
|
||||||
|
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/filer"
|
||||||
"github.com/chrislusf/seaweedfs/weed/glog"
|
"github.com/chrislusf/seaweedfs/weed/glog"
|
||||||
"github.com/chrislusf/seaweedfs/weed/pb"
|
"github.com/chrislusf/seaweedfs/weed/pb"
|
||||||
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
|
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
|
||||||
@@ -36,6 +40,7 @@ type FilerOptions struct {
|
|||||||
port *int
|
port *int
|
||||||
portGrpc *int
|
portGrpc *int
|
||||||
publicPort *int
|
publicPort *int
|
||||||
|
filerGroup *string
|
||||||
collection *string
|
collection *string
|
||||||
defaultReplicaPlacement *string
|
defaultReplicaPlacement *string
|
||||||
disableDirListing *bool
|
disableDirListing *bool
|
||||||
@@ -53,11 +58,13 @@ type FilerOptions struct {
|
|||||||
debug *bool
|
debug *bool
|
||||||
debugPort *int
|
debugPort *int
|
||||||
localSocket *string
|
localSocket *string
|
||||||
|
showUIDirectoryDelete *bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cmdFiler.Run = runFiler // break init cycle
|
cmdFiler.Run = runFiler // break init cycle
|
||||||
f.mastersString = cmdFiler.Flag.String("master", "localhost:9333", "comma-separated master servers")
|
f.mastersString = cmdFiler.Flag.String("master", "localhost:9333", "comma-separated master servers")
|
||||||
|
f.filerGroup = cmdFiler.Flag.String("filerGroup", "", "share metadata with other filers in the same filerGroup")
|
||||||
f.collection = cmdFiler.Flag.String("collection", "", "all data will be stored in this default collection")
|
f.collection = cmdFiler.Flag.String("collection", "", "all data will be stored in this default collection")
|
||||||
f.ip = cmdFiler.Flag.String("ip", util.DetectedHostAddress(), "filer server http listen ip address")
|
f.ip = cmdFiler.Flag.String("ip", util.DetectedHostAddress(), "filer server http listen ip address")
|
||||||
f.bindIp = cmdFiler.Flag.String("ip.bind", "", "ip address to bind to. If empty, default to same as -ip option.")
|
f.bindIp = cmdFiler.Flag.String("ip.bind", "", "ip address to bind to. If empty, default to same as -ip option.")
|
||||||
@@ -79,10 +86,12 @@ func init() {
|
|||||||
f.debug = cmdFiler.Flag.Bool("debug", false, "serves runtime profiling data, e.g., http://localhost:<debug.port>/debug/pprof/goroutine?debug=2")
|
f.debug = cmdFiler.Flag.Bool("debug", false, "serves runtime profiling data, e.g., http://localhost:<debug.port>/debug/pprof/goroutine?debug=2")
|
||||||
f.debugPort = cmdFiler.Flag.Int("debug.port", 6060, "http port for debugging")
|
f.debugPort = cmdFiler.Flag.Int("debug.port", 6060, "http port for debugging")
|
||||||
f.localSocket = cmdFiler.Flag.String("localSocket", "", "default to /tmp/seaweedfs-filer-<port>.sock")
|
f.localSocket = cmdFiler.Flag.String("localSocket", "", "default to /tmp/seaweedfs-filer-<port>.sock")
|
||||||
|
f.showUIDirectoryDelete = cmdFiler.Flag.Bool("ui.deleteDir", true, "enable filer UI show delete directory button")
|
||||||
|
|
||||||
// start s3 on filer
|
// start s3 on filer
|
||||||
filerStartS3 = cmdFiler.Flag.Bool("s3", false, "whether to start S3 gateway")
|
filerStartS3 = cmdFiler.Flag.Bool("s3", false, "whether to start S3 gateway")
|
||||||
filerS3Options.port = cmdFiler.Flag.Int("s3.port", 8333, "s3 server http listen port")
|
filerS3Options.port = cmdFiler.Flag.Int("s3.port", 8333, "s3 server http listen port")
|
||||||
|
filerS3Options.portGrpc = cmdFiler.Flag.Int("s3.port.grpc", 0, "s3 server grpc listen port")
|
||||||
filerS3Options.domainName = cmdFiler.Flag.String("s3.domainName", "", "suffix of the host name in comma separated list, {bucket}.{domainName}")
|
filerS3Options.domainName = cmdFiler.Flag.String("s3.domainName", "", "suffix of the host name in comma separated list, {bucket}.{domainName}")
|
||||||
filerS3Options.tlsPrivateKey = cmdFiler.Flag.String("s3.key.file", "", "path to the TLS private key file")
|
filerS3Options.tlsPrivateKey = cmdFiler.Flag.String("s3.key.file", "", "path to the TLS private key file")
|
||||||
filerS3Options.tlsCertificate = cmdFiler.Flag.String("s3.cert.file", "", "path to the TLS certificate file")
|
filerS3Options.tlsCertificate = cmdFiler.Flag.String("s3.cert.file", "", "path to the TLS certificate file")
|
||||||
@@ -108,10 +117,8 @@ func init() {
|
|||||||
filerIamOptions.port = cmdFiler.Flag.Int("iam.port", 8111, "iam server http listen port")
|
filerIamOptions.port = cmdFiler.Flag.Int("iam.port", 8111, "iam server http listen port")
|
||||||
}
|
}
|
||||||
|
|
||||||
var cmdFiler = &Command{
|
func filerLongDesc() string {
|
||||||
UsageLine: "filer -port=8888 -master=<ip:port>[,<ip:port>]*",
|
desc := `start a file server which accepts REST operation for any files.
|
||||||
Short: "start a file server that points to a master server, or a list of master servers",
|
|
||||||
Long: `start a file server which accepts REST operation for any files.
|
|
||||||
|
|
||||||
//create or overwrite the file, the directories /path/to will be automatically created
|
//create or overwrite the file, the directories /path/to will be automatically created
|
||||||
POST /path/to/file
|
POST /path/to/file
|
||||||
@@ -127,7 +134,22 @@ var cmdFiler = &Command{
|
|||||||
|
|
||||||
The example filer.toml configuration file can be generated by "weed scaffold -config=filer"
|
The example filer.toml configuration file can be generated by "weed scaffold -config=filer"
|
||||||
|
|
||||||
`,
|
Supported Filer Stores:
|
||||||
|
`
|
||||||
|
|
||||||
|
storeNames := make([]string, len(filer.Stores))
|
||||||
|
for i, store := range filer.Stores {
|
||||||
|
storeNames[i] = "\t" + store.GetName()
|
||||||
|
}
|
||||||
|
sort.Strings(storeNames)
|
||||||
|
storeList := strings.Join(storeNames, "\n")
|
||||||
|
return desc + storeList
|
||||||
|
}
|
||||||
|
|
||||||
|
var cmdFiler = &Command{
|
||||||
|
UsageLine: "filer -port=8888 -master=<ip:port>[,<ip:port>]*",
|
||||||
|
Short: "start a file server that points to a master server, or a list of master servers",
|
||||||
|
Long: filerLongDesc(),
|
||||||
}
|
}
|
||||||
|
|
||||||
func runFiler(cmd *Command, args []string) bool {
|
func runFiler(cmd *Command, args []string) bool {
|
||||||
@@ -150,8 +172,6 @@ func runFiler(cmd *Command, args []string) bool {
|
|||||||
filerS3Options.startS3Server()
|
filerS3Options.startS3Server()
|
||||||
}()
|
}()
|
||||||
startDelay++
|
startDelay++
|
||||||
} else {
|
|
||||||
*f.localSocket = ""
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if *filerStartWebDav {
|
if *filerStartWebDav {
|
||||||
@@ -200,6 +220,7 @@ func (fo *FilerOptions) startFiler() {
|
|||||||
|
|
||||||
fs, nfs_err := weed_server.NewFilerServer(defaultMux, publicVolumeMux, &weed_server.FilerOption{
|
fs, nfs_err := weed_server.NewFilerServer(defaultMux, publicVolumeMux, &weed_server.FilerOption{
|
||||||
Masters: fo.masters,
|
Masters: fo.masters,
|
||||||
|
FilerGroup: *fo.filerGroup,
|
||||||
Collection: *fo.collection,
|
Collection: *fo.collection,
|
||||||
DefaultReplication: *fo.defaultReplicaPlacement,
|
DefaultReplication: *fo.defaultReplicaPlacement,
|
||||||
DisableDirListing: *fo.disableDirListing,
|
DisableDirListing: *fo.disableDirListing,
|
||||||
@@ -213,6 +234,7 @@ func (fo *FilerOptions) startFiler() {
|
|||||||
Cipher: *fo.cipher,
|
Cipher: *fo.cipher,
|
||||||
SaveToFilerLimit: int64(*fo.saveToFilerLimit),
|
SaveToFilerLimit: int64(*fo.saveToFilerLimit),
|
||||||
ConcurrentUploadLimit: int64(*fo.concurrentUploadLimitMB) * 1024 * 1024,
|
ConcurrentUploadLimit: int64(*fo.concurrentUploadLimitMB) * 1024 * 1024,
|
||||||
|
ShowUIDirectoryDelete: *fo.showUIDirectoryDelete,
|
||||||
})
|
})
|
||||||
if nfs_err != nil {
|
if nfs_err != nil {
|
||||||
glog.Fatalf("Filer startup error: %v", nfs_err)
|
glog.Fatalf("Filer startup error: %v", nfs_err)
|
||||||
@@ -248,18 +270,6 @@ func (fo *FilerOptions) startFiler() {
|
|||||||
glog.Fatalf("Filer listener error: %v", e)
|
glog.Fatalf("Filer listener error: %v", e)
|
||||||
}
|
}
|
||||||
|
|
||||||
// start on local unix socket
|
|
||||||
if *fo.localSocket == "" {
|
|
||||||
*fo.localSocket = fmt.Sprintf("/tmp/seaweefs-filer-%d.sock", *fo.port)
|
|
||||||
if err := os.Remove(*fo.localSocket); err != nil && !os.IsNotExist(err) {
|
|
||||||
glog.Fatalf("Failed to remove %s, error: %s", *fo.localSocket, err.Error())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
filerSocketListener, err := net.Listen("unix", *fo.localSocket)
|
|
||||||
if err != nil {
|
|
||||||
glog.Fatalf("Failed to listen on %s: %v", *fo.localSocket, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// starting grpc server
|
// starting grpc server
|
||||||
grpcPort := *fo.portGrpc
|
grpcPort := *fo.portGrpc
|
||||||
grpcL, grpcLocalL, err := util.NewIpAndLocalListeners(*fo.bindIp, grpcPort, 0)
|
grpcL, grpcLocalL, err := util.NewIpAndLocalListeners(*fo.bindIp, grpcPort, 0)
|
||||||
@@ -275,9 +285,22 @@ func (fo *FilerOptions) startFiler() {
|
|||||||
go grpcS.Serve(grpcL)
|
go grpcS.Serve(grpcL)
|
||||||
|
|
||||||
httpS := &http.Server{Handler: defaultMux}
|
httpS := &http.Server{Handler: defaultMux}
|
||||||
go func() {
|
if runtime.GOOS != "windows" {
|
||||||
httpS.Serve(filerSocketListener)
|
if *fo.localSocket == "" {
|
||||||
}()
|
*fo.localSocket = fmt.Sprintf("/tmp/seaweefs-filer-%d.sock", *fo.port)
|
||||||
|
}
|
||||||
|
if err := os.Remove(*fo.localSocket); err != nil && !os.IsNotExist(err) {
|
||||||
|
glog.Fatalf("Failed to remove %s, error: %s", *fo.localSocket, err.Error())
|
||||||
|
}
|
||||||
|
go func() {
|
||||||
|
// start on local unix socket
|
||||||
|
filerSocketListener, err := net.Listen("unix", *fo.localSocket)
|
||||||
|
if err != nil {
|
||||||
|
glog.Fatalf("Failed to listen on %s: %v", *fo.localSocket, err)
|
||||||
|
}
|
||||||
|
httpS.Serve(filerSocketListener)
|
||||||
|
}()
|
||||||
|
}
|
||||||
if filerLocalListener != nil {
|
if filerLocalListener != nil {
|
||||||
go func() {
|
go func() {
|
||||||
if err := httpS.Serve(filerLocalListener); err != nil {
|
if err := httpS.Serve(filerLocalListener); err != nil {
|
||||||
|
|||||||
@@ -114,7 +114,6 @@ func doFilerBackup(grpcDialOption grpc.DialOption, backupOption *FilerBackupOpti
|
|||||||
return setOffset(grpcDialOption, sourceFiler, BackupKeyPrefix, int32(sinkId), lastTsNs)
|
return setOffset(grpcDialOption, sourceFiler, BackupKeyPrefix, int32(sinkId), lastTsNs)
|
||||||
})
|
})
|
||||||
|
|
||||||
return pb.FollowMetadata(sourceFiler, grpcDialOption, "backup_"+dataSink.GetName(), clientId,
|
return pb.FollowMetadata(sourceFiler, grpcDialOption, "backup_"+dataSink.GetName(), clientId, sourcePath, nil, startFrom.UnixNano(), 0, 0, processEventFnWithOffset, pb.TrivialOnError)
|
||||||
sourcePath, nil, startFrom.UnixNano(), 0, processEventFnWithOffset, false)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
+17
-21
@@ -71,7 +71,7 @@ var cmdFilerCopy = &Command{
|
|||||||
It can copy one or a list of files or folders.
|
It can copy one or a list of files or folders.
|
||||||
|
|
||||||
If copying a whole folder recursively:
|
If copying a whole folder recursively:
|
||||||
All files under the folder and subfolders will be copyed.
|
All files under the folder and sub folders will be copied.
|
||||||
Optional parameter "-include" allows you to specify the file name patterns.
|
Optional parameter "-include" allows you to specify the file name patterns.
|
||||||
|
|
||||||
If "maxMB" is set to a positive number, files larger than it would be split into chunks.
|
If "maxMB" is set to a positive number, files larger than it would be split into chunks.
|
||||||
@@ -410,16 +410,14 @@ func (worker *FileCopyWorker) uploadFileAsOne(task FileCopyTask, f *os.File) err
|
|||||||
Entry: &filer_pb.Entry{
|
Entry: &filer_pb.Entry{
|
||||||
Name: fileName,
|
Name: fileName,
|
||||||
Attributes: &filer_pb.FuseAttributes{
|
Attributes: &filer_pb.FuseAttributes{
|
||||||
Crtime: time.Now().Unix(),
|
Crtime: time.Now().Unix(),
|
||||||
Mtime: time.Now().Unix(),
|
Mtime: time.Now().Unix(),
|
||||||
Gid: task.gid,
|
Gid: task.gid,
|
||||||
Uid: task.uid,
|
Uid: task.uid,
|
||||||
FileSize: uint64(task.fileSize),
|
FileSize: uint64(task.fileSize),
|
||||||
FileMode: uint32(task.fileMode),
|
FileMode: uint32(task.fileMode),
|
||||||
Mime: mimeType,
|
Mime: mimeType,
|
||||||
Replication: *worker.options.replication,
|
TtlSec: worker.options.ttlSec,
|
||||||
Collection: *worker.options.collection,
|
|
||||||
TtlSec: worker.options.ttlSec,
|
|
||||||
},
|
},
|
||||||
Chunks: chunks,
|
Chunks: chunks,
|
||||||
},
|
},
|
||||||
@@ -547,16 +545,14 @@ func (worker *FileCopyWorker) uploadFileInChunks(task FileCopyTask, f *os.File,
|
|||||||
Entry: &filer_pb.Entry{
|
Entry: &filer_pb.Entry{
|
||||||
Name: fileName,
|
Name: fileName,
|
||||||
Attributes: &filer_pb.FuseAttributes{
|
Attributes: &filer_pb.FuseAttributes{
|
||||||
Crtime: time.Now().Unix(),
|
Crtime: time.Now().Unix(),
|
||||||
Mtime: time.Now().Unix(),
|
Mtime: time.Now().Unix(),
|
||||||
Gid: task.gid,
|
Gid: task.gid,
|
||||||
Uid: task.uid,
|
Uid: task.uid,
|
||||||
FileSize: uint64(task.fileSize),
|
FileSize: uint64(task.fileSize),
|
||||||
FileMode: uint32(task.fileMode),
|
FileMode: uint32(task.fileMode),
|
||||||
Mime: mimeType,
|
Mime: mimeType,
|
||||||
Replication: replication,
|
TtlSec: worker.options.ttlSec,
|
||||||
Collection: collection,
|
|
||||||
TtlSec: worker.options.ttlSec,
|
|
||||||
},
|
},
|
||||||
Chunks: manifestedChunks,
|
Chunks: manifestedChunks,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ func (metaBackup *FilerMetaBackupOptions) streamMetadataBackup() error {
|
|||||||
})
|
})
|
||||||
|
|
||||||
return pb.FollowMetadata(pb.ServerAddress(*metaBackup.filerAddress), metaBackup.grpcDialOption, "meta_backup", metaBackup.clientId,
|
return pb.FollowMetadata(pb.ServerAddress(*metaBackup.filerAddress), metaBackup.grpcDialOption, "meta_backup", metaBackup.clientId,
|
||||||
*metaBackup.filerDirectory, nil, startTime.UnixNano(), 0, processEventFnWithOffset, false)
|
*metaBackup.filerDirectory, nil, startTime.UnixNano(), 0, 0, processEventFnWithOffset, pb.TrivialOnError)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
package command
|
package command
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/chrislusf/seaweedfs/weed/pb"
|
"github.com/chrislusf/seaweedfs/weed/pb"
|
||||||
"github.com/golang/protobuf/jsonpb"
|
"github.com/golang/protobuf/jsonpb"
|
||||||
jsoniter "github.com/json-iterator/go"
|
|
||||||
elastic "github.com/olivere/elastic/v7"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -28,6 +25,7 @@ var cmdFilerMetaTail = &Command{
|
|||||||
|
|
||||||
weed filer.meta.tail -timeAgo=30h | grep truncate
|
weed filer.meta.tail -timeAgo=30h | grep truncate
|
||||||
weed filer.meta.tail -timeAgo=30h | jq .
|
weed filer.meta.tail -timeAgo=30h | jq .
|
||||||
|
weed filer.meta.tail -timeAgo=30h -untilTimeAgo=20h | jq .
|
||||||
weed filer.meta.tail -timeAgo=30h | jq .eventNotification.newEntry.name
|
weed filer.meta.tail -timeAgo=30h | jq .eventNotification.newEntry.name
|
||||||
|
|
||||||
weed filer.meta.tail -timeAgo=30h -es=http://<elasticSearchServerHost>:<port> -es.index=seaweedfs
|
weed filer.meta.tail -timeAgo=30h -es=http://<elasticSearchServerHost>:<port> -es.index=seaweedfs
|
||||||
@@ -39,6 +37,7 @@ var (
|
|||||||
tailFiler = cmdFilerMetaTail.Flag.String("filer", "localhost:8888", "filer hostname:port")
|
tailFiler = cmdFilerMetaTail.Flag.String("filer", "localhost:8888", "filer hostname:port")
|
||||||
tailTarget = cmdFilerMetaTail.Flag.String("pathPrefix", "/", "path to a folder or common prefix for the folders or files on filer")
|
tailTarget = cmdFilerMetaTail.Flag.String("pathPrefix", "/", "path to a folder or common prefix for the folders or files on filer")
|
||||||
tailStart = cmdFilerMetaTail.Flag.Duration("timeAgo", 0, "start time before now. \"300ms\", \"1.5h\" or \"2h45m\". Valid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\"")
|
tailStart = cmdFilerMetaTail.Flag.Duration("timeAgo", 0, "start time before now. \"300ms\", \"1.5h\" or \"2h45m\". Valid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\"")
|
||||||
|
tailStop = cmdFilerMetaTail.Flag.Duration("untilTimeAgo", 0, "read until this time ago. \"300ms\", \"1.5h\" or \"2h45m\". Valid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\"")
|
||||||
tailPattern = cmdFilerMetaTail.Flag.String("pattern", "", "full path or just filename pattern, ex: \"/home/?opher\", \"*.pdf\", see https://golang.org/pkg/path/filepath/#Match ")
|
tailPattern = cmdFilerMetaTail.Flag.String("pattern", "", "full path or just filename pattern, ex: \"/home/?opher\", \"*.pdf\", see https://golang.org/pkg/path/filepath/#Match ")
|
||||||
esServers = cmdFilerMetaTail.Flag.String("es", "", "comma-separated elastic servers http://<host:port>")
|
esServers = cmdFilerMetaTail.Flag.String("es", "", "comma-separated elastic servers http://<host:port>")
|
||||||
esIndex = cmdFilerMetaTail.Flag.String("es.index", "seaweedfs", "ES index name")
|
esIndex = cmdFilerMetaTail.Flag.String("es.index", "seaweedfs", "ES index name")
|
||||||
@@ -106,9 +105,13 @@ func runFilerMetaTail(cmd *Command, args []string) bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tailErr := pb.FollowMetadata(pb.ServerAddress(*tailFiler), grpcDialOption, "tail", clientId,
|
var untilTsNs int64
|
||||||
*tailTarget, nil, time.Now().Add(-*tailStart).UnixNano(), 0,
|
if *tailStop != 0 {
|
||||||
func(resp *filer_pb.SubscribeMetadataResponse) error {
|
untilTsNs = time.Now().Add(-*tailStop).UnixNano()
|
||||||
|
}
|
||||||
|
|
||||||
|
tailErr := pb.FollowMetadata(pb.ServerAddress(*tailFiler), grpcDialOption, "tail", clientId, *tailTarget, nil,
|
||||||
|
time.Now().Add(-*tailStart).UnixNano(), untilTsNs, 0, func(resp *filer_pb.SubscribeMetadataResponse) error {
|
||||||
if !shouldPrint(resp) {
|
if !shouldPrint(resp) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -116,7 +119,7 @@ func runFilerMetaTail(cmd *Command, args []string) bool {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}, false)
|
}, pb.TrivialOnError)
|
||||||
|
|
||||||
if tailErr != nil {
|
if tailErr != nil {
|
||||||
fmt.Printf("tail %s: %v\n", *tailFiler, tailErr)
|
fmt.Printf("tail %s: %v\n", *tailFiler, tailErr)
|
||||||
@@ -124,72 +127,3 @@ func runFilerMetaTail(cmd *Command, args []string) bool {
|
|||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
type EsDocument struct {
|
|
||||||
Dir string `json:"dir,omitempty"`
|
|
||||||
Name string `json:"name,omitempty"`
|
|
||||||
IsDirectory bool `json:"isDir,omitempty"`
|
|
||||||
Size uint64 `json:"size,omitempty"`
|
|
||||||
Uid uint32 `json:"uid,omitempty"`
|
|
||||||
Gid uint32 `json:"gid,omitempty"`
|
|
||||||
UserName string `json:"userName,omitempty"`
|
|
||||||
Collection string `json:"collection,omitempty"`
|
|
||||||
Crtime int64 `json:"crtime,omitempty"`
|
|
||||||
Mtime int64 `json:"mtime,omitempty"`
|
|
||||||
Mime string `json:"mime,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func toEsEntry(event *filer_pb.EventNotification) (*EsDocument, string) {
|
|
||||||
entry := event.NewEntry
|
|
||||||
dir, name := event.NewParentPath, entry.Name
|
|
||||||
id := util.Md5String([]byte(util.NewFullPath(dir, name)))
|
|
||||||
esEntry := &EsDocument{
|
|
||||||
Dir: dir,
|
|
||||||
Name: name,
|
|
||||||
IsDirectory: entry.IsDirectory,
|
|
||||||
Size: entry.Attributes.FileSize,
|
|
||||||
Uid: entry.Attributes.Uid,
|
|
||||||
Gid: entry.Attributes.Gid,
|
|
||||||
UserName: entry.Attributes.UserName,
|
|
||||||
Collection: entry.Attributes.Collection,
|
|
||||||
Crtime: entry.Attributes.Crtime,
|
|
||||||
Mtime: entry.Attributes.Mtime,
|
|
||||||
Mime: entry.Attributes.Mime,
|
|
||||||
}
|
|
||||||
return esEntry, id
|
|
||||||
}
|
|
||||||
|
|
||||||
func sendToElasticSearchFunc(servers string, esIndex string) (func(resp *filer_pb.SubscribeMetadataResponse) error, error) {
|
|
||||||
options := []elastic.ClientOptionFunc{}
|
|
||||||
options = append(options, elastic.SetURL(strings.Split(servers, ",")...))
|
|
||||||
options = append(options, elastic.SetSniff(false))
|
|
||||||
options = append(options, elastic.SetHealthcheck(false))
|
|
||||||
client, err := elastic.NewClient(options...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return func(resp *filer_pb.SubscribeMetadataResponse) error {
|
|
||||||
event := resp.EventNotification
|
|
||||||
if event.OldEntry != nil &&
|
|
||||||
(event.NewEntry == nil || resp.Directory != event.NewParentPath || event.OldEntry.Name != event.NewEntry.Name) {
|
|
||||||
// delete or not update the same file
|
|
||||||
dir, name := resp.Directory, event.OldEntry.Name
|
|
||||||
id := util.Md5String([]byte(util.NewFullPath(dir, name)))
|
|
||||||
println("delete", id)
|
|
||||||
_, err := client.Delete().Index(esIndex).Id(id).Do(context.Background())
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if event.NewEntry != nil {
|
|
||||||
// add a new file or update the same file
|
|
||||||
esEntry, id := toEsEntry(event)
|
|
||||||
value, err := jsoniter.Marshal(esEntry)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
println(string(value))
|
|
||||||
_, err = client.Index().Index(esIndex).Id(id).BodyJson(string(value)).Do(context.Background())
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
//go:build elastic
|
||||||
|
// +build elastic
|
||||||
|
|
||||||
|
package command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/util"
|
||||||
|
jsoniter "github.com/json-iterator/go"
|
||||||
|
elastic "github.com/olivere/elastic/v7"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
type EsDocument struct {
|
||||||
|
Dir string `json:"dir,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
IsDirectory bool `json:"isDir,omitempty"`
|
||||||
|
Size uint64 `json:"size,omitempty"`
|
||||||
|
Uid uint32 `json:"uid,omitempty"`
|
||||||
|
Gid uint32 `json:"gid,omitempty"`
|
||||||
|
UserName string `json:"userName,omitempty"`
|
||||||
|
Crtime int64 `json:"crtime,omitempty"`
|
||||||
|
Mtime int64 `json:"mtime,omitempty"`
|
||||||
|
Mime string `json:"mime,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func toEsEntry(event *filer_pb.EventNotification) (*EsDocument, string) {
|
||||||
|
entry := event.NewEntry
|
||||||
|
dir, name := event.NewParentPath, entry.Name
|
||||||
|
id := util.Md5String([]byte(util.NewFullPath(dir, name)))
|
||||||
|
esEntry := &EsDocument{
|
||||||
|
Dir: dir,
|
||||||
|
Name: name,
|
||||||
|
IsDirectory: entry.IsDirectory,
|
||||||
|
Size: entry.Attributes.FileSize,
|
||||||
|
Uid: entry.Attributes.Uid,
|
||||||
|
Gid: entry.Attributes.Gid,
|
||||||
|
UserName: entry.Attributes.UserName,
|
||||||
|
Crtime: entry.Attributes.Crtime,
|
||||||
|
Mtime: entry.Attributes.Mtime,
|
||||||
|
Mime: entry.Attributes.Mime,
|
||||||
|
}
|
||||||
|
return esEntry, id
|
||||||
|
}
|
||||||
|
|
||||||
|
func sendToElasticSearchFunc(servers string, esIndex string) (func(resp *filer_pb.SubscribeMetadataResponse) error, error) {
|
||||||
|
options := []elastic.ClientOptionFunc{}
|
||||||
|
options = append(options, elastic.SetURL(strings.Split(servers, ",")...))
|
||||||
|
options = append(options, elastic.SetSniff(false))
|
||||||
|
options = append(options, elastic.SetHealthcheck(false))
|
||||||
|
client, err := elastic.NewClient(options...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return func(resp *filer_pb.SubscribeMetadataResponse) error {
|
||||||
|
event := resp.EventNotification
|
||||||
|
if event.OldEntry != nil &&
|
||||||
|
(event.NewEntry == nil || resp.Directory != event.NewParentPath || event.OldEntry.Name != event.NewEntry.Name) {
|
||||||
|
// delete or not update the same file
|
||||||
|
dir, name := resp.Directory, event.OldEntry.Name
|
||||||
|
id := util.Md5String([]byte(util.NewFullPath(dir, name)))
|
||||||
|
println("delete", id)
|
||||||
|
_, err := client.Delete().Index(esIndex).Id(id).Do(context.Background())
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if event.NewEntry != nil {
|
||||||
|
// add a new file or update the same file
|
||||||
|
esEntry, id := toEsEntry(event)
|
||||||
|
value, err := jsoniter.Marshal(esEntry)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
println(string(value))
|
||||||
|
_, err = client.Index().Index(esIndex).Id(id).BodyJson(string(value)).Do(context.Background())
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
//go:build !elastic
|
||||||
|
// +build !elastic
|
||||||
|
|
||||||
|
package command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
|
||||||
|
)
|
||||||
|
|
||||||
|
func sendToElasticSearchFunc(servers string, esIndex string) (func(resp *filer_pb.SubscribeMetadataResponse) error, error) {
|
||||||
|
return func(resp *filer_pb.SubscribeMetadataResponse) error {
|
||||||
|
return nil
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
@@ -9,6 +9,7 @@ import (
|
|||||||
"github.com/chrislusf/seaweedfs/weed/pb/remote_pb"
|
"github.com/chrislusf/seaweedfs/weed/pb/remote_pb"
|
||||||
"github.com/chrislusf/seaweedfs/weed/remote_storage"
|
"github.com/chrislusf/seaweedfs/weed/remote_storage"
|
||||||
"github.com/chrislusf/seaweedfs/weed/replication/source"
|
"github.com/chrislusf/seaweedfs/weed/replication/source"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/s3api/s3_constants"
|
||||||
"github.com/chrislusf/seaweedfs/weed/util"
|
"github.com/chrislusf/seaweedfs/weed/util"
|
||||||
"github.com/golang/protobuf/proto"
|
"github.com/golang/protobuf/proto"
|
||||||
"math"
|
"math"
|
||||||
@@ -39,7 +40,7 @@ func (option *RemoteGatewayOptions) followBucketUpdatesAndUploadToRemote(filerSo
|
|||||||
lastOffsetTs := collectLastSyncOffset(option, option.grpcDialOption, pb.ServerAddress(*option.filerAddress), option.bucketsDir, *option.timeAgo)
|
lastOffsetTs := collectLastSyncOffset(option, option.grpcDialOption, pb.ServerAddress(*option.filerAddress), option.bucketsDir, *option.timeAgo)
|
||||||
|
|
||||||
return pb.FollowMetadata(pb.ServerAddress(*option.filerAddress), option.grpcDialOption, "filer.remote.sync", option.clientId,
|
return pb.FollowMetadata(pb.ServerAddress(*option.filerAddress), option.grpcDialOption, "filer.remote.sync", option.clientId,
|
||||||
option.bucketsDir, []string{filer.DirectoryEtcRemote}, lastOffsetTs.UnixNano(), 0, processEventFnWithOffset, false)
|
option.bucketsDir, []string{filer.DirectoryEtcRemote}, lastOffsetTs.UnixNano(), 0, 0, processEventFnWithOffset, pb.TrivialOnError)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (option *RemoteGatewayOptions) makeBucketedEventProcessor(filerSource *source.FilerSource) (pb.ProcessMetadataFunc, error) {
|
func (option *RemoteGatewayOptions) makeBucketedEventProcessor(filerSource *source.FilerSource) (pb.ProcessMetadataFunc, error) {
|
||||||
@@ -181,7 +182,7 @@ func (option *RemoteGatewayOptions) makeBucketedEventProcessor(filerSource *sour
|
|||||||
if message.NewParentPath == option.bucketsDir {
|
if message.NewParentPath == option.bucketsDir {
|
||||||
return handleCreateBucket(message.NewEntry)
|
return handleCreateBucket(message.NewEntry)
|
||||||
}
|
}
|
||||||
if strings.HasPrefix(message.NewParentPath, option.bucketsDir) && strings.Contains(message.NewParentPath, "/.uploads/") {
|
if strings.HasPrefix(message.NewParentPath, option.bucketsDir) && strings.Contains(message.NewParentPath, "/"+s3_constants.MultipartUploadsFolder+"/") {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if !filer.HasData(message.NewEntry) {
|
if !filer.HasData(message.NewEntry) {
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ func followUpdatesAndUploadToRemote(option *RemoteSyncOptions, filerSource *sour
|
|||||||
lastOffsetTs := collectLastSyncOffset(option, option.grpcDialOption, pb.ServerAddress(*option.filerAddress), mountedDir, *option.timeAgo)
|
lastOffsetTs := collectLastSyncOffset(option, option.grpcDialOption, pb.ServerAddress(*option.filerAddress), mountedDir, *option.timeAgo)
|
||||||
|
|
||||||
return pb.FollowMetadata(pb.ServerAddress(*option.filerAddress), option.grpcDialOption, "filer.remote.sync", option.clientId,
|
return pb.FollowMetadata(pb.ServerAddress(*option.filerAddress), option.grpcDialOption, "filer.remote.sync", option.clientId,
|
||||||
mountedDir, []string{filer.DirectoryEtcRemote}, lastOffsetTs.UnixNano(), 0, processEventFnWithOffset, false)
|
mountedDir, []string{filer.DirectoryEtcRemote}, lastOffsetTs.UnixNano(), 0, 0, processEventFnWithOffset, pb.TrivialOnError)
|
||||||
}
|
}
|
||||||
|
|
||||||
func makeEventProcessor(remoteStorage *remote_pb.RemoteConf, mountedDir string, remoteStorageMountLocation *remote_pb.RemoteStorageLocation, filerSource *source.FilerSource) (pb.ProcessMetadataFunc, error) {
|
func makeEventProcessor(remoteStorage *remote_pb.RemoteConf, mountedDir string, remoteStorageMountLocation *remote_pb.RemoteStorageLocation, filerSource *source.FilerSource) (pb.ProcessMetadataFunc, error) {
|
||||||
|
|||||||
+83
-21
@@ -12,9 +12,11 @@ import (
|
|||||||
"github.com/chrislusf/seaweedfs/weed/replication/sink/filersink"
|
"github.com/chrislusf/seaweedfs/weed/replication/sink/filersink"
|
||||||
"github.com/chrislusf/seaweedfs/weed/replication/source"
|
"github.com/chrislusf/seaweedfs/weed/replication/source"
|
||||||
"github.com/chrislusf/seaweedfs/weed/security"
|
"github.com/chrislusf/seaweedfs/weed/security"
|
||||||
|
statsCollect "github.com/chrislusf/seaweedfs/weed/stats"
|
||||||
"github.com/chrislusf/seaweedfs/weed/util"
|
"github.com/chrislusf/seaweedfs/weed/util"
|
||||||
"github.com/chrislusf/seaweedfs/weed/util/grace"
|
"github.com/chrislusf/seaweedfs/weed/util/grace"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@@ -35,8 +37,11 @@ type SyncOptions struct {
|
|||||||
bDiskType *string
|
bDiskType *string
|
||||||
aDebug *bool
|
aDebug *bool
|
||||||
bDebug *bool
|
bDebug *bool
|
||||||
|
aFromTsMs *int64
|
||||||
|
bFromTsMs *int64
|
||||||
aProxyByFiler *bool
|
aProxyByFiler *bool
|
||||||
bProxyByFiler *bool
|
bProxyByFiler *bool
|
||||||
|
metricsHttpPort *int
|
||||||
clientId int32
|
clientId int32
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,8 +70,11 @@ func init() {
|
|||||||
syncOptions.bProxyByFiler = cmdFilerSynchronize.Flag.Bool("b.filerProxy", false, "read and write file chunks by filer B instead of volume servers")
|
syncOptions.bProxyByFiler = cmdFilerSynchronize.Flag.Bool("b.filerProxy", false, "read and write file chunks by filer B instead of volume servers")
|
||||||
syncOptions.aDebug = cmdFilerSynchronize.Flag.Bool("a.debug", false, "debug mode to print out filer A received files")
|
syncOptions.aDebug = cmdFilerSynchronize.Flag.Bool("a.debug", false, "debug mode to print out filer A received files")
|
||||||
syncOptions.bDebug = cmdFilerSynchronize.Flag.Bool("b.debug", false, "debug mode to print out filer B received files")
|
syncOptions.bDebug = cmdFilerSynchronize.Flag.Bool("b.debug", false, "debug mode to print out filer B received files")
|
||||||
|
syncOptions.aFromTsMs = cmdFilerSynchronize.Flag.Int64("a.fromTsMs", 0, "synchronization from timestamp on filer A. The unit is millisecond")
|
||||||
|
syncOptions.bFromTsMs = cmdFilerSynchronize.Flag.Int64("b.fromTsMs", 0, "synchronization from timestamp on filer B. The unit is millisecond")
|
||||||
syncCpuProfile = cmdFilerSynchronize.Flag.String("cpuprofile", "", "cpu profile output file")
|
syncCpuProfile = cmdFilerSynchronize.Flag.String("cpuprofile", "", "cpu profile output file")
|
||||||
syncMemProfile = cmdFilerSynchronize.Flag.String("memprofile", "", "memory profile output file")
|
syncMemProfile = cmdFilerSynchronize.Flag.String("memprofile", "", "memory profile output file")
|
||||||
|
syncOptions.metricsHttpPort = cmdFilerSynchronize.Flag.Int("metricsPort", 0, "metrics listen port")
|
||||||
syncOptions.clientId = util.RandomInt32()
|
syncOptions.clientId = util.RandomInt32()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,10 +105,35 @@ func runFilerSynchronize(cmd *Command, args []string) bool {
|
|||||||
|
|
||||||
filerA := pb.ServerAddress(*syncOptions.filerA)
|
filerA := pb.ServerAddress(*syncOptions.filerA)
|
||||||
filerB := pb.ServerAddress(*syncOptions.filerB)
|
filerB := pb.ServerAddress(*syncOptions.filerB)
|
||||||
|
|
||||||
|
// start filer.sync metrics server
|
||||||
|
go statsCollect.StartMetricsServer(*syncOptions.metricsHttpPort)
|
||||||
|
|
||||||
|
// read a filer signature
|
||||||
|
aFilerSignature, aFilerErr := replication.ReadFilerSignature(grpcDialOption, filerA)
|
||||||
|
if aFilerErr != nil {
|
||||||
|
glog.Errorf("get filer 'a' signature %d error from %s to %s: %v", aFilerSignature, *syncOptions.filerA, *syncOptions.filerB, aFilerErr)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// read b filer signature
|
||||||
|
bFilerSignature, bFilerErr := replication.ReadFilerSignature(grpcDialOption, filerB)
|
||||||
|
if bFilerErr != nil {
|
||||||
|
glog.Errorf("get filer 'b' signature %d error from %s to %s: %v", bFilerSignature, *syncOptions.filerA, *syncOptions.filerB, bFilerErr)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
|
// a->b
|
||||||
|
// set synchronization start timestamp to offset
|
||||||
|
initOffsetError := initOffsetFromTsMs(grpcDialOption, filerB, aFilerSignature, *syncOptions.bFromTsMs)
|
||||||
|
if initOffsetError != nil {
|
||||||
|
glog.Errorf("init offset from timestamp %d error from %s to %s: %v", *syncOptions.bFromTsMs, *syncOptions.filerA, *syncOptions.filerB, initOffsetError)
|
||||||
|
os.Exit(2)
|
||||||
|
}
|
||||||
for {
|
for {
|
||||||
err := doSubscribeFilerMetaChanges(syncOptions.clientId, grpcDialOption, filerA, *syncOptions.aPath, *syncOptions.aProxyByFiler, filerB,
|
err := doSubscribeFilerMetaChanges(syncOptions.clientId, grpcDialOption, filerA, *syncOptions.aPath, *syncOptions.aProxyByFiler, filerB,
|
||||||
*syncOptions.bPath, *syncOptions.bReplication, *syncOptions.bCollection, *syncOptions.bTtlSec, *syncOptions.bProxyByFiler, *syncOptions.bDiskType, *syncOptions.bDebug)
|
*syncOptions.bPath, *syncOptions.bReplication, *syncOptions.bCollection, *syncOptions.bTtlSec, *syncOptions.bProxyByFiler, *syncOptions.bDiskType,
|
||||||
|
*syncOptions.bDebug, aFilerSignature, bFilerSignature)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Errorf("sync from %s to %s: %v", *syncOptions.filerA, *syncOptions.filerB, err)
|
glog.Errorf("sync from %s to %s: %v", *syncOptions.filerA, *syncOptions.filerB, err)
|
||||||
time.Sleep(1747 * time.Millisecond)
|
time.Sleep(1747 * time.Millisecond)
|
||||||
@@ -109,10 +142,18 @@ func runFilerSynchronize(cmd *Command, args []string) bool {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
if !*syncOptions.isActivePassive {
|
if !*syncOptions.isActivePassive {
|
||||||
|
// b->a
|
||||||
|
// set synchronization start timestamp to offset
|
||||||
|
initOffsetError := initOffsetFromTsMs(grpcDialOption, filerA, bFilerSignature, *syncOptions.aFromTsMs)
|
||||||
|
if initOffsetError != nil {
|
||||||
|
glog.Errorf("init offset from timestamp %d error from %s to %s: %v", *syncOptions.aFromTsMs, *syncOptions.filerB, *syncOptions.filerA, initOffsetError)
|
||||||
|
os.Exit(2)
|
||||||
|
}
|
||||||
go func() {
|
go func() {
|
||||||
for {
|
for {
|
||||||
err := doSubscribeFilerMetaChanges(syncOptions.clientId, grpcDialOption, filerB, *syncOptions.bPath, *syncOptions.bProxyByFiler, filerA,
|
err := doSubscribeFilerMetaChanges(syncOptions.clientId, grpcDialOption, filerB, *syncOptions.bPath, *syncOptions.bProxyByFiler, filerA,
|
||||||
*syncOptions.aPath, *syncOptions.aReplication, *syncOptions.aCollection, *syncOptions.aTtlSec, *syncOptions.aProxyByFiler, *syncOptions.aDiskType, *syncOptions.aDebug)
|
*syncOptions.aPath, *syncOptions.aReplication, *syncOptions.aCollection, *syncOptions.aTtlSec, *syncOptions.aProxyByFiler, *syncOptions.aDiskType,
|
||||||
|
*syncOptions.aDebug, bFilerSignature, aFilerSignature)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Errorf("sync from %s to %s: %v", *syncOptions.filerB, *syncOptions.filerA, err)
|
glog.Errorf("sync from %s to %s: %v", *syncOptions.filerB, *syncOptions.filerA, err)
|
||||||
time.Sleep(2147 * time.Millisecond)
|
time.Sleep(2147 * time.Millisecond)
|
||||||
@@ -126,23 +167,28 @@ func runFilerSynchronize(cmd *Command, args []string) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func doSubscribeFilerMetaChanges(clientId int32, grpcDialOption grpc.DialOption, sourceFiler pb.ServerAddress, sourcePath string, sourceReadChunkFromFiler bool, targetFiler pb.ServerAddress, targetPath string,
|
// initOffsetFromTsMs Initialize offset
|
||||||
replicationStr, collection string, ttlSec int, sinkWriteChunkByFiler bool, diskType string, debug bool) error {
|
func initOffsetFromTsMs(grpcDialOption grpc.DialOption, targetFiler pb.ServerAddress, sourceFilerSignature int32, fromTsMs int64) error {
|
||||||
|
if fromTsMs <= 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
// convert to nanosecond
|
||||||
|
fromTsNs := fromTsMs * 1000_000
|
||||||
|
// If not successful, exit the program.
|
||||||
|
setOffsetErr := setOffset(grpcDialOption, targetFiler, SyncKeyPrefix, sourceFilerSignature, fromTsNs)
|
||||||
|
if setOffsetErr != nil {
|
||||||
|
return setOffsetErr
|
||||||
|
}
|
||||||
|
glog.Infof("setOffset from timestamp ms success! start offset: %d from %s to %s", fromTsNs, *syncOptions.filerA, *syncOptions.filerB)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// read source filer signature
|
func doSubscribeFilerMetaChanges(clientId int32, grpcDialOption grpc.DialOption, sourceFiler pb.ServerAddress, sourcePath string, sourceReadChunkFromFiler bool, targetFiler pb.ServerAddress, targetPath string,
|
||||||
sourceFilerSignature, sourceErr := replication.ReadFilerSignature(grpcDialOption, sourceFiler)
|
replicationStr, collection string, ttlSec int, sinkWriteChunkByFiler bool, diskType string, debug bool, sourceFilerSignature int32, targetFilerSignature int32) error {
|
||||||
if sourceErr != nil {
|
|
||||||
return sourceErr
|
|
||||||
}
|
|
||||||
// read target filer signature
|
|
||||||
targetFilerSignature, targetErr := replication.ReadFilerSignature(grpcDialOption, targetFiler)
|
|
||||||
if targetErr != nil {
|
|
||||||
return targetErr
|
|
||||||
}
|
|
||||||
|
|
||||||
// if first time, start from now
|
// if first time, start from now
|
||||||
// if has previously synced, resume from that point of time
|
// if has previously synced, resume from that point of time
|
||||||
sourceFilerOffsetTsNs, err := getOffset(grpcDialOption, targetFiler, SyncKeyPrefix, sourceFilerSignature)
|
sourceFilerOffsetTsNs, err := getOffset(grpcDialOption, targetFiler, getSignaturePrefixByPath(sourcePath), sourceFilerSignature)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -169,16 +215,19 @@ func doSubscribeFilerMetaChanges(clientId int32, grpcDialOption grpc.DialOption,
|
|||||||
return persistEventFn(resp)
|
return persistEventFn(resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
var lastLogTsNs = time.Now().Nanosecond()
|
var lastLogTsNs = time.Now().UnixNano()
|
||||||
|
var clientName = fmt.Sprintf("syncFrom_%s_To_%s", string(sourceFiler), string(targetFiler))
|
||||||
processEventFnWithOffset := pb.AddOffsetFunc(processEventFn, 3*time.Second, func(counter int64, lastTsNs int64) error {
|
processEventFnWithOffset := pb.AddOffsetFunc(processEventFn, 3*time.Second, func(counter int64, lastTsNs int64) error {
|
||||||
now := time.Now().Nanosecond()
|
now := time.Now().UnixNano()
|
||||||
glog.V(0).Infof("sync %s to %s progressed to %v %0.2f/sec", sourceFiler, targetFiler, time.Unix(0, lastTsNs), float64(counter)/(float64(now-lastLogTsNs)/1e9))
|
glog.V(0).Infof("sync %s to %s progressed to %v %0.2f/sec", sourceFiler, targetFiler, time.Unix(0, lastTsNs), float64(counter)/(float64(now-lastLogTsNs)/1e9))
|
||||||
lastLogTsNs = now
|
lastLogTsNs = now
|
||||||
return setOffset(grpcDialOption, targetFiler, SyncKeyPrefix, sourceFilerSignature, lastTsNs)
|
// collect synchronous offset
|
||||||
|
statsCollect.FilerSyncOffsetGauge.WithLabelValues(sourceFiler.String(), targetFiler.String(), clientName, sourcePath).Set(float64(lastTsNs))
|
||||||
|
return setOffset(grpcDialOption, targetFiler, getSignaturePrefixByPath(sourcePath), sourceFilerSignature, lastTsNs)
|
||||||
})
|
})
|
||||||
|
|
||||||
return pb.FollowMetadata(sourceFiler, grpcDialOption, "syncTo_"+string(targetFiler), clientId,
|
return pb.FollowMetadata(sourceFiler, grpcDialOption, clientName, clientId,
|
||||||
sourcePath, nil, sourceFilerOffsetTsNs, targetFilerSignature, processEventFnWithOffset, false)
|
sourcePath, nil, sourceFilerOffsetTsNs, 0, targetFilerSignature, processEventFnWithOffset, pb.RetryForeverOnError)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,6 +235,16 @@ const (
|
|||||||
SyncKeyPrefix = "sync."
|
SyncKeyPrefix = "sync."
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// When each business is distinguished according to path, and offsets need to be maintained separately.
|
||||||
|
func getSignaturePrefixByPath(path string) string {
|
||||||
|
// compatible historical version
|
||||||
|
if path == "/" {
|
||||||
|
return SyncKeyPrefix
|
||||||
|
} else {
|
||||||
|
return SyncKeyPrefix + path
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func getOffset(grpcDialOption grpc.DialOption, filer pb.ServerAddress, signaturePrefix string, signature int32) (lastOffsetTsNs int64, readErr error) {
|
func getOffset(grpcDialOption grpc.DialOption, filer pb.ServerAddress, signaturePrefix string, signature int32) (lastOffsetTsNs int64, readErr error) {
|
||||||
|
|
||||||
readErr = pb.WithFilerClient(false, filer, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
readErr = pb.WithFilerClient(false, filer, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||||
@@ -267,7 +326,10 @@ func genProcessFunction(sourcePath string, targetPath string, dataSink sink.Repl
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
key := buildKey(dataSink, message, targetPath, sourceOldKey, sourcePath)
|
key := buildKey(dataSink, message, targetPath, sourceOldKey, sourcePath)
|
||||||
return dataSink.DeleteEntry(key, message.OldEntry.IsDirectory, message.DeleteChunks, message.Signatures)
|
if !dataSink.IsIncremental() {
|
||||||
|
return dataSink.DeleteEntry(key, message.OldEntry.IsDirectory, message.DeleteChunks, message.Signatures)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle new entries
|
// handle new entries
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import (
|
|||||||
|
|
||||||
_ "github.com/chrislusf/seaweedfs/weed/remote_storage/azure"
|
_ "github.com/chrislusf/seaweedfs/weed/remote_storage/azure"
|
||||||
_ "github.com/chrislusf/seaweedfs/weed/remote_storage/gcs"
|
_ "github.com/chrislusf/seaweedfs/weed/remote_storage/gcs"
|
||||||
_ "github.com/chrislusf/seaweedfs/weed/remote_storage/hdfs"
|
|
||||||
_ "github.com/chrislusf/seaweedfs/weed/remote_storage/s3"
|
_ "github.com/chrislusf/seaweedfs/weed/remote_storage/s3"
|
||||||
|
|
||||||
_ "github.com/chrislusf/seaweedfs/weed/replication/sink/azuresink"
|
_ "github.com/chrislusf/seaweedfs/weed/replication/sink/azuresink"
|
||||||
@@ -15,6 +14,7 @@ import (
|
|||||||
_ "github.com/chrislusf/seaweedfs/weed/replication/sink/localsink"
|
_ "github.com/chrislusf/seaweedfs/weed/replication/sink/localsink"
|
||||||
_ "github.com/chrislusf/seaweedfs/weed/replication/sink/s3sink"
|
_ "github.com/chrislusf/seaweedfs/weed/replication/sink/s3sink"
|
||||||
|
|
||||||
|
_ "github.com/chrislusf/seaweedfs/weed/filer/arangodb"
|
||||||
_ "github.com/chrislusf/seaweedfs/weed/filer/cassandra"
|
_ "github.com/chrislusf/seaweedfs/weed/filer/cassandra"
|
||||||
_ "github.com/chrislusf/seaweedfs/weed/filer/elastic/v7"
|
_ "github.com/chrislusf/seaweedfs/weed/filer/elastic/v7"
|
||||||
_ "github.com/chrislusf/seaweedfs/weed/filer/etcd"
|
_ "github.com/chrislusf/seaweedfs/weed/filer/etcd"
|
||||||
@@ -31,4 +31,6 @@ import (
|
|||||||
_ "github.com/chrislusf/seaweedfs/weed/filer/redis2"
|
_ "github.com/chrislusf/seaweedfs/weed/filer/redis2"
|
||||||
_ "github.com/chrislusf/seaweedfs/weed/filer/redis3"
|
_ "github.com/chrislusf/seaweedfs/weed/filer/redis3"
|
||||||
_ "github.com/chrislusf/seaweedfs/weed/filer/sqlite"
|
_ "github.com/chrislusf/seaweedfs/weed/filer/sqlite"
|
||||||
|
_ "github.com/chrislusf/seaweedfs/weed/filer/tikv"
|
||||||
|
_ "github.com/chrislusf/seaweedfs/weed/filer/ydb"
|
||||||
)
|
)
|
||||||
+41
-15
@@ -1,9 +1,11 @@
|
|||||||
package command
|
package command
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
"golang.org/x/exp/slices"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"sort"
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -48,6 +50,8 @@ type MasterOptions struct {
|
|||||||
metricsHttpPort *int
|
metricsHttpPort *int
|
||||||
heartbeatInterval *time.Duration
|
heartbeatInterval *time.Duration
|
||||||
electionTimeout *time.Duration
|
electionTimeout *time.Duration
|
||||||
|
raftHashicorp *bool
|
||||||
|
raftBootstrap *bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -71,6 +75,8 @@ func init() {
|
|||||||
m.raftResumeState = cmdMaster.Flag.Bool("resumeState", false, "resume previous state on start master server")
|
m.raftResumeState = cmdMaster.Flag.Bool("resumeState", false, "resume previous state on start master server")
|
||||||
m.heartbeatInterval = cmdMaster.Flag.Duration("heartbeatInterval", 300*time.Millisecond, "heartbeat interval of master servers, and will be randomly multiplied by [1, 1.25)")
|
m.heartbeatInterval = cmdMaster.Flag.Duration("heartbeatInterval", 300*time.Millisecond, "heartbeat interval of master servers, and will be randomly multiplied by [1, 1.25)")
|
||||||
m.electionTimeout = cmdMaster.Flag.Duration("electionTimeout", 10*time.Second, "election timeout of master servers")
|
m.electionTimeout = cmdMaster.Flag.Duration("electionTimeout", 10*time.Second, "election timeout of master servers")
|
||||||
|
m.raftHashicorp = cmdMaster.Flag.Bool("raftHashicorp", false, "use hashicorp raft")
|
||||||
|
m.raftBootstrap = cmdMaster.Flag.Bool("raftBootstrap", false, "Whether to bootstrap the Raft cluster")
|
||||||
}
|
}
|
||||||
|
|
||||||
var cmdMaster = &Command{
|
var cmdMaster = &Command{
|
||||||
@@ -147,22 +153,35 @@ func startMaster(masterOption MasterOptions, masterWhiteList []string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// start raftServer
|
// start raftServer
|
||||||
|
metaDir := path.Join(*masterOption.metaFolder, fmt.Sprintf("m%d", *masterOption.port))
|
||||||
raftServerOption := &weed_server.RaftServerOption{
|
raftServerOption := &weed_server.RaftServerOption{
|
||||||
GrpcDialOption: security.LoadClientTLS(util.GetViper(), "grpc.master"),
|
GrpcDialOption: security.LoadClientTLS(util.GetViper(), "grpc.master"),
|
||||||
Peers: masterPeers,
|
Peers: masterPeers,
|
||||||
ServerAddr: myMasterAddress,
|
ServerAddr: myMasterAddress,
|
||||||
DataDir: util.ResolvePath(*masterOption.metaFolder),
|
DataDir: util.ResolvePath(metaDir),
|
||||||
Topo: ms.Topo,
|
Topo: ms.Topo,
|
||||||
RaftResumeState: *masterOption.raftResumeState,
|
RaftResumeState: *masterOption.raftResumeState,
|
||||||
HeartbeatInterval: *masterOption.heartbeatInterval,
|
HeartbeatInterval: *masterOption.heartbeatInterval,
|
||||||
ElectionTimeout: *masterOption.electionTimeout,
|
ElectionTimeout: *masterOption.electionTimeout,
|
||||||
|
RaftBootstrap: *m.raftBootstrap,
|
||||||
}
|
}
|
||||||
raftServer, err := weed_server.NewRaftServer(raftServerOption)
|
var raftServer *weed_server.RaftServer
|
||||||
if raftServer == nil {
|
var err error
|
||||||
glog.Fatalf("please verify %s is writable, see https://github.com/chrislusf/seaweedfs/issues/717: %s", *masterOption.metaFolder, err)
|
if *m.raftHashicorp {
|
||||||
|
if raftServer, err = weed_server.NewHashicorpRaftServer(raftServerOption); err != nil {
|
||||||
|
glog.Fatalf("NewHashicorpRaftServer: %s", err)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
raftServer, err = weed_server.NewRaftServer(raftServerOption)
|
||||||
|
if raftServer == nil {
|
||||||
|
glog.Fatalf("please verify %s is writable, see https://github.com/chrislusf/seaweedfs/issues/717: %s", *masterOption.metaFolder, err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ms.SetRaftServer(raftServer)
|
ms.SetRaftServer(raftServer)
|
||||||
r.HandleFunc("/cluster/status", raftServer.StatusHandler).Methods("GET")
|
r.HandleFunc("/cluster/status", raftServer.StatusHandler).Methods("GET")
|
||||||
|
if *m.raftHashicorp {
|
||||||
|
r.HandleFunc("/raft/stats", raftServer.StatsRaftHandler).Methods("GET")
|
||||||
|
}
|
||||||
// starting grpc server
|
// starting grpc server
|
||||||
grpcPort := *masterOption.portGrpc
|
grpcPort := *masterOption.portGrpc
|
||||||
grpcL, grpcLocalL, err := util.NewIpAndLocalListeners(*masterOption.ipBind, grpcPort, 0)
|
grpcL, grpcLocalL, err := util.NewIpAndLocalListeners(*masterOption.ipBind, grpcPort, 0)
|
||||||
@@ -171,7 +190,11 @@ func startMaster(masterOption MasterOptions, masterWhiteList []string) {
|
|||||||
}
|
}
|
||||||
grpcS := pb.NewGrpcServer(security.LoadServerTLS(util.GetViper(), "grpc.master"))
|
grpcS := pb.NewGrpcServer(security.LoadServerTLS(util.GetViper(), "grpc.master"))
|
||||||
master_pb.RegisterSeaweedServer(grpcS, ms)
|
master_pb.RegisterSeaweedServer(grpcS, ms)
|
||||||
protobuf.RegisterRaftServer(grpcS, raftServer)
|
if *m.raftHashicorp {
|
||||||
|
raftServer.TransportManager.Register(grpcS)
|
||||||
|
} else {
|
||||||
|
protobuf.RegisterRaftServer(grpcS, raftServer)
|
||||||
|
}
|
||||||
reflection.Register(grpcS)
|
reflection.Register(grpcS)
|
||||||
glog.V(0).Infof("Start Seaweed Master %s grpc server at %s:%d", util.Version(), *masterOption.ipBind, grpcPort)
|
glog.V(0).Infof("Start Seaweed Master %s grpc server at %s:%d", util.Version(), *masterOption.ipBind, grpcPort)
|
||||||
if grpcLocalL != nil {
|
if grpcLocalL != nil {
|
||||||
@@ -179,14 +202,17 @@ func startMaster(masterOption MasterOptions, masterWhiteList []string) {
|
|||||||
}
|
}
|
||||||
go grpcS.Serve(grpcL)
|
go grpcS.Serve(grpcL)
|
||||||
|
|
||||||
go func() {
|
timeSleep := 1500 * time.Millisecond
|
||||||
time.Sleep(1500 * time.Millisecond)
|
if !*m.raftHashicorp {
|
||||||
if ms.Topo.RaftServer.Leader() == "" && ms.Topo.RaftServer.IsLogEmpty() && isTheFirstOne(myMasterAddress, peers) {
|
go func() {
|
||||||
if ms.MasterClient.FindLeaderFromOtherPeers(myMasterAddress) == "" {
|
time.Sleep(timeSleep)
|
||||||
raftServer.DoJoinCommand()
|
if ms.Topo.RaftServer.Leader() == "" && ms.Topo.RaftServer.IsLogEmpty() && isTheFirstOne(myMasterAddress, peers) {
|
||||||
|
if ms.MasterClient.FindLeaderFromOtherPeers(myMasterAddress) == "" {
|
||||||
|
raftServer.DoJoinCommand()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}()
|
||||||
}()
|
}
|
||||||
|
|
||||||
go ms.MasterClient.KeepConnectedToMaster()
|
go ms.MasterClient.KeepConnectedToMaster()
|
||||||
|
|
||||||
@@ -251,8 +277,8 @@ func checkPeers(masterIp string, masterPort int, masterGrpcPort int, peers strin
|
|||||||
}
|
}
|
||||||
|
|
||||||
func isTheFirstOne(self pb.ServerAddress, peers []pb.ServerAddress) bool {
|
func isTheFirstOne(self pb.ServerAddress, peers []pb.ServerAddress) bool {
|
||||||
sort.Slice(peers, func(i, j int) bool {
|
slices.SortFunc(peers, func(a, b pb.ServerAddress) bool {
|
||||||
return strings.Compare(string(peers[i]), string(peers[j])) < 0
|
return strings.Compare(string(a), string(b)) < 0
|
||||||
})
|
})
|
||||||
if len(peers) <= 0 {
|
if len(peers) <= 0 {
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ type MountOptions struct {
|
|||||||
debug *bool
|
debug *bool
|
||||||
debugPort *int
|
debugPort *int
|
||||||
localSocket *string
|
localSocket *string
|
||||||
|
disableXAttr *bool
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -65,6 +66,7 @@ func init() {
|
|||||||
mountOptions.debug = cmdMount.Flag.Bool("debug", false, "serves runtime profiling data, e.g., http://localhost:<debug.port>/debug/pprof/goroutine?debug=2")
|
mountOptions.debug = cmdMount.Flag.Bool("debug", false, "serves runtime profiling data, e.g., http://localhost:<debug.port>/debug/pprof/goroutine?debug=2")
|
||||||
mountOptions.debugPort = cmdMount.Flag.Int("debug.port", 6061, "http port for debugging")
|
mountOptions.debugPort = cmdMount.Flag.Int("debug.port", 6061, "http port for debugging")
|
||||||
mountOptions.localSocket = cmdMount.Flag.String("localSocket", "", "default to /tmp/seaweedfs-mount-<mount_dir_hash>.sock")
|
mountOptions.localSocket = cmdMount.Flag.String("localSocket", "", "default to /tmp/seaweedfs-mount-<mount_dir_hash>.sock")
|
||||||
|
mountOptions.disableXAttr = cmdMount.Flag.Bool("disableXAttr", false, "disable xattr")
|
||||||
|
|
||||||
mountCpuProfile = cmdMount.Flag.String("cpuprofile", "", "cpu profile output file")
|
mountCpuProfile = cmdMount.Flag.String("cpuprofile", "", "cpu profile output file")
|
||||||
mountMemProfile = cmdMount.Flag.String("memprofile", "", "memory profile output file")
|
mountMemProfile = cmdMount.Flag.String("memprofile", "", "memory profile output file")
|
||||||
@@ -84,7 +86,7 @@ var cmdMount = &Command{
|
|||||||
This uses github.com/seaweedfs/fuse, which enables writing FUSE file systems on
|
This uses github.com/seaweedfs/fuse, which enables writing FUSE file systems on
|
||||||
Linux, and OS X.
|
Linux, and OS X.
|
||||||
|
|
||||||
On OS X, it requires OSXFUSE (http://osxfuse.github.com/).
|
On OS X, it requires OSXFUSE (https://osxfuse.github.io/).
|
||||||
|
|
||||||
`,
|
`,
|
||||||
}
|
}
|
||||||
@@ -175,7 +175,7 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
|
|||||||
FsName: serverFriendlyName + ":" + filerMountRootPath,
|
FsName: serverFriendlyName + ":" + filerMountRootPath,
|
||||||
Name: "seaweedfs",
|
Name: "seaweedfs",
|
||||||
SingleThreaded: false,
|
SingleThreaded: false,
|
||||||
DisableXAttrs: false,
|
DisableXAttrs: *option.disableXAttr,
|
||||||
Debug: *option.debug,
|
Debug: *option.debug,
|
||||||
EnableLocks: false,
|
EnableLocks: false,
|
||||||
ExplicitDataCacheControl: false,
|
ExplicitDataCacheControl: false,
|
||||||
@@ -238,6 +238,7 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
|
|||||||
VolumeServerAccess: *mountOptions.volumeServerAccess,
|
VolumeServerAccess: *mountOptions.volumeServerAccess,
|
||||||
Cipher: cipher,
|
Cipher: cipher,
|
||||||
UidGidMapper: uidGidMapper,
|
UidGidMapper: uidGidMapper,
|
||||||
|
DisableXAttr: *option.disableXAttr,
|
||||||
})
|
})
|
||||||
|
|
||||||
server, err := fuse.NewServer(seaweedFileSystem, dir, fuseMountOptions)
|
server, err := fuse.NewServer(seaweedFileSystem, dir, fuseMountOptions)
|
||||||
|
|||||||
+22
-1
@@ -4,11 +4,13 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/chrislusf/seaweedfs/weed/s3api/s3err"
|
"github.com/chrislusf/seaweedfs/weed/s3api/s3err"
|
||||||
|
"google.golang.org/grpc/reflection"
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/chrislusf/seaweedfs/weed/pb"
|
"github.com/chrislusf/seaweedfs/weed/pb"
|
||||||
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
|
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/pb/s3_pb"
|
||||||
"github.com/chrislusf/seaweedfs/weed/security"
|
"github.com/chrislusf/seaweedfs/weed/security"
|
||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
@@ -27,6 +29,7 @@ type S3Options struct {
|
|||||||
filer *string
|
filer *string
|
||||||
bindIp *string
|
bindIp *string
|
||||||
port *int
|
port *int
|
||||||
|
portGrpc *int
|
||||||
config *string
|
config *string
|
||||||
domainName *string
|
domainName *string
|
||||||
tlsPrivateKey *string
|
tlsPrivateKey *string
|
||||||
@@ -43,6 +46,7 @@ func init() {
|
|||||||
s3StandaloneOptions.filer = cmdS3.Flag.String("filer", "localhost:8888", "filer server address")
|
s3StandaloneOptions.filer = cmdS3.Flag.String("filer", "localhost:8888", "filer server address")
|
||||||
s3StandaloneOptions.bindIp = cmdS3.Flag.String("ip.bind", "", "ip address to bind to. Default to localhost.")
|
s3StandaloneOptions.bindIp = cmdS3.Flag.String("ip.bind", "", "ip address to bind to. Default to localhost.")
|
||||||
s3StandaloneOptions.port = cmdS3.Flag.Int("port", 8333, "s3 server http listen port")
|
s3StandaloneOptions.port = cmdS3.Flag.Int("port", 8333, "s3 server http listen port")
|
||||||
|
s3StandaloneOptions.portGrpc = cmdS3.Flag.Int("port.grpc", 0, "s3 server grpc listen port")
|
||||||
s3StandaloneOptions.domainName = cmdS3.Flag.String("domainName", "", "suffix of the host name in comma separated list, {bucket}.{domainName}")
|
s3StandaloneOptions.domainName = cmdS3.Flag.String("domainName", "", "suffix of the host name in comma separated list, {bucket}.{domainName}")
|
||||||
s3StandaloneOptions.config = cmdS3.Flag.String("config", "", "path to the config file")
|
s3StandaloneOptions.config = cmdS3.Flag.String("config", "", "path to the config file")
|
||||||
s3StandaloneOptions.auditLogConfig = cmdS3.Flag.String("auditLogConfig", "", "path to the audit log config file")
|
s3StandaloneOptions.auditLogConfig = cmdS3.Flag.String("auditLogConfig", "", "path to the audit log config file")
|
||||||
@@ -179,7 +183,7 @@ func (s3opt *S3Options) startS3Server() bool {
|
|||||||
|
|
||||||
router := mux.NewRouter().SkipClean(true)
|
router := mux.NewRouter().SkipClean(true)
|
||||||
|
|
||||||
_, s3ApiServer_err := s3api.NewS3ApiServer(router, &s3api.S3ApiServerOption{
|
s3ApiServer, s3ApiServer_err := s3api.NewS3ApiServer(router, &s3api.S3ApiServerOption{
|
||||||
Filer: filerAddress,
|
Filer: filerAddress,
|
||||||
Port: *s3opt.port,
|
Port: *s3opt.port,
|
||||||
Config: *s3opt.config,
|
Config: *s3opt.config,
|
||||||
@@ -196,6 +200,9 @@ func (s3opt *S3Options) startS3Server() bool {
|
|||||||
|
|
||||||
httpS := &http.Server{Handler: router}
|
httpS := &http.Server{Handler: router}
|
||||||
|
|
||||||
|
if *s3opt.portGrpc == 0 {
|
||||||
|
*s3opt.portGrpc = 10000 + *s3opt.port
|
||||||
|
}
|
||||||
if *s3opt.bindIp == "" {
|
if *s3opt.bindIp == "" {
|
||||||
*s3opt.bindIp = "localhost"
|
*s3opt.bindIp = "localhost"
|
||||||
}
|
}
|
||||||
@@ -213,6 +220,20 @@ func (s3opt *S3Options) startS3Server() bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// starting grpc server
|
||||||
|
grpcPort := *s3opt.portGrpc
|
||||||
|
grpcL, grpcLocalL, err := util.NewIpAndLocalListeners(*s3opt.bindIp, grpcPort, 0)
|
||||||
|
if err != nil {
|
||||||
|
glog.Fatalf("s3 failed to listen on grpc port %d: %v", grpcPort, err)
|
||||||
|
}
|
||||||
|
grpcS := pb.NewGrpcServer(security.LoadServerTLS(util.GetViper(), "grpc.s3"))
|
||||||
|
s3_pb.RegisterSeaweedS3Server(grpcS, s3ApiServer)
|
||||||
|
reflection.Register(grpcS)
|
||||||
|
if grpcLocalL != nil {
|
||||||
|
go grpcS.Serve(grpcLocalL)
|
||||||
|
}
|
||||||
|
go grpcS.Serve(grpcL)
|
||||||
|
|
||||||
if *s3opt.tlsPrivateKey != "" {
|
if *s3opt.tlsPrivateKey != "" {
|
||||||
glog.V(0).Infof("Start Seaweed S3 API Server %s at https port %d", util.Version(), *s3opt.port)
|
glog.V(0).Infof("Start Seaweed S3 API Server %s at https port %d", util.Version(), *s3opt.port)
|
||||||
if s3ApiLocalListner != nil {
|
if s3ApiLocalListner != nil {
|
||||||
|
|||||||
@@ -285,6 +285,29 @@ healthcheck_enabled = false
|
|||||||
index.max_result_window = 10000
|
index.max_result_window = 10000
|
||||||
|
|
||||||
|
|
||||||
|
[arangodb] # in development dont use it
|
||||||
|
enabled = false
|
||||||
|
db_name = "seaweedfs"
|
||||||
|
servers=["http://localhost:8529"] # list of servers to connect to
|
||||||
|
# only basic auth supported for now
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
# skip tls cert validation
|
||||||
|
insecure_skip_verify = true
|
||||||
|
|
||||||
|
[ydb] # https://ydb.tech/
|
||||||
|
enabled = false
|
||||||
|
dsn = "grpc://localhost:2136?database=/local"
|
||||||
|
prefix = "seaweedfs"
|
||||||
|
useBucketPrefix = true # Fast Bucket Deletion
|
||||||
|
poolSizeLimit = 50
|
||||||
|
dialTimeOut = 10
|
||||||
|
|
||||||
|
# Authenticate produced with one of next environment variables:
|
||||||
|
# YDB_SERVICE_ACCOUNT_KEY_FILE_CREDENTIALS=<path/to/sa_key_file> — used service account key file by path
|
||||||
|
# YDB_ANONYMOUS_CREDENTIALS="1" — used for authenticate with anonymous access. Anonymous access needs for connect to testing YDB installation
|
||||||
|
# YDB_METADATA_CREDENTIALS="1" — used metadata service for authenticate to YDB from yandex cloud virtual machine or from yandex function
|
||||||
|
# YDB_ACCESS_TOKEN_CREDENTIALS=<access_token> — used for authenticate to YDB with short-life access token. For example, access token may be IAM token
|
||||||
|
|
||||||
##########################
|
##########################
|
||||||
##########################
|
##########################
|
||||||
@@ -304,3 +327,13 @@ location = "/tmp/"
|
|||||||
address = "localhost:6379"
|
address = "localhost:6379"
|
||||||
password = ""
|
password = ""
|
||||||
database = 1
|
database = 1
|
||||||
|
|
||||||
|
[tikv]
|
||||||
|
enabled = false
|
||||||
|
# If you have many pd address, use ',' split then:
|
||||||
|
# pdaddrs = "pdhost1:2379, pdhost2:2379, pdhost3:2379"
|
||||||
|
pdaddrs = "localhost:2379"
|
||||||
|
# Concurrency for TiKV delete range
|
||||||
|
deleterange_concurrency = 1
|
||||||
|
# Enable 1PC
|
||||||
|
enable_1pc = false
|
||||||
@@ -36,6 +36,7 @@ aws_secret_access_key = "" # if empty, loads from the shared credentials fil
|
|||||||
region = "us-east-2"
|
region = "us-east-2"
|
||||||
bucket = "your_bucket_name" # an existing bucket
|
bucket = "your_bucket_name" # an existing bucket
|
||||||
endpoint = ""
|
endpoint = ""
|
||||||
|
storage_class = "STANDARD_IA"
|
||||||
|
|
||||||
# create this number of logical volumes if no more writable volumes
|
# create this number of logical volumes if no more writable volumes
|
||||||
# count_x means how many copies of data.
|
# count_x means how many copies of data.
|
||||||
|
|||||||
@@ -67,6 +67,11 @@ cert = ""
|
|||||||
key = ""
|
key = ""
|
||||||
allowed_commonNames = "" # comma-separated SSL certificate common names
|
allowed_commonNames = "" # comma-separated SSL certificate common names
|
||||||
|
|
||||||
|
[grpc.s3]
|
||||||
|
cert = ""
|
||||||
|
key = ""
|
||||||
|
allowed_commonNames = "" # comma-separated SSL certificate common names
|
||||||
|
|
||||||
[grpc.msg_broker]
|
[grpc.msg_broker]
|
||||||
cert = ""
|
cert = ""
|
||||||
key = ""
|
key = ""
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ default = "c1"
|
|||||||
|
|
||||||
[cluster.c1]
|
[cluster.c1]
|
||||||
master = "localhost:9333" # comma-separated master servers
|
master = "localhost:9333" # comma-separated master servers
|
||||||
filer = "localhost:8888" # filer host and port
|
|
||||||
|
|
||||||
[cluster.c2]
|
[cluster.c2]
|
||||||
master = ""
|
master = ""
|
||||||
filer = ""
|
|
||||||
@@ -2,8 +2,6 @@ package command
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/chrislusf/seaweedfs/weed/pb"
|
|
||||||
"github.com/chrislusf/seaweedfs/weed/util/grace"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -12,7 +10,9 @@ import (
|
|||||||
stats_collect "github.com/chrislusf/seaweedfs/weed/stats"
|
stats_collect "github.com/chrislusf/seaweedfs/weed/stats"
|
||||||
|
|
||||||
"github.com/chrislusf/seaweedfs/weed/glog"
|
"github.com/chrislusf/seaweedfs/weed/glog"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/pb"
|
||||||
"github.com/chrislusf/seaweedfs/weed/util"
|
"github.com/chrislusf/seaweedfs/weed/util"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/util/grace"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ServerOptions struct {
|
type ServerOptions struct {
|
||||||
@@ -101,6 +101,7 @@ func init() {
|
|||||||
masterOptions.heartbeatInterval = cmdServer.Flag.Duration("master.heartbeatInterval", 300*time.Millisecond, "heartbeat interval of master servers, and will be randomly multiplied by [1, 1.25)")
|
masterOptions.heartbeatInterval = cmdServer.Flag.Duration("master.heartbeatInterval", 300*time.Millisecond, "heartbeat interval of master servers, and will be randomly multiplied by [1, 1.25)")
|
||||||
masterOptions.electionTimeout = cmdServer.Flag.Duration("master.electionTimeout", 10*time.Second, "election timeout of master servers")
|
masterOptions.electionTimeout = cmdServer.Flag.Duration("master.electionTimeout", 10*time.Second, "election timeout of master servers")
|
||||||
|
|
||||||
|
filerOptions.filerGroup = cmdServer.Flag.String("filer.filerGroup", "", "share metadata with other filers in the same filerGroup")
|
||||||
filerOptions.collection = cmdServer.Flag.String("filer.collection", "", "all data will be stored in this collection")
|
filerOptions.collection = cmdServer.Flag.String("filer.collection", "", "all data will be stored in this collection")
|
||||||
filerOptions.port = cmdServer.Flag.Int("filer.port", 8888, "filer server http listen port")
|
filerOptions.port = cmdServer.Flag.Int("filer.port", 8888, "filer server http listen port")
|
||||||
filerOptions.portGrpc = cmdServer.Flag.Int("filer.port.grpc", 0, "filer server grpc listen port")
|
filerOptions.portGrpc = cmdServer.Flag.Int("filer.port.grpc", 0, "filer server grpc listen port")
|
||||||
@@ -113,6 +114,7 @@ func init() {
|
|||||||
filerOptions.saveToFilerLimit = cmdServer.Flag.Int("filer.saveToFilerLimit", 0, "Small files smaller than this limit can be cached in filer store.")
|
filerOptions.saveToFilerLimit = cmdServer.Flag.Int("filer.saveToFilerLimit", 0, "Small files smaller than this limit can be cached in filer store.")
|
||||||
filerOptions.concurrentUploadLimitMB = cmdServer.Flag.Int("filer.concurrentUploadLimitMB", 64, "limit total concurrent upload size")
|
filerOptions.concurrentUploadLimitMB = cmdServer.Flag.Int("filer.concurrentUploadLimitMB", 64, "limit total concurrent upload size")
|
||||||
filerOptions.localSocket = cmdServer.Flag.String("filer.localSocket", "", "default to /tmp/seaweedfs-filer-<port>.sock")
|
filerOptions.localSocket = cmdServer.Flag.String("filer.localSocket", "", "default to /tmp/seaweedfs-filer-<port>.sock")
|
||||||
|
filerOptions.showUIDirectoryDelete = cmdServer.Flag.Bool("filer.ui.deleteDir", true, "enable filer UI show delete directory button")
|
||||||
|
|
||||||
serverOptions.v.port = cmdServer.Flag.Int("volume.port", 8080, "volume server http listen port")
|
serverOptions.v.port = cmdServer.Flag.Int("volume.port", 8080, "volume server http listen port")
|
||||||
serverOptions.v.portGrpc = cmdServer.Flag.Int("volume.port.grpc", 0, "volume server grpc listen port")
|
serverOptions.v.portGrpc = cmdServer.Flag.Int("volume.port.grpc", 0, "volume server grpc listen port")
|
||||||
@@ -130,8 +132,10 @@ func init() {
|
|||||||
serverOptions.v.pprof = cmdServer.Flag.Bool("volume.pprof", false, "enable pprof http handlers. precludes --memprofile and --cpuprofile")
|
serverOptions.v.pprof = cmdServer.Flag.Bool("volume.pprof", false, "enable pprof http handlers. precludes --memprofile and --cpuprofile")
|
||||||
serverOptions.v.idxFolder = cmdServer.Flag.String("volume.dir.idx", "", "directory to store .idx files")
|
serverOptions.v.idxFolder = cmdServer.Flag.String("volume.dir.idx", "", "directory to store .idx files")
|
||||||
serverOptions.v.enableTcp = cmdServer.Flag.Bool("volume.tcp", false, "<exprimental> enable tcp port")
|
serverOptions.v.enableTcp = cmdServer.Flag.Bool("volume.tcp", false, "<exprimental> enable tcp port")
|
||||||
|
serverOptions.v.inflightUploadDataTimeout = cmdServer.Flag.Duration("volume.inflightUploadDataTimeout", 60*time.Second, "inflight upload data wait timeout of volume servers")
|
||||||
|
|
||||||
s3Options.port = cmdServer.Flag.Int("s3.port", 8333, "s3 server http listen port")
|
s3Options.port = cmdServer.Flag.Int("s3.port", 8333, "s3 server http listen port")
|
||||||
|
s3Options.portGrpc = cmdServer.Flag.Int("s3.port.grpc", 0, "s3 server grpc listen port")
|
||||||
s3Options.domainName = cmdServer.Flag.String("s3.domainName", "", "suffix of the host name in comma separated list, {bucket}.{domainName}")
|
s3Options.domainName = cmdServer.Flag.String("s3.domainName", "", "suffix of the host name in comma separated list, {bucket}.{domainName}")
|
||||||
s3Options.tlsPrivateKey = cmdServer.Flag.String("s3.key.file", "", "path to the TLS private key file")
|
s3Options.tlsPrivateKey = cmdServer.Flag.String("s3.key.file", "", "path to the TLS private key file")
|
||||||
s3Options.tlsCertificate = cmdServer.Flag.String("s3.cert.file", "", "path to the TLS certificate file")
|
s3Options.tlsCertificate = cmdServer.Flag.String("s3.cert.file", "", "path to the TLS certificate file")
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ var (
|
|||||||
func init() {
|
func init() {
|
||||||
cmdShell.Run = runShell // break init cycle
|
cmdShell.Run = runShell // break init cycle
|
||||||
shellOptions.Masters = cmdShell.Flag.String("master", "", "comma-separated master servers, e.g. localhost:9333")
|
shellOptions.Masters = cmdShell.Flag.String("master", "", "comma-separated master servers, e.g. localhost:9333")
|
||||||
|
shellOptions.FilerGroup = cmdShell.Flag.String("filerGroup", "", "filerGroup for the filers")
|
||||||
shellInitialFiler = cmdShell.Flag.String("filer", "", "filer host and port, e.g. localhost:8888")
|
shellInitialFiler = cmdShell.Flag.String("filer", "", "filer host and port, e.g. localhost:8888")
|
||||||
shellCluster = cmdShell.Flag.String("cluster", "", "cluster defined in shell.toml")
|
shellCluster = cmdShell.Flag.String("cluster", "", "cluster defined in shell.toml")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,382 @@
|
|||||||
|
package command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"archive/tar"
|
||||||
|
"archive/zip"
|
||||||
|
"bytes"
|
||||||
|
"compress/gzip"
|
||||||
|
"context"
|
||||||
|
"crypto/md5"
|
||||||
|
"encoding/hex"
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
"io/ioutil"
|
||||||
|
"net/http"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/glog"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/util"
|
||||||
|
"golang.org/x/net/context/ctxhttp"
|
||||||
|
)
|
||||||
|
|
||||||
|
//copied from https://github.com/restic/restic/tree/master/internal/selfupdate
|
||||||
|
|
||||||
|
// Release collects data about a single release on GitHub.
|
||||||
|
type Release struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
TagName string `json:"tag_name"`
|
||||||
|
Draft bool `json:"draft"`
|
||||||
|
PreRelease bool `json:"prerelease"`
|
||||||
|
PublishedAt time.Time `json:"published_at"`
|
||||||
|
Assets []Asset `json:"assets"`
|
||||||
|
|
||||||
|
Version string `json:"-"` // set manually in the code
|
||||||
|
}
|
||||||
|
|
||||||
|
// Asset is a file uploaded and attached to a release.
|
||||||
|
type Asset struct {
|
||||||
|
ID int `json:"id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
URL string `json:"url"`
|
||||||
|
}
|
||||||
|
|
||||||
|
const githubAPITimeout = 30 * time.Second
|
||||||
|
|
||||||
|
// githubError is returned by the GitHub API, e.g. for rate-limiting.
|
||||||
|
type githubError struct {
|
||||||
|
Message string
|
||||||
|
}
|
||||||
|
|
||||||
|
//default version is not full version
|
||||||
|
var isFullVersion = false
|
||||||
|
|
||||||
|
var (
|
||||||
|
updateOpt UpdateOptions
|
||||||
|
)
|
||||||
|
|
||||||
|
type UpdateOptions struct {
|
||||||
|
dir *string
|
||||||
|
name *string
|
||||||
|
Version *string
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
path, _ := os.Executable()
|
||||||
|
_, name := filepath.Split(path)
|
||||||
|
updateOpt.dir = cmdUpdate.Flag.String("dir", filepath.Dir(path), "directory to save new weed.")
|
||||||
|
updateOpt.name = cmdUpdate.Flag.String("name", name, "name of new weed. On windows, name shouldn't be same to the orignial name.")
|
||||||
|
updateOpt.Version = cmdUpdate.Flag.String("version", "0", "specific version of weed you want to download. If not specified, get the latest version.")
|
||||||
|
cmdUpdate.Run = runUpdate
|
||||||
|
}
|
||||||
|
|
||||||
|
var cmdUpdate = &Command{
|
||||||
|
UsageLine: "update [-dir=/path/to/dir] [-name=name] [-version=x.xx]",
|
||||||
|
Short: "get latest or specific version from https://github.com/chrislusf/seaweedfs",
|
||||||
|
Long: `get latest or specific version from https://github.com/chrislusf/seaweedfs`,
|
||||||
|
}
|
||||||
|
|
||||||
|
func runUpdate(cmd *Command, args []string) bool {
|
||||||
|
path, _ := os.Executable()
|
||||||
|
_, name := filepath.Split(path)
|
||||||
|
|
||||||
|
if *updateOpt.dir != "" {
|
||||||
|
if err := util.TestFolderWritable(util.ResolvePath(*updateOpt.dir)); err != nil {
|
||||||
|
glog.Fatalf("Check Folder(-dir) Writable %s : %s", *updateOpt.dir, err)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
*updateOpt.dir = filepath.Dir(path)
|
||||||
|
}
|
||||||
|
|
||||||
|
if *updateOpt.name == "" {
|
||||||
|
*updateOpt.name = name
|
||||||
|
}
|
||||||
|
|
||||||
|
target := filepath.Join(*updateOpt.dir, *updateOpt.name)
|
||||||
|
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
if target == path {
|
||||||
|
glog.Fatalf("On windows, name of the new weed shouldn't be same to the orignial name.")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
glog.V(0).Infof("new weed will be saved to %s", target)
|
||||||
|
|
||||||
|
_, err := downloadRelease(context.Background(), target, *updateOpt.Version)
|
||||||
|
if err != nil {
|
||||||
|
glog.Errorf("unable to download weed: %v", err)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func downloadRelease(ctx context.Context, target string, ver string) (version string, err error) {
|
||||||
|
currentVersion := util.VERSION_NUMBER
|
||||||
|
rel, err := GitHubLatestRelease(ctx, ver, "chrislusf", "seaweedfs")
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
if rel.Version == currentVersion {
|
||||||
|
if ver == "0" {
|
||||||
|
glog.V(0).Infof("weed is up to date")
|
||||||
|
} else {
|
||||||
|
glog.V(0).Infof("no need to download the same version of weed ")
|
||||||
|
}
|
||||||
|
return currentVersion, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
glog.V(0).Infof("download version: %s", rel.Version)
|
||||||
|
|
||||||
|
largeDiskSuffix := ""
|
||||||
|
if util.VolumeSizeLimitGB == 8000 {
|
||||||
|
largeDiskSuffix = "_large_disk"
|
||||||
|
}
|
||||||
|
|
||||||
|
fullSuffix := ""
|
||||||
|
if isFullVersion {
|
||||||
|
fullSuffix = "_full"
|
||||||
|
}
|
||||||
|
|
||||||
|
ext := "tar.gz"
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
ext = "zip"
|
||||||
|
}
|
||||||
|
|
||||||
|
suffix := fmt.Sprintf("%s_%s%s%s.%s", runtime.GOOS, runtime.GOARCH, fullSuffix, largeDiskSuffix, ext)
|
||||||
|
md5Filename := fmt.Sprintf("%s.md5", suffix)
|
||||||
|
_, md5Val, err := getGithubDataFile(ctx, rel.Assets, md5Filename)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
downloadFilename, buf, err := getGithubDataFile(ctx, rel.Assets, suffix)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
md5Ctx := md5.New()
|
||||||
|
md5Ctx.Write(buf)
|
||||||
|
binaryMd5 := md5Ctx.Sum(nil)
|
||||||
|
if hex.EncodeToString(binaryMd5) != string(md5Val[0:32]) {
|
||||||
|
glog.Errorf("md5:'%s' '%s'", hex.EncodeToString(binaryMd5), string(md5Val[0:32]))
|
||||||
|
err = fmt.Errorf("binary md5sum doesn't match")
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
err = extractToFile(buf, downloadFilename, target)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
} else {
|
||||||
|
glog.V(0).Infof("successfully updated weed to version %v\n", rel.Version)
|
||||||
|
}
|
||||||
|
|
||||||
|
return rel.Version, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GitHubLatestRelease uses the GitHub API to get information about the specific
|
||||||
|
// release of a repository.
|
||||||
|
func GitHubLatestRelease(ctx context.Context, ver string, owner, repo string) (Release, error) {
|
||||||
|
ctx, cancel := context.WithTimeout(ctx, githubAPITimeout)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
url := fmt.Sprintf("https://api.github.com/repos/%s/%s/releases", owner, repo)
|
||||||
|
req, err := http.NewRequest(http.MethodGet, url, nil)
|
||||||
|
if err != nil {
|
||||||
|
return Release{}, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// pin API version 3
|
||||||
|
req.Header.Set("Accept", "application/vnd.github.v3+json")
|
||||||
|
|
||||||
|
res, err := ctxhttp.Do(ctx, http.DefaultClient, req)
|
||||||
|
if err != nil {
|
||||||
|
return Release{}, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if res.StatusCode != http.StatusOK {
|
||||||
|
content := res.Header.Get("Content-Type")
|
||||||
|
if strings.Contains(content, "application/json") {
|
||||||
|
// try to decode error message
|
||||||
|
var msg githubError
|
||||||
|
jerr := json.NewDecoder(res.Body).Decode(&msg)
|
||||||
|
if jerr == nil {
|
||||||
|
return Release{}, fmt.Errorf("unexpected status %v (%v) returned, message:\n %v", res.StatusCode, res.Status, msg.Message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_ = res.Body.Close()
|
||||||
|
return Release{}, fmt.Errorf("unexpected status %v (%v) returned", res.StatusCode, res.Status)
|
||||||
|
}
|
||||||
|
|
||||||
|
buf, err := ioutil.ReadAll(res.Body)
|
||||||
|
if err != nil {
|
||||||
|
_ = res.Body.Close()
|
||||||
|
return Release{}, err
|
||||||
|
}
|
||||||
|
|
||||||
|
err = res.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return Release{}, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var release Release
|
||||||
|
var releaseList []Release
|
||||||
|
err = json.Unmarshal(buf, &releaseList)
|
||||||
|
if err != nil {
|
||||||
|
return Release{}, err
|
||||||
|
}
|
||||||
|
if ver == "0" {
|
||||||
|
release = releaseList[0]
|
||||||
|
glog.V(0).Infof("latest version is %v\n", release.TagName)
|
||||||
|
} else {
|
||||||
|
for _, r := range releaseList {
|
||||||
|
if r.TagName == ver {
|
||||||
|
release = r
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if release.TagName == "" {
|
||||||
|
return Release{}, fmt.Errorf("can not find the specific version")
|
||||||
|
}
|
||||||
|
|
||||||
|
release.Version = release.TagName
|
||||||
|
return release, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func getGithubData(ctx context.Context, url string) ([]byte, error) {
|
||||||
|
req, err := http.NewRequest(http.MethodGet, url, nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// request binary data
|
||||||
|
req.Header.Set("Accept", "application/octet-stream")
|
||||||
|
|
||||||
|
res, err := ctxhttp.Do(ctx, http.DefaultClient, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if res.StatusCode != http.StatusOK {
|
||||||
|
return nil, fmt.Errorf("unexpected status %v (%v) returned", res.StatusCode, res.Status)
|
||||||
|
}
|
||||||
|
|
||||||
|
buf, err := ioutil.ReadAll(res.Body)
|
||||||
|
if err != nil {
|
||||||
|
_ = res.Body.Close()
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
err = res.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return buf, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func getGithubDataFile(ctx context.Context, assets []Asset, suffix string) (filename string, data []byte, err error) {
|
||||||
|
var url string
|
||||||
|
for _, a := range assets {
|
||||||
|
if strings.HasSuffix(a.Name, suffix) {
|
||||||
|
url = a.URL
|
||||||
|
filename = a.Name
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if url == "" {
|
||||||
|
return "", nil, fmt.Errorf("unable to find file with suffix %v", suffix)
|
||||||
|
}
|
||||||
|
|
||||||
|
glog.V(0).Infof("download %v\n", filename)
|
||||||
|
data, err = getGithubData(ctx, url)
|
||||||
|
if err != nil {
|
||||||
|
return "", nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return filename, data, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func extractToFile(buf []byte, filename, target string) error {
|
||||||
|
var rd io.Reader = bytes.NewReader(buf)
|
||||||
|
|
||||||
|
switch filepath.Ext(filename) {
|
||||||
|
case ".gz":
|
||||||
|
gr, err := gzip.NewReader(rd)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer gr.Close()
|
||||||
|
trd := tar.NewReader(gr)
|
||||||
|
hdr, terr := trd.Next()
|
||||||
|
if terr != nil {
|
||||||
|
glog.Errorf("uncompress file(%s) failed:%s", hdr.Name, terr)
|
||||||
|
return terr
|
||||||
|
}
|
||||||
|
rd = trd
|
||||||
|
case ".zip":
|
||||||
|
zrd, err := zip.NewReader(bytes.NewReader(buf), int64(len(buf)))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(zrd.File) != 1 {
|
||||||
|
return fmt.Errorf("ZIP archive contains more than one file")
|
||||||
|
}
|
||||||
|
|
||||||
|
file, err := zrd.File[0].Open()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
defer func() {
|
||||||
|
_ = file.Close()
|
||||||
|
}()
|
||||||
|
|
||||||
|
rd = file
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write everything to a temp file
|
||||||
|
dir := filepath.Dir(target)
|
||||||
|
new, err := ioutil.TempFile(dir, "weed")
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
n, err := io.Copy(new, rd)
|
||||||
|
if err != nil {
|
||||||
|
_ = new.Close()
|
||||||
|
_ = os.Remove(new.Name())
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = new.Sync(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = new.Close(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
mode := os.FileMode(0755)
|
||||||
|
// attempt to find the original mode
|
||||||
|
if fi, err := os.Lstat(target); err == nil {
|
||||||
|
mode = fi.Mode()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Rename the temp file to the final location atomically.
|
||||||
|
if err := os.Rename(new.Name(), target); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
glog.V(0).Infof("saved %d bytes in %v\n", n, target)
|
||||||
|
return os.Chmod(target, mode)
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
//go:build elastic && ydb && gocdk && tikv
|
||||||
|
// +build elastic,ydb,gocdk,tikv
|
||||||
|
|
||||||
|
package command
|
||||||
|
|
||||||
|
//set true if gtags are set
|
||||||
|
func init() {
|
||||||
|
isFullVersion = true
|
||||||
|
}
|
||||||
@@ -65,7 +65,8 @@ type VolumeServerOptions struct {
|
|||||||
preStopSeconds *int
|
preStopSeconds *int
|
||||||
metricsHttpPort *int
|
metricsHttpPort *int
|
||||||
// pulseSeconds *int
|
// pulseSeconds *int
|
||||||
enableTcp *bool
|
enableTcp *bool
|
||||||
|
inflightUploadDataTimeout *time.Duration
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -96,6 +97,7 @@ func init() {
|
|||||||
v.metricsHttpPort = cmdVolume.Flag.Int("metricsPort", 0, "Prometheus metrics listen port")
|
v.metricsHttpPort = cmdVolume.Flag.Int("metricsPort", 0, "Prometheus metrics listen port")
|
||||||
v.idxFolder = cmdVolume.Flag.String("dir.idx", "", "directory to store .idx files")
|
v.idxFolder = cmdVolume.Flag.String("dir.idx", "", "directory to store .idx files")
|
||||||
v.enableTcp = cmdVolume.Flag.Bool("tcp", false, "<experimental> enable tcp port")
|
v.enableTcp = cmdVolume.Flag.Bool("tcp", false, "<experimental> enable tcp port")
|
||||||
|
v.inflightUploadDataTimeout = cmdVolume.Flag.Duration("inflightUploadDataTimeout", 60*time.Second, "inflight upload data wait timeout of volume servers")
|
||||||
}
|
}
|
||||||
|
|
||||||
var cmdVolume = &Command{
|
var cmdVolume = &Command{
|
||||||
@@ -244,6 +246,7 @@ func (v VolumeServerOptions) startVolumeServer(volumeFolders, maxVolumeCounts, v
|
|||||||
*v.fileSizeLimitMB,
|
*v.fileSizeLimitMB,
|
||||||
int64(*v.concurrentUploadLimitMB)*1024*1024,
|
int64(*v.concurrentUploadLimitMB)*1024*1024,
|
||||||
int64(*v.concurrentDownloadLimitMB)*1024*1024,
|
int64(*v.concurrentDownloadLimitMB)*1024*1024,
|
||||||
|
*v.inflightUploadDataTimeout,
|
||||||
)
|
)
|
||||||
// starting grpc server
|
// starting grpc server
|
||||||
grpcS := v.startGrpcService(volumeServer)
|
grpcS := v.startGrpcService(volumeServer)
|
||||||
@@ -267,7 +270,7 @@ func (v VolumeServerOptions) startVolumeServer(volumeFolders, maxVolumeCounts, v
|
|||||||
|
|
||||||
stopChan := make(chan bool)
|
stopChan := make(chan bool)
|
||||||
grace.OnInterrupt(func() {
|
grace.OnInterrupt(func() {
|
||||||
fmt.Println("volume server has be killed")
|
fmt.Println("volume server has been killed")
|
||||||
|
|
||||||
// Stop heartbeats
|
// Stop heartbeats
|
||||||
if !volumeServer.StopHeartbeat() {
|
if !volumeServer.StopHeartbeat() {
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ func (store *AbstractSqlStore) InsertEntry(ctx context.Context, entry *filer.Ent
|
|||||||
return fmt.Errorf("encode %s: %s", entry.FullPath, err)
|
return fmt.Errorf("encode %s: %s", entry.FullPath, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(entry.Chunks) > 50 {
|
if len(entry.Chunks) > filer.CountEntryChunksForGzip {
|
||||||
meta = util.MaybeGzipData(meta)
|
meta = util.MaybeGzipData(meta)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ func (store *AbstractSqlStore) KvPut(ctx context.Context, key []byte, value []by
|
|||||||
return fmt.Errorf("findDB: %v", err)
|
return fmt.Errorf("findDB: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
dirStr, dirHash, name := genDirAndName(key)
|
dirStr, dirHash, name := GenDirAndName(key)
|
||||||
|
|
||||||
res, err := db.ExecContext(ctx, store.GetSqlInsert(DEFAULT_TABLE), dirHash, name, dirStr, value)
|
res, err := db.ExecContext(ctx, store.GetSqlInsert(DEFAULT_TABLE), dirHash, name, dirStr, value)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
@@ -53,7 +53,7 @@ func (store *AbstractSqlStore) KvGet(ctx context.Context, key []byte) (value []b
|
|||||||
return nil, fmt.Errorf("findDB: %v", err)
|
return nil, fmt.Errorf("findDB: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
dirStr, dirHash, name := genDirAndName(key)
|
dirStr, dirHash, name := GenDirAndName(key)
|
||||||
row := db.QueryRowContext(ctx, store.GetSqlFind(DEFAULT_TABLE), dirHash, name, dirStr)
|
row := db.QueryRowContext(ctx, store.GetSqlFind(DEFAULT_TABLE), dirHash, name, dirStr)
|
||||||
|
|
||||||
err = row.Scan(&value)
|
err = row.Scan(&value)
|
||||||
@@ -76,7 +76,7 @@ func (store *AbstractSqlStore) KvDelete(ctx context.Context, key []byte) (err er
|
|||||||
return fmt.Errorf("findDB: %v", err)
|
return fmt.Errorf("findDB: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
dirStr, dirHash, name := genDirAndName(key)
|
dirStr, dirHash, name := GenDirAndName(key)
|
||||||
|
|
||||||
res, err := db.ExecContext(ctx, store.GetSqlDelete(DEFAULT_TABLE), dirHash, name, dirStr)
|
res, err := db.ExecContext(ctx, store.GetSqlDelete(DEFAULT_TABLE), dirHash, name, dirStr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -92,7 +92,7 @@ func (store *AbstractSqlStore) KvDelete(ctx context.Context, key []byte) (err er
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func genDirAndName(key []byte) (dirStr string, dirHash int64, name string) {
|
func GenDirAndName(key []byte) (dirStr string, dirHash int64, name string) {
|
||||||
for len(key) < 8 {
|
for len(key) < 8 {
|
||||||
key = append(key, 0)
|
key = append(key, 0)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,347 @@
|
|||||||
|
package arangodb
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"crypto/tls"
|
||||||
|
"fmt"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/arangodb/go-driver"
|
||||||
|
"github.com/arangodb/go-driver/http"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/filer"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/glog"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/util"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
filer.Stores = append(filer.Stores, &ArangodbStore{})
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
BUCKET_PREFIX = "/buckets"
|
||||||
|
DEFAULT_COLLECTION = "seaweed_no_bucket"
|
||||||
|
KVMETA_COLLECTION = "seaweed_kvmeta"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ArangodbStore struct {
|
||||||
|
connect driver.Connection
|
||||||
|
client driver.Client
|
||||||
|
database driver.Database
|
||||||
|
kvCollection driver.Collection
|
||||||
|
|
||||||
|
buckets map[string]driver.Collection
|
||||||
|
mu sync.RWMutex
|
||||||
|
|
||||||
|
databaseName string
|
||||||
|
}
|
||||||
|
|
||||||
|
type Model struct {
|
||||||
|
Key string `json:"_key"`
|
||||||
|
Directory string `json:"directory,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Ttl string `json:"ttl,omitempty"`
|
||||||
|
|
||||||
|
//arangodb does not support binary blobs
|
||||||
|
//we encode byte slice into uint64 slice
|
||||||
|
//see helpers.go
|
||||||
|
Meta []uint64 `json:"meta"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (store *ArangodbStore) GetName() string {
|
||||||
|
return "arangodb"
|
||||||
|
}
|
||||||
|
|
||||||
|
func (store *ArangodbStore) Initialize(configuration util.Configuration, prefix string) (err error) {
|
||||||
|
store.buckets = make(map[string]driver.Collection, 3)
|
||||||
|
store.databaseName = configuration.GetString(prefix + "db_name")
|
||||||
|
return store.connection(configuration.GetStringSlice(prefix+"servers"),
|
||||||
|
configuration.GetString(prefix+"username"),
|
||||||
|
configuration.GetString(prefix+"password"),
|
||||||
|
configuration.GetBool(prefix+"insecure_skip_verify"),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (store *ArangodbStore) connection(uris []string, user string, pass string, insecure bool) (err error) {
|
||||||
|
ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
|
||||||
|
|
||||||
|
store.connect, err = http.NewConnection(http.ConnectionConfig{
|
||||||
|
Endpoints: uris,
|
||||||
|
TLSConfig: &tls.Config{
|
||||||
|
InsecureSkipVerify: insecure,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
store.client, err = driver.NewClient(driver.ClientConfig{
|
||||||
|
Connection: store.connect,
|
||||||
|
Authentication: driver.BasicAuthentication(user, pass),
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
ok, err := store.client.DatabaseExists(ctx, store.databaseName)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if ok {
|
||||||
|
store.database, err = store.client.Database(ctx, store.databaseName)
|
||||||
|
} else {
|
||||||
|
store.database, err = store.client.CreateDatabase(ctx, store.databaseName, &driver.CreateDatabaseOptions{})
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if store.kvCollection, err = store.ensureCollection(ctx, KVMETA_COLLECTION); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
type key int
|
||||||
|
|
||||||
|
const (
|
||||||
|
transactionKey key = 0
|
||||||
|
)
|
||||||
|
|
||||||
|
func (store *ArangodbStore) BeginTransaction(ctx context.Context) (context.Context, error) {
|
||||||
|
keys := make([]string, 0, len(store.buckets)+1)
|
||||||
|
for k := range store.buckets {
|
||||||
|
keys = append(keys, k)
|
||||||
|
}
|
||||||
|
keys = append(keys, store.kvCollection.Name())
|
||||||
|
txn, err := store.database.BeginTransaction(ctx, driver.TransactionCollections{
|
||||||
|
Exclusive: keys,
|
||||||
|
}, &driver.BeginTransactionOptions{})
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return context.WithValue(ctx, transactionKey, txn), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (store *ArangodbStore) CommitTransaction(ctx context.Context) error {
|
||||||
|
val := ctx.Value(transactionKey)
|
||||||
|
cast, ok := val.(driver.TransactionID)
|
||||||
|
if !ok {
|
||||||
|
return fmt.Errorf("txn cast fail %s:", val)
|
||||||
|
}
|
||||||
|
err := store.database.CommitTransaction(ctx, cast, &driver.CommitTransactionOptions{})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (store *ArangodbStore) RollbackTransaction(ctx context.Context) error {
|
||||||
|
val := ctx.Value(transactionKey)
|
||||||
|
cast, ok := val.(driver.TransactionID)
|
||||||
|
if !ok {
|
||||||
|
return fmt.Errorf("txn cast fail %s:", val)
|
||||||
|
}
|
||||||
|
err := store.database.AbortTransaction(ctx, cast, &driver.AbortTransactionOptions{})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (store *ArangodbStore) InsertEntry(ctx context.Context, entry *filer.Entry) (err error) {
|
||||||
|
dir, name := entry.FullPath.DirAndName()
|
||||||
|
meta, err := entry.EncodeAttributesAndChunks()
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("encode %s: %s", entry.FullPath, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(entry.Chunks) > filer.CountEntryChunksForGzip {
|
||||||
|
meta = util.MaybeGzipData(meta)
|
||||||
|
}
|
||||||
|
model := &Model{
|
||||||
|
Key: hashString(string(entry.FullPath)),
|
||||||
|
Directory: dir,
|
||||||
|
Name: name,
|
||||||
|
Meta: bytesToArray(meta),
|
||||||
|
}
|
||||||
|
if entry.TtlSec > 0 {
|
||||||
|
model.Ttl = time.Now().Add(time.Second * time.Duration(entry.TtlSec)).Format(time.RFC3339)
|
||||||
|
} else {
|
||||||
|
model.Ttl = ""
|
||||||
|
}
|
||||||
|
|
||||||
|
targetCollection, err := store.extractBucketCollection(ctx, entry.FullPath)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
_, err = targetCollection.CreateDocument(ctx, model)
|
||||||
|
if driver.IsConflict(err) {
|
||||||
|
return store.UpdateEntry(ctx, entry)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("InsertEntry %s: %v", entry.FullPath, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func (store *ArangodbStore) UpdateEntry(ctx context.Context, entry *filer.Entry) (err error) {
|
||||||
|
dir, name := entry.FullPath.DirAndName()
|
||||||
|
meta, err := entry.EncodeAttributesAndChunks()
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("encode %s: %s", entry.FullPath, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(entry.Chunks) > filer.CountEntryChunksForGzip {
|
||||||
|
meta = util.MaybeGzipData(meta)
|
||||||
|
}
|
||||||
|
model := &Model{
|
||||||
|
Key: hashString(string(entry.FullPath)),
|
||||||
|
Directory: dir,
|
||||||
|
Name: name,
|
||||||
|
Meta: bytesToArray(meta),
|
||||||
|
}
|
||||||
|
if entry.TtlSec > 0 {
|
||||||
|
model.Ttl = time.Now().Add(time.Duration(entry.TtlSec) * time.Second).Format(time.RFC3339)
|
||||||
|
} else {
|
||||||
|
model.Ttl = "none"
|
||||||
|
}
|
||||||
|
targetCollection, err := store.extractBucketCollection(ctx, entry.FullPath)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
_, err = targetCollection.UpdateDocument(ctx, model.Key, model)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("UpdateEntry %s: %v", entry.FullPath, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (store *ArangodbStore) FindEntry(ctx context.Context, fullpath util.FullPath) (entry *filer.Entry, err error) {
|
||||||
|
var data Model
|
||||||
|
targetCollection, err := store.extractBucketCollection(ctx, fullpath)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
_, err = targetCollection.ReadDocument(ctx, hashString(string(fullpath)), &data)
|
||||||
|
if err != nil {
|
||||||
|
if driver.IsNotFound(err) {
|
||||||
|
return nil, filer_pb.ErrNotFound
|
||||||
|
}
|
||||||
|
glog.Errorf("find %s: %v", fullpath, err)
|
||||||
|
return nil, filer_pb.ErrNotFound
|
||||||
|
}
|
||||||
|
if len(data.Meta) == 0 {
|
||||||
|
return nil, filer_pb.ErrNotFound
|
||||||
|
}
|
||||||
|
entry = &filer.Entry{
|
||||||
|
FullPath: fullpath,
|
||||||
|
}
|
||||||
|
err = entry.DecodeAttributesAndChunks(util.MaybeDecompressData(arrayToBytes(data.Meta)))
|
||||||
|
if err != nil {
|
||||||
|
return entry, fmt.Errorf("decode %s : %v", entry.FullPath, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return entry, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (store *ArangodbStore) DeleteEntry(ctx context.Context, fullpath util.FullPath) (err error) {
|
||||||
|
targetCollection, err := store.extractBucketCollection(ctx, fullpath)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
_, err = targetCollection.RemoveDocument(ctx, hashString(string(fullpath)))
|
||||||
|
if err != nil && !driver.IsNotFound(err) {
|
||||||
|
glog.Errorf("find %s: %v", fullpath, err)
|
||||||
|
return fmt.Errorf("delete %s : %v", fullpath, err)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// this runs in log time
|
||||||
|
func (store *ArangodbStore) DeleteFolderChildren(ctx context.Context, fullpath util.FullPath) (err error) {
|
||||||
|
var query string
|
||||||
|
targetCollection, err := store.extractBucketCollection(ctx, fullpath)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
query = query + fmt.Sprintf(`
|
||||||
|
for d in %s
|
||||||
|
filter starts_with(d.directory, "%s/") || d.directory == "%s"
|
||||||
|
remove d._key in %s`,
|
||||||
|
targetCollection.Name(),
|
||||||
|
strings.Join(strings.Split(string(fullpath), "/"), ","),
|
||||||
|
string(fullpath),
|
||||||
|
targetCollection.Name(),
|
||||||
|
)
|
||||||
|
cur, err := store.database.Query(ctx, query, nil)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("delete %s : %v", fullpath, err)
|
||||||
|
}
|
||||||
|
defer cur.Close()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (store *ArangodbStore) ListDirectoryEntries(ctx context.Context, dirPath util.FullPath, startFileName string, includeStartFile bool, limit int64, eachEntryFunc filer.ListEachEntryFunc) (lastFileName string, err error) {
|
||||||
|
return store.ListDirectoryPrefixedEntries(ctx, dirPath, startFileName, includeStartFile, limit, "", eachEntryFunc)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (store *ArangodbStore) ListDirectoryPrefixedEntries(ctx context.Context, dirPath util.FullPath, startFileName string, includeStartFile bool, limit int64, prefix string, eachEntryFunc filer.ListEachEntryFunc) (lastFileName string, err error) {
|
||||||
|
targetCollection, err := store.extractBucketCollection(ctx, dirPath+"/")
|
||||||
|
if err != nil {
|
||||||
|
return lastFileName, err
|
||||||
|
}
|
||||||
|
query := "for d in " + targetCollection.Name()
|
||||||
|
if includeStartFile {
|
||||||
|
query = query + " filter d.name >= \"" + startFileName + "\" "
|
||||||
|
} else {
|
||||||
|
query = query + " filter d.name > \"" + startFileName + "\" "
|
||||||
|
}
|
||||||
|
if prefix != "" {
|
||||||
|
query = query + fmt.Sprintf(`&& starts_with(d.name, "%s")`, prefix)
|
||||||
|
}
|
||||||
|
query = query + `
|
||||||
|
filter d.directory == @dir
|
||||||
|
sort d.name asc
|
||||||
|
`
|
||||||
|
if limit > 0 {
|
||||||
|
query = query + "limit " + strconv.Itoa(int(limit))
|
||||||
|
}
|
||||||
|
query = query + "\n return d"
|
||||||
|
cur, err := store.database.Query(ctx, query, map[string]interface{}{"dir": dirPath})
|
||||||
|
if err != nil {
|
||||||
|
return lastFileName, fmt.Errorf("failed to list directory entries: find error: %w", err)
|
||||||
|
}
|
||||||
|
defer cur.Close()
|
||||||
|
for cur.HasMore() {
|
||||||
|
var data Model
|
||||||
|
_, err = cur.ReadDocument(ctx, &data)
|
||||||
|
if err != nil {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
entry := &filer.Entry{
|
||||||
|
FullPath: util.NewFullPath(data.Directory, data.Name),
|
||||||
|
}
|
||||||
|
lastFileName = data.Name
|
||||||
|
converted := arrayToBytes(data.Meta)
|
||||||
|
if decodeErr := entry.DecodeAttributesAndChunks(util.MaybeDecompressData(converted)); decodeErr != nil {
|
||||||
|
err = decodeErr
|
||||||
|
glog.V(0).Infof("list %s : %v", entry.FullPath, err)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
if !eachEntryFunc(entry) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return lastFileName, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (store *ArangodbStore) Shutdown() {
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package arangodb
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/arangodb/go-driver"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/filer"
|
||||||
|
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/glog"
|
||||||
|
)
|
||||||
|
|
||||||
|
var _ filer.BucketAware = (*ArangodbStore)(nil)
|
||||||
|
|
||||||
|
func (store *ArangodbStore) OnBucketCreation(bucket string) {
|
||||||
|
timeout, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||||
|
defer cancel()
|
||||||
|
// create the collection && add to cache
|
||||||
|
_, err := store.ensureBucket(timeout, bucket)
|
||||||
|
if err != nil {
|
||||||
|
glog.Errorf("bucket create %s: %v", bucket, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (store *ArangodbStore) OnBucketDeletion(bucket string) {
|
||||||
|
timeout, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||||
|
defer cancel()
|
||||||
|
collection, err := store.ensureBucket(timeout, bucket)
|
||||||
|
if err != nil {
|
||||||
|
glog.Errorf("bucket delete %s: %v", bucket, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = collection.Remove(timeout)
|
||||||
|
if err != nil && !driver.IsNotFound(err) {
|
||||||
|
glog.Errorf("bucket delete %s: %v", bucket, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (store *ArangodbStore) CanDropWholeBucket() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package arangodb
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/arangodb/go-driver"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/filer"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/glog"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (store *ArangodbStore) KvPut(ctx context.Context, key []byte, value []byte) (err error) {
|
||||||
|
model := &Model{
|
||||||
|
Key: hashString(".kvstore." + string(key)),
|
||||||
|
Directory: ".kvstore." + string(key),
|
||||||
|
Meta: bytesToArray(value),
|
||||||
|
}
|
||||||
|
|
||||||
|
exists, err := store.kvCollection.DocumentExists(ctx, model.Key)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("kv put: %v", err)
|
||||||
|
}
|
||||||
|
if exists {
|
||||||
|
_, err = store.kvCollection.UpdateDocument(ctx, model.Key, model)
|
||||||
|
} else {
|
||||||
|
_, err = store.kvCollection.CreateDocument(ctx, model)
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("kv put: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (store *ArangodbStore) KvGet(ctx context.Context, key []byte) (value []byte, err error) {
|
||||||
|
var model Model
|
||||||
|
_, err = store.kvCollection.ReadDocument(ctx, hashString(".kvstore."+string(key)), &model)
|
||||||
|
if driver.IsNotFound(err) {
|
||||||
|
return nil, filer.ErrKvNotFound
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
glog.Errorf("kv get: %s %v", string(key), err)
|
||||||
|
return nil, filer.ErrKvNotFound
|
||||||
|
}
|
||||||
|
return arrayToBytes(model.Meta), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (store *ArangodbStore) KvDelete(ctx context.Context, key []byte) (err error) {
|
||||||
|
_, err = store.kvCollection.RemoveDocument(ctx, hashString(".kvstore."+string(key)))
|
||||||
|
if err != nil {
|
||||||
|
glog.Errorf("kv del: %v", err)
|
||||||
|
return filer.ErrKvNotFound
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,136 @@
|
|||||||
|
package arangodb
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"crypto/md5"
|
||||||
|
"encoding/binary"
|
||||||
|
"encoding/hex"
|
||||||
|
"io"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/arangodb/go-driver"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/util"
|
||||||
|
)
|
||||||
|
|
||||||
|
//convert a string into arango-key safe hex bytes hash
|
||||||
|
func hashString(dir string) string {
|
||||||
|
h := md5.New()
|
||||||
|
io.WriteString(h, dir)
|
||||||
|
b := h.Sum(nil)
|
||||||
|
return hex.EncodeToString(b)
|
||||||
|
}
|
||||||
|
|
||||||
|
// convert slice of bytes into slice of uint64
|
||||||
|
// the first uint64 indicates the length in bytes
|
||||||
|
func bytesToArray(bs []byte) []uint64 {
|
||||||
|
out := make([]uint64, 0, 2+len(bs)/8)
|
||||||
|
out = append(out, uint64(len(bs)))
|
||||||
|
for len(bs)%8 != 0 {
|
||||||
|
bs = append(bs, 0)
|
||||||
|
}
|
||||||
|
for i := 0; i < len(bs); i = i + 8 {
|
||||||
|
out = append(out, binary.BigEndian.Uint64(bs[i:]))
|
||||||
|
}
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// convert from slice of uint64 back to bytes
|
||||||
|
// if input length is 0 or 1, will return nil
|
||||||
|
func arrayToBytes(xs []uint64) []byte {
|
||||||
|
if len(xs) < 2 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
first := xs[0]
|
||||||
|
out := make([]byte, len(xs)*8) // i think this can actually be len(xs)*8-8, but i dont think an extra 8 bytes hurts...
|
||||||
|
for i := 1; i < len(xs); i = i + 1 {
|
||||||
|
binary.BigEndian.PutUint64(out[((i-1)*8):], xs[i])
|
||||||
|
}
|
||||||
|
return out[:first]
|
||||||
|
}
|
||||||
|
|
||||||
|
// gets the collection the bucket points to from filepath
|
||||||
|
func (store *ArangodbStore) extractBucketCollection(ctx context.Context, fullpath util.FullPath) (c driver.Collection, err error) {
|
||||||
|
bucket, _ := extractBucket(fullpath)
|
||||||
|
if bucket == "" {
|
||||||
|
bucket = DEFAULT_COLLECTION
|
||||||
|
}
|
||||||
|
c, err = store.ensureBucket(ctx, bucket)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return c, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// called by extractBucketCollection
|
||||||
|
func extractBucket(fullpath util.FullPath) (string, string) {
|
||||||
|
if !strings.HasPrefix(string(fullpath), BUCKET_PREFIX+"/") {
|
||||||
|
return "", string(fullpath)
|
||||||
|
}
|
||||||
|
if strings.Count(string(fullpath), "/") < 3 {
|
||||||
|
return "", string(fullpath)
|
||||||
|
}
|
||||||
|
bucketAndObjectKey := string(fullpath)[len(BUCKET_PREFIX+"/"):]
|
||||||
|
t := strings.Index(bucketAndObjectKey, "/")
|
||||||
|
bucket := bucketAndObjectKey
|
||||||
|
shortPath := "/"
|
||||||
|
if t > 0 {
|
||||||
|
bucket = bucketAndObjectKey[:t]
|
||||||
|
shortPath = string(util.FullPath(bucketAndObjectKey[t:]))
|
||||||
|
}
|
||||||
|
return bucket, shortPath
|
||||||
|
}
|
||||||
|
|
||||||
|
// get bucket collection from cache. if not exist, creates the buckets collection and grab it
|
||||||
|
func (store *ArangodbStore) ensureBucket(ctx context.Context, bucket string) (bc driver.Collection, err error) {
|
||||||
|
var ok bool
|
||||||
|
store.mu.RLock()
|
||||||
|
bc, ok = store.buckets[bucket]
|
||||||
|
store.mu.RUnlock()
|
||||||
|
if ok {
|
||||||
|
return bc, nil
|
||||||
|
}
|
||||||
|
store.mu.Lock()
|
||||||
|
defer store.mu.Unlock()
|
||||||
|
store.buckets[bucket], err = store.ensureCollection(ctx, bucket)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return store.buckets[bucket], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// creates collection if not exist, ensures indices if not exist
|
||||||
|
func (store *ArangodbStore) ensureCollection(ctx context.Context, name string) (c driver.Collection, err error) {
|
||||||
|
ok, err := store.database.CollectionExists(ctx, name)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if ok {
|
||||||
|
c, err = store.database.Collection(ctx, name)
|
||||||
|
} else {
|
||||||
|
c, err = store.database.CreateCollection(ctx, name, &driver.CreateCollectionOptions{})
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// ensure indices
|
||||||
|
if _, _, err = c.EnsurePersistentIndex(ctx, []string{"directory", "name"},
|
||||||
|
&driver.EnsurePersistentIndexOptions{
|
||||||
|
Name: "directory_name_multi", Unique: true,
|
||||||
|
}); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if _, _, err = c.EnsurePersistentIndex(ctx, []string{"directory"},
|
||||||
|
&driver.EnsurePersistentIndexOptions{Name: "IDX_directory"}); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if _, _, err = c.EnsureTTLIndex(ctx, "ttl", 1,
|
||||||
|
&driver.EnsureTTLIndexOptions{Name: "IDX_TTL"}); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if _, _, err = c.EnsurePersistentIndex(ctx, []string{"name"}, &driver.EnsurePersistentIndexOptions{
|
||||||
|
Name: "IDX_name",
|
||||||
|
}); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return c, nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
##arangodb
|
||||||
|
|
||||||
|
database: https://github.com/arangodb/arangodb
|
||||||
|
go driver: https://github.com/arangodb/go-driver
|
||||||
|
|
||||||
|
options:
|
||||||
|
|
||||||
|
```
|
||||||
|
[arangodb]
|
||||||
|
enabled=true
|
||||||
|
db_name="seaweedfs"
|
||||||
|
servers=["http://localhost:8529"]
|
||||||
|
#basic auth
|
||||||
|
user="root"
|
||||||
|
pass="test"
|
||||||
|
|
||||||
|
# tls settings
|
||||||
|
insecure_skip_verify=true
|
||||||
|
```
|
||||||
|
|
||||||
|
i test using this dev database:
|
||||||
|
`docker run -p 8529:8529 -e ARANGO_ROOT_PASSWORD=test arangodb/arangodb:3.9.0`
|
||||||
|
|
||||||
|
|
||||||
|
## features i don't personally need but are missing
|
||||||
|
[ ] provide tls cert to arango
|
||||||
|
[ ] authentication that is not basic auth
|
||||||
|
[ ] synchronise endpoint interval config
|
||||||
|
[ ] automatic creation of custom index
|
||||||
|
[ ] configure default arangodb collection sharding rules
|
||||||
|
[ ] configure default arangodb collection replication rules
|
||||||
|
|
||||||
|
|
||||||
|
## complexity
|
||||||
|
|
||||||
|
ok, so if https://www.arangodb.com/docs/stable/indexing-index-basics.html#persistent-index is correct
|
||||||
|
|
||||||
|
O(1)
|
||||||
|
- InsertEntry
|
||||||
|
- UpdateEntry
|
||||||
|
- FindEntry
|
||||||
|
- DeleteEntry
|
||||||
|
- KvPut
|
||||||
|
- KvGet
|
||||||
|
- KvDelete
|
||||||
|
|
||||||
|
O(log(BUCKET_SIZE))
|
||||||
|
- DeleteFolderChildren
|
||||||
|
|
||||||
|
O(log(DIRECTORY_SIZE))
|
||||||
|
- ListDirectoryEntries
|
||||||
|
- ListDirectoryPrefixedEntries
|
||||||
@@ -100,7 +100,7 @@ func (store *CassandraStore) InsertEntry(ctx context.Context, entry *filer.Entry
|
|||||||
return fmt.Errorf("encode %s: %s", entry.FullPath, err)
|
return fmt.Errorf("encode %s: %s", entry.FullPath, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(entry.Chunks) > 50 {
|
if len(entry.Chunks) > filer.CountEntryChunksForGzip {
|
||||||
meta = util.MaybeGzipData(meta)
|
meta = util.MaybeGzipData(meta)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loaded 100 of 344 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user