mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 02:27:26 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
c6ec5269f4 | ||
|
|
a9b4f0df04 | ||
|
|
261ba0208e | ||
|
|
71e837d6f1 | ||
|
|
50e93c3629 | ||
|
|
bc74b57a0b | ||
|
|
dffb59f350 | ||
|
|
295b1fcccc | ||
|
|
1cfae9f5c9 | ||
|
|
7a5128e9ee | ||
|
|
5593b0579c | ||
|
|
fa070474d5 | ||
|
|
9f4ecd50ac | ||
|
|
ceb058ddd9 | ||
|
|
7f26676f57 | ||
|
|
b1493520ee | ||
|
|
dff63e9024 | ||
|
|
4dba102137 | ||
|
|
bbc95dac47 | ||
|
|
aa7703c6dd | ||
|
|
f34205e110 | ||
|
|
104ea7b029 | ||
|
|
d6ee4bf65e | ||
|
|
41d396edc4 | ||
|
|
a2fdb3e277 | ||
|
|
35bc67f030 | ||
|
|
f5246b748d | ||
|
|
11a9f993a8 | ||
|
|
7ff248d5cd | ||
|
|
85d80fd36d | ||
|
|
abe3cc6df2 | ||
|
|
869d23b099 | ||
|
|
86ed27f602 | ||
|
|
2347c21cdd | ||
|
|
2454020a92 | ||
|
|
4f87ee7755 | ||
|
|
c20e1edd99 | ||
|
|
ec53eec94f | ||
|
|
3ab2c0e5c0 | ||
|
|
9d44b89c21 | ||
|
|
368d8e1a81 | ||
|
|
0a6703c7f7 | ||
|
|
14a2cc83bf | ||
|
|
fa25d5c43a | ||
|
|
ff2ec58897 | ||
|
|
83ee4c5fe2 | ||
|
|
72cbda3481 | ||
|
|
d30eafd0f3 | ||
|
|
9f9e0deafb | ||
|
|
357aa818fe | ||
|
|
3d229fe45c | ||
|
|
79b8e6a8c3 | ||
|
|
c1aeded2dd | ||
|
|
49ecb8d11c | ||
|
|
d02f13c2d1 | ||
|
|
7c85cb332d | ||
|
|
f15a737a0a | ||
|
|
bc888226fc | ||
|
|
8b3d76b24d | ||
|
|
bb4beebce3 | ||
|
|
ae5aa2bf04 | ||
|
|
10dc72ca54 | ||
|
|
0e796a5582 | ||
|
|
68f11b9687 | ||
|
|
1ae7f509f5 | ||
|
|
89d32a0670 | ||
|
|
7dd93a88ac | ||
|
|
17c6e8e39f | ||
|
|
b7cdde14ae | ||
|
|
3176bf126a | ||
|
|
9b0d02ed39 | ||
|
|
e752efc624 | ||
|
|
5b352ec1d2 | ||
|
|
6e4c94e2e1 | ||
|
|
4aae87f405 | ||
|
|
64db9db3de | ||
|
|
bb02803fca | ||
|
|
4062daf416 | ||
|
|
e28a8f802f | ||
|
|
19e5179159 | ||
|
|
e965c92c93 | ||
|
|
b58187df18 | ||
|
|
ca1bdb4661 | ||
|
|
566ec62aec | ||
|
|
622297f1a7 | ||
|
|
1a1e5778c3 | ||
|
|
14dd971890 | ||
|
|
c514710b7b | ||
|
|
d310711de0 | ||
|
|
9eda9a6e82 | ||
|
|
77a7d7253f | ||
|
|
e8d7bb42e2 | ||
|
|
6a2bcd03aa | ||
|
|
958f880b70 | ||
|
|
a8eefda452 | ||
|
|
105578a2f2 | ||
|
|
049f8f2e2a | ||
|
|
b7e34016d4 | ||
|
|
4ecba915f3 | ||
|
|
daca2d22a5 | ||
|
|
4b5c0e3fa9 | ||
|
|
6d55716fc3 | ||
|
|
bbbbbd70a4 | ||
|
|
743ad690b6 | ||
|
|
2305508b65 | ||
|
|
800cbc004c | ||
|
|
7e92517571 | ||
|
|
7fdd29c234 | ||
|
|
b0a7fd67cf | ||
|
|
7f1383a41e | ||
|
|
3817e05dd0 | ||
|
|
3cedb21bb7 | ||
|
|
dfe5bfbe2b | ||
|
|
aa7eb31bea | ||
|
|
2fc524ed30 | ||
|
|
02935ff145 | ||
|
|
1d9e30d8c0 | ||
|
|
67d870dfc2 | ||
|
|
4f5b018a02 | ||
|
|
7f4e33ec15 | ||
|
|
691ed50957 | ||
|
|
f08d67eeb7 | ||
|
|
a180394f75 | ||
|
|
b6a2b43efe | ||
|
|
c29f79a593 | ||
|
|
5738049d5a | ||
|
|
7a002c03fd | ||
|
|
123ab2f9c9 | ||
|
|
c0ac0dd5f2 | ||
|
|
a8b15c676c | ||
|
|
8be731a56d | ||
|
|
6f5f39dcbb | ||
|
|
531907acab | ||
|
|
fcf7f6c022 | ||
|
|
549e341c6f | ||
|
|
ce8ef60c59 | ||
|
|
6317f6a8a9 | ||
|
|
8732cc24c8 | ||
|
|
683581c412 | ||
|
|
7701a3008c | ||
|
|
6a286a5ea9 | ||
|
|
4db7754cd6 | ||
|
|
996231c01d | ||
|
|
50eaf59912 | ||
|
|
e0e8cbc501 | ||
|
|
47871f8389 | ||
|
|
5d59f2b191 | ||
|
|
1ff39c0cf9 | ||
|
|
a3c18ec82c | ||
|
|
993283bb1d | ||
|
|
5b90a39954 | ||
|
|
9231971c88 | ||
|
|
ed07e76f0e | ||
|
|
51bd015179 | ||
|
|
66583e7827 | ||
|
|
b208996153 | ||
|
|
80ddd4c7c8 | ||
|
|
9b118c6f76 | ||
|
|
fed9a96501 | ||
|
|
2fdf766fe5 | ||
|
|
ea0b41d91c | ||
|
|
1d47574531 | ||
|
|
ec6320b037 | ||
|
|
644a613986 | ||
|
|
ca6becfeec | ||
|
|
c464e2e0d5 | ||
|
|
9f0957b4d0 | ||
|
|
907f9b51cd | ||
|
|
7d981a1c0e | ||
|
|
71307ce2e6 | ||
|
|
6701ac3a61 | ||
|
|
f65c055c44 | ||
|
|
391170c3f4 | ||
|
|
bc603e534f | ||
|
|
cfb5440b04 | ||
|
|
d525a57bf3 | ||
|
|
3af8ac8f1e | ||
|
|
84b7b83517 | ||
|
|
830a97475f | ||
|
|
93615b2a49 | ||
|
|
dd2b9d93cc | ||
|
|
5c9a3bb8cf | ||
|
|
21636c98a5 | ||
|
|
02076f01a6 | ||
|
|
0edbc87857 | ||
|
|
d51a724101 | ||
|
|
0490ee87ef | ||
|
|
86d4c52d6e | ||
|
|
21e0898631 | ||
|
|
4ba7127ab1 | ||
|
|
3153c836a7 | ||
|
|
cae998eda1 | ||
|
|
34b743c481 | ||
|
|
fba1cfc2d6 | ||
|
|
a3411dd9da | ||
|
|
db027ed9c0 | ||
|
|
b67ebe67a6 | ||
|
|
1b27f96669 | ||
|
|
aa24af77aa | ||
|
|
33c07e8fb0 | ||
|
|
4cc0440009 | ||
|
|
868ebbd9b0 | ||
|
|
763f354cdf | ||
|
|
423fbf3b08 | ||
|
|
44a0ebdf37 | ||
|
|
1d93ce4aa9 | ||
|
|
843790d8a0 | ||
|
|
30d985c4f7 | ||
|
|
ddd3945c26 | ||
|
|
c1450bf9fe | ||
|
|
89d84e275b | ||
|
|
b0a6f6ab39 | ||
|
|
3de184e37f | ||
|
|
04a3fd0460 | ||
|
|
b0d7e7c9a4 | ||
|
|
2fdfff667a | ||
|
|
44c840f498 | ||
|
|
0bf8ba0047 | ||
|
|
111149f956 | ||
|
|
b4fc1ff223 | ||
|
|
de06d63b80 | ||
|
|
ae40a9cb28 | ||
|
|
0b790d2bbf | ||
|
|
9b04f17555 | ||
|
|
0b5faef612 | ||
|
|
0562fceb99 | ||
|
|
8b983729ca | ||
|
|
23cc039c9b | ||
|
|
d4f20af739 | ||
|
|
46f2849890 | ||
|
|
f697dec43d | ||
|
|
db62759ca5 | ||
|
|
d540cec1dd | ||
|
|
94cfb86016 | ||
|
|
1d1ac14ac0 | ||
|
|
b807b64e58 | ||
|
|
3e47d282fc | ||
|
|
b8837cb5fa | ||
|
|
849a2c1f68 | ||
|
|
105bcfdbd4 | ||
|
|
e48764be75 | ||
|
|
18ae8943ef | ||
|
|
98c001f54a | ||
|
|
0448c05596 | ||
|
|
830e69c85d | ||
|
|
7fce84532b | ||
|
|
b29f16a626 | ||
|
|
560835e944 | ||
|
|
5230d6d9a9 | ||
|
|
a92296d263 | ||
|
|
cbddc10845 | ||
|
|
9a2bd95e20 | ||
|
|
e2cdba292b | ||
|
|
a0bad1c997 | ||
|
|
6c7f7d6887 | ||
|
|
afb93cd19f | ||
|
|
2e23162188 | ||
|
|
c8787d3e9a | ||
|
|
8cfcb9fe9f | ||
|
|
af4f345b0c | ||
|
|
8573798a8c | ||
|
|
5999099ed4 | ||
|
|
087def339f | ||
|
|
c3fe1654b9 | ||
|
|
468361aa78 | ||
|
|
22aca43b26 | ||
|
|
ac9f12c826 | ||
|
|
d1a6bd1cc6 | ||
|
|
a644b7236a | ||
|
|
0d692a6254 | ||
|
|
d12540c9f2 | ||
|
|
8373f9b2e7 | ||
|
|
349257f822 | ||
|
|
f8a089cbca | ||
|
|
4e2388e1b5 | ||
|
|
8f0410af2c | ||
|
|
24541fc7ec | ||
|
|
ae558fa073 | ||
|
|
57c6eddd22 | ||
|
|
80c14877d3 | ||
|
|
581c93d970 | ||
|
|
b75c6dcff5 | ||
|
|
3da2b83b38 | ||
|
|
beb406bbbb | ||
|
|
411c0df3fe | ||
|
|
4615560182 | ||
|
|
9f16df736e | ||
|
|
b1a819ebd8 | ||
|
|
b69ccc92b3 | ||
|
|
db578b0ea4 | ||
|
|
3a18e905d0 | ||
|
|
e13959996a | ||
|
|
ecf198b752 | ||
|
|
39fa4c75df | ||
|
|
c93976dda4 | ||
|
|
822a6fe3c8 | ||
|
|
c51f65df9e | ||
|
|
4bb17c6e36 | ||
|
|
48a2d3327d | ||
|
|
ce58bda4a0 | ||
|
|
c0475cc267 | ||
|
|
04c3be6829 | ||
|
|
d75d409800 | ||
|
|
3f514ef1a7 | ||
|
|
5b2814ec64 | ||
|
|
cf95091d40 | ||
|
|
dd737bd755 | ||
|
|
1cea6c73d3 | ||
|
|
25be96832a | ||
|
|
06f23aa675 | ||
|
|
0701feeb17 | ||
|
|
171c27ddf1 | ||
|
|
2f0cdcdceb | ||
|
|
423ce57cde | ||
|
|
2824940ecf | ||
|
|
f247cab5cd | ||
|
|
01c48da6ce | ||
|
|
7ee38fa3a4 | ||
|
|
bf745bdccb | ||
|
|
a0df993cef | ||
|
|
52ce8cc4f2 | ||
|
|
94883e2fad | ||
|
|
f3ab6769e9 | ||
|
|
31571dd96e | ||
|
|
b25d03340b | ||
|
|
390a724c0c | ||
|
|
921535001a | ||
|
|
6886167d5f | ||
|
|
7542fd7f4d | ||
|
|
4042fdf3bb | ||
|
|
d2acde2a61 | ||
|
|
40b0033fa7 | ||
|
|
68cf6a9229 | ||
|
|
ee5417a5b3 | ||
|
|
81cce4b4c3 | ||
|
|
a6a8892255 | ||
|
|
a93c4947ba | ||
|
|
2aa9d9f84a | ||
|
|
9b14f0c81a | ||
|
|
b5b97a4799 | ||
|
|
ed818c90a9 | ||
|
|
3639cad69c | ||
|
|
fa6fe327bf | ||
|
|
f43c6daeda | ||
|
|
c2e7d663bc | ||
|
|
fbc9f0eb64 | ||
|
|
2eda3a686f | ||
|
|
bd5c5586b5 | ||
|
|
5cba8e51c5 | ||
|
|
f2f68f675e | ||
|
|
2f4cd20f90 | ||
|
|
53513475bf | ||
|
|
f70c1e449b | ||
|
|
b20ddc57a7 | ||
|
|
b40d252761 | ||
|
|
3a6eb8ca5f | ||
|
|
728bf50a73 | ||
|
|
f53cff045f | ||
|
|
834210a9dc | ||
|
|
197ade6aeb | ||
|
|
011a41b561 | ||
|
|
9b9ab6da86 | ||
|
|
2ea18fca48 | ||
|
|
fc0a583a4d | ||
|
|
f28dbbe5c5 | ||
|
|
e2b07737da | ||
|
|
dc204dd137 | ||
|
|
23d024708d | ||
|
|
f7f2a597dd | ||
|
|
d61bea9038 | ||
|
|
3aeee3d748 | ||
|
|
8136384473 | ||
|
|
d1b2231bc8 | ||
|
|
b9ff7723dd | ||
|
|
da3d330616 | ||
|
|
0cb17b45b1 | ||
|
|
6d3db4445b | ||
|
|
f3bcbeb60a | ||
|
|
f7ee60996c | ||
|
|
6f3ec989a7 | ||
|
|
1e7fcef581 | ||
|
|
bb0b784544 | ||
|
|
b97a2cc08a | ||
|
|
bfcc9ca808 | ||
|
|
71f3046841 | ||
|
|
0ba4e4cd23 | ||
|
|
46a28b8819 | ||
|
|
ede6ce44c6 | ||
|
|
21ef152423 | ||
|
|
f3442e36e6 | ||
|
|
89cd0c27a8 | ||
|
|
318d8affa8 | ||
|
|
cf444ebd07 | ||
|
|
a07c93f4dd | ||
|
|
c7e8ac18f0 | ||
|
|
b7c992f410 | ||
|
|
f1713c96ae | ||
|
|
da76af187f | ||
|
|
6e49e75a5b | ||
|
|
f51e20028a | ||
|
|
dc0f48682c | ||
|
|
28b8974a3a | ||
|
|
a96d4254e9 | ||
|
|
6fbbc78574 | ||
|
|
784583afc6 | ||
|
|
ba14307319 | ||
|
|
fcf3714443 | ||
|
|
ca0cd81a75 | ||
|
|
80c017907b | ||
|
|
aad62ee148 | ||
|
|
554e239097 | ||
|
|
3639fedd01 | ||
|
|
63a9d8f01d | ||
|
|
de77d00c81 | ||
|
|
18543c6e8b | ||
|
|
6a698713fa | ||
|
|
09cd00f356 | ||
|
|
941ced60a4 | ||
|
|
f9d9eed0c9 | ||
|
|
d602d68fd1 | ||
|
|
706a86077d | ||
|
|
6c07af6014 | ||
|
|
c3792c8352 | ||
|
|
aa9eef81e6 | ||
|
|
fb940dd807 | ||
|
|
881a0fe806 | ||
|
|
954ad98e0d | ||
|
|
22362f6495 | ||
|
|
6e1ab97988 | ||
|
|
2112d99140 | ||
|
|
9ef5bb20f6 | ||
|
|
4ddcbaab57 | ||
|
|
551d00d51a | ||
|
|
e1d3dd5e18 | ||
|
|
82cad5e330 | ||
|
|
7b1a713d2a | ||
|
|
3a58b7bac6 | ||
|
|
708e14fcfa | ||
|
|
3345a50d9b | ||
|
|
86ce69f709 | ||
|
|
b2a148cb4c | ||
|
|
2ab0ad24a3 | ||
|
|
28b395bef4 | ||
|
|
3ad5fa6f6f | ||
|
|
fc7a4957ea | ||
|
|
72c0233938 | ||
|
|
101e6d80b0 | ||
|
|
03466f955e | ||
|
|
8080fe4cc1 | ||
|
|
e423548673 | ||
|
|
e8110bb54c | ||
|
|
202a29d014 | ||
|
|
91d6785cf3 | ||
|
|
be3fc77391 | ||
|
|
9873bae115 | ||
|
|
121b31f750 | ||
|
|
ceaf993a27 | ||
|
|
95717d1006 | ||
|
|
b05962b90e | ||
|
|
e31ec04f4f | ||
|
|
419e355e9e | ||
|
|
91f0481f4e | ||
|
|
97a4b66df7 | ||
|
|
abe7214c1f | ||
|
|
b93d57da31 | ||
|
|
3e7aa1caf5 | ||
|
|
6834df77a0 | ||
|
|
26f3ab8d4b | ||
|
|
320637dc7a | ||
|
|
c29bc9a367 | ||
|
|
da58c748bc | ||
|
|
bd092d8318 | ||
|
|
d68c27f82d | ||
|
|
8f9aa0cddd | ||
|
|
8b806fb273 | ||
|
|
d2ec62656d | ||
|
|
5f6f9e9a53 | ||
|
|
6ab09e9071 | ||
|
|
497ebbbd45 | ||
|
|
56da3494cb | ||
|
|
fa36353f45 | ||
|
|
e6126cef62 | ||
|
|
7bc67399e4 | ||
|
|
248c0c8087 | ||
|
|
4ee0a6f47b | ||
|
|
b3594278c9 | ||
|
|
61811dc2f1 | ||
|
|
daa27b2119 | ||
|
|
9014d00fd0 | ||
|
|
95eb91ed1a | ||
|
|
4c30934cd9 | ||
|
|
63062ed7f0 | ||
|
|
93e12d5f30 | ||
|
|
d62370d4e0 | ||
|
|
e8ce30fdc5 | ||
|
|
f9d33f70b0 | ||
|
|
b9cf4f12fc | ||
|
|
49b84b6e2a | ||
|
|
38dcaaa76e | ||
|
|
ca121ecd66 | ||
|
|
65a19e3abc | ||
|
|
6ac066d1dc | ||
|
|
a129bda7d9 | ||
|
|
118d0e01a8 | ||
|
|
a6bc67c34c | ||
|
|
2facd65998 | ||
|
|
1013fc90d8 | ||
|
|
22739c653a | ||
|
|
3cb19cf6db | ||
|
|
9ea09cc41c | ||
|
|
65bfeafb5a | ||
|
|
37e8fce841 | ||
|
|
d4dc00471a | ||
|
|
1560ec7e26 | ||
|
|
b394380a36 | ||
|
|
3cbce878f2 | ||
|
|
878c187916 | ||
|
|
df51e0c042 | ||
|
|
98cce6a150 | ||
|
|
aa7fc299b8 | ||
|
|
5eb3a7e466 | ||
|
|
fc3b75f2f8 | ||
|
|
b5ec346700 | ||
|
|
17ac5244c3 | ||
|
|
db7766323e | ||
|
|
222798d926 | ||
|
|
4e72863ba5 | ||
|
|
64afbc5235 | ||
|
|
4e181db21a | ||
|
|
ebc22625b4 | ||
|
|
377bf31445 | ||
|
|
e8420aaed7 | ||
|
|
d3ee621fce | ||
|
|
31252ac027 | ||
|
|
526094d2da | ||
|
|
275e9a4e86 | ||
|
|
bd032eabe7 | ||
|
|
ff666104c4 | ||
|
|
05724a68d4 | ||
|
|
4244ef8b72 | ||
|
|
b9c2bff931 | ||
|
|
a990cd29cd | ||
|
|
6a40fd1c65 | ||
|
|
305418fac5 | ||
|
|
aa13168b4d | ||
|
|
fe57a2e770 | ||
|
|
0ed76a0556 | ||
|
|
dbeeda8123 | ||
|
|
36013f63ed | ||
|
|
7286e525ad | ||
|
|
2b955c1713 | ||
|
|
6b4f455b12 | ||
|
|
f3c1e00521 | ||
|
|
bb9919b07a | ||
|
|
b92df1654c | ||
|
|
072f923a9b | ||
|
|
3d0e9e5197 | ||
|
|
417b59b893 | ||
|
|
24290fed9d | ||
|
|
6200b6abb1 | ||
|
|
6a921e15f3 | ||
|
|
f8af0f93d9 | ||
|
|
0381338d40 | ||
|
|
a1ef0e48a9 | ||
|
|
be40ff6048 | ||
|
|
3d93570979 | ||
|
|
6a42cb6b0b | ||
|
|
813b868b9a | ||
|
|
e85ca10a1a | ||
|
|
21046c6a28 | ||
|
|
a4c9223b9d | ||
|
|
c81833a192 | ||
|
|
5c48c23235 | ||
|
|
7cfbf1e85f | ||
|
|
4c75fd5f9c | ||
|
|
b0a5193e32 | ||
|
|
661a34e23d | ||
|
|
5e814afe88 | ||
|
|
724ce04b1c | ||
|
|
5a0a709016 | ||
|
|
866981d8ac | ||
|
|
72faae91e1 | ||
|
|
a10c28ba82 | ||
|
|
f4d88862c4 | ||
|
|
180445f5a8 | ||
|
|
45a0fda9bd | ||
|
|
f87da798a4 | ||
|
|
9a913457dd | ||
|
|
b6143de52a | ||
|
|
7a0c35674c | ||
|
|
c3f9d9fa2e | ||
|
|
fbe7ed7927 | ||
|
|
0c1f42f4eb | ||
|
|
439f0f834d | ||
|
|
47c04db9b3 | ||
|
|
91876bf628 | ||
|
|
7a5a717063 | ||
|
|
f955096e92 | ||
|
|
2065715712 | ||
|
|
1236efb039 | ||
|
|
eb39f78396 | ||
|
|
13cb609f60 | ||
|
|
21aaa4c1f1 | ||
|
|
13f6ec1c4e | ||
|
|
f34c2ff7c5 | ||
|
|
c8c7c10c3f | ||
|
|
0901438bd2 | ||
|
|
f18803424a | ||
|
|
51a5d731ce | ||
|
|
22a3ef56f2 | ||
|
|
9860405974 | ||
|
|
85c1615b43 | ||
|
|
a2ac540ecc | ||
|
|
7f0c793083 | ||
|
|
b1cff07ab0 | ||
|
|
81f86c381d | ||
|
|
f46763d74f | ||
|
|
ef541972f8 | ||
|
|
1b7fb3ce84 | ||
|
|
fb97e234c9 | ||
|
|
9405eaefdb | ||
|
|
fbb14e0ea8 | ||
|
|
6b17f45da2 | ||
|
|
fa0cfdfb7f | ||
|
|
433fde4b18 | ||
|
|
a23fcb9a7c | ||
|
|
247bbabda5 | ||
|
|
ced3b89395 | ||
|
|
affe3c2c12 | ||
|
|
76e297d64f | ||
|
|
d8e6bd0a94 | ||
|
|
f3364fec99 | ||
|
|
9978f54acf | ||
|
|
3f4e17aa24 | ||
|
|
6bdc274d4d | ||
|
|
6cf2e7d493 | ||
|
|
a7982bd525 | ||
|
|
b54a65ba5a | ||
|
|
6bee1e9714 | ||
|
|
7270067289 | ||
|
|
84c9bc4389 | ||
|
|
b8490fe427 | ||
|
|
b3f0f170b4 | ||
|
|
b9b684194f | ||
|
|
67e3fe996a | ||
|
|
62d815d1ca | ||
|
|
9596fce562 | ||
|
|
5c9259fa3c | ||
|
|
7328962009 | ||
|
|
c9952759c4 | ||
|
|
28efe31524 | ||
|
|
3bba2124ef | ||
|
|
520591e6ea | ||
|
|
e185d90d24 | ||
|
|
4a311c7f5e | ||
|
|
bb6854b972 | ||
|
|
2bdd737971 | ||
|
|
643bbbeb49 | ||
|
|
18ed06b420 | ||
|
|
8e80f3cd65 | ||
|
|
dde34fa99d | ||
|
|
a2aa542370 | ||
|
|
c376ccc5a5 | ||
|
|
b9ae16fbc5 | ||
|
|
1ee828b768 | ||
|
|
02d0c12cdd | ||
|
|
5dea5c0449 | ||
|
|
8aa6bf0bb9 | ||
|
|
d97bd54e63 | ||
|
|
482014f9da | ||
|
|
3b4a9addaf | ||
|
|
4acfc098e9 | ||
|
|
e71dcfb3a6 | ||
|
|
9d0f58c329 | ||
|
|
ce2049cdb6 | ||
|
|
e47f63d159 | ||
|
|
6e57d8d0de | ||
|
|
606667f205 | ||
|
|
b1063162b6 | ||
|
|
f103491912 | ||
|
|
6c7135d77e | ||
|
|
ea57654e34 | ||
|
|
7c66f3b5fb | ||
|
|
5f3784ee05 | ||
|
|
1dced26304 | ||
|
|
b3e526ba95 | ||
|
|
30b7e03920 | ||
|
|
ee03cb0aa1 | ||
|
|
77c98b657e | ||
|
|
2559d59a9d | ||
|
|
77362700e1 | ||
|
|
30406bca0f | ||
|
|
05c3c3f56b | ||
|
|
9b77f0054e | ||
|
|
ec254d8a89 | ||
|
|
9274557552 | ||
|
|
da9540e666 | ||
|
|
c87b8f4c30 | ||
|
|
e271721d4e | ||
|
|
b2acfd75e9 | ||
|
|
f4ad63528a | ||
|
|
0a3f95ca01 | ||
|
|
b068bc291d | ||
|
|
047446d5ca | ||
|
|
7bf7af971b | ||
|
|
fc22071a2f | ||
|
|
381f4e73a0 | ||
|
|
0ba88596e8 | ||
|
|
1734017ba1 | ||
|
|
da7f13e73e | ||
|
|
6c908352cb | ||
|
|
77d9993f38 | ||
|
|
f710d5ffca | ||
|
|
fc0628c038 | ||
|
|
1bd6d289d4 | ||
|
|
2bfeb5d1c8 | ||
|
|
b17c426e99 | ||
|
|
3c8b74318e | ||
|
|
8907e6a40a | ||
|
|
4cd4467179 | ||
|
|
45e9c83421 | ||
|
|
fe5b9e39cc | ||
|
|
1453263b63 | ||
|
|
e69c374956 | ||
|
|
9b954dc0d4 | ||
|
|
f2847f1266 | ||
|
|
0c75f15062 | ||
|
|
de27058d0b | ||
|
|
d400a11832 | ||
|
|
b44f05a2d0 | ||
|
|
15c01d8b7f | ||
|
|
107a4884a8 | ||
|
|
fec8428fd8 | ||
|
|
e82ad60122 | ||
|
|
caf0a3486b | ||
|
|
ea8e4ec278 | ||
|
|
edb753ab4d | ||
|
|
adfd54e7c4 | ||
|
|
6cc92817dc | ||
|
|
826a7b307e | ||
|
|
cd1ad88f30 | ||
|
|
2dcb8cb93b | ||
|
|
5bb37d5905 | ||
|
|
10ecf80ca1 | ||
|
|
dbc6ed6832 | ||
|
|
9e012001be | ||
|
|
1a7d5b5b5e | ||
|
|
01ccd6778e | ||
|
|
41daecfdca | ||
|
|
2d0ccc4d34 | ||
|
|
abe5da7d2c | ||
|
|
b8fbf19e9a | ||
|
|
6a12520a96 | ||
|
|
cbc055dc2b | ||
|
|
19555385f7 | ||
|
|
389002f195 | ||
|
|
fba1efb77a | ||
|
|
3b1dc85c6f | ||
|
|
110d5a5233 | ||
|
|
46237ea31a | ||
|
|
60dc450091 | ||
|
|
3df8f96117 | ||
|
|
67b0645808 | ||
|
|
4de060daa6 | ||
|
|
e76105e2ab | ||
|
|
a7887166cf | ||
|
|
5799a20f71 | ||
|
|
077f831749 | ||
|
|
42c849e0df | ||
|
|
9b94177380 | ||
|
|
99abddf376 | ||
|
|
c35660175d | ||
|
|
1cd3b6b4e1 | ||
|
|
10404c4275 | ||
|
|
34742be029 | ||
|
|
5c87fcc6d2 | ||
|
|
fb434318e3 | ||
|
|
5788bf2270 | ||
|
|
fcc09cef6f | ||
|
|
d156d410ef | ||
|
|
eda4c43a08 | ||
|
|
d351541757 | ||
|
|
498661e3bb | ||
|
|
9a00c17555 | ||
|
|
f7a6f6b4c0 | ||
|
|
0da2dfd640 | ||
|
|
3fd4da34a4 | ||
|
|
2422556456 | ||
|
|
6c8caea09c | ||
|
|
47c30e3add | ||
|
|
80db8b13d8 | ||
|
|
67b723f74e | ||
|
|
9f9ef1340c | ||
|
|
c935b9669e | ||
|
|
eb4ad2546f | ||
|
|
41bbf320bb | ||
|
|
982ea85d81 | ||
|
|
083d8e9ece | ||
|
|
e7a6a2733b | ||
|
|
6db49100d6 | ||
|
|
255a1c7dcd | ||
|
|
f77ca41769 | ||
|
|
1d36884845 | ||
|
|
2d1a1f5e03 | ||
|
|
7bf48ee135 | ||
|
|
6de331b014 | ||
|
|
032df784ed | ||
|
|
6ead7758ce | ||
|
|
d264f9449f | ||
|
|
083bf3a137 | ||
|
|
791ad774a2 | ||
|
|
c2aad1c7ff | ||
|
|
b541e39a2c | ||
|
|
2bc6fa90ff | ||
|
|
0ec7bc6710 | ||
|
|
4c1368d621 | ||
|
|
4e73705533 | ||
|
|
08336be92e | ||
|
|
7b78fc72b0 | ||
|
|
b7cd52636b | ||
|
|
3981d65b68 | ||
|
|
9a73319b45 | ||
|
|
b0665a15f4 | ||
|
|
dda6b90d25 | ||
|
|
4b8dcff448 | ||
|
|
b21a67bbe6 | ||
|
|
4fd29dad86 | ||
|
|
bc96682760 | ||
|
|
866c2657f0 | ||
|
|
0cb9036f66 | ||
|
|
a152f17937 | ||
|
|
85c526c583 | ||
|
|
e526a299dc | ||
|
|
182fb9e3ed | ||
|
|
5eacff9d4f | ||
|
|
50ddd8c8e2 | ||
|
|
8329cf86a7 | ||
|
|
7210558c7b | ||
|
|
c63fff9a10 | ||
|
|
bf4d7affc0 | ||
|
|
8dca561bd1 | ||
|
|
f0492ac039 | ||
|
|
d8ffeb4d0e | ||
|
|
560a057941 | ||
|
|
761ffdc405 | ||
|
|
316f326464 | ||
|
|
adfc1e0559 | ||
|
|
969f513265 | ||
|
|
ab0c6a84bf | ||
|
|
34779e8f38 | ||
|
|
c3b73ec23b | ||
|
|
7bf14452f7 | ||
|
|
94e5c0a454 | ||
|
|
a2d3f89c7b | ||
|
|
991a3dca0d | ||
|
|
4f98553ba9 | ||
|
|
2d6fcdf83a | ||
|
|
faf84d8fb6 | ||
|
|
c7abc34dbb | ||
|
|
98251fe16a | ||
|
|
40ee9b4d7b | ||
|
|
2ba08afed1 | ||
|
|
10678cde81 | ||
|
|
4ec8715f20 | ||
|
|
3ac48cd540 | ||
|
|
7f0a97c7b6 | ||
|
|
5ea9715721 | ||
|
|
df9a72b87f | ||
|
|
c7c60d1f8a | ||
|
|
e6c026db65 | ||
|
|
53e2dee177 | ||
|
|
c146c76d10 | ||
|
|
42d97a3442 | ||
|
|
488afa5002 | ||
|
|
73e3e77904 | ||
|
|
59e58c4b23 | ||
|
|
b70cb3e0b2 | ||
|
|
f7229084a9 | ||
|
|
5c3b783310 | ||
|
|
9b0da7cd7d | ||
|
|
83bffca7e6 | ||
|
|
75e4013439 | ||
|
|
ea09fb477a | ||
|
|
689f5513a9 | ||
|
|
7227cfddf5 | ||
|
|
3d7390302d | ||
|
|
2f72c24498 | ||
|
|
88ff8fc27b | ||
|
|
bea26549f2 | ||
|
|
ce2af0082e | ||
|
|
1c9f3c7ac0 | ||
|
|
96c66ca2aa | ||
|
|
f3a334965d | ||
|
|
9ccfc1cfee | ||
|
|
71a94267c9 | ||
|
|
ad16221a35 | ||
|
|
cf1586a34d | ||
|
|
3a19eea97c | ||
|
|
e87f276cf6 | ||
|
|
8805c04128 | ||
|
|
6f95c06bd5 | ||
|
|
ec03f22cc3 | ||
|
|
220797bd71 | ||
|
|
aa1ef02984 | ||
|
|
da1c755f6a | ||
|
|
6c27845be0 | ||
|
|
9e2ae3f3b2 | ||
|
|
01558a0bd5 | ||
|
|
f3c789d662 | ||
|
|
9eebe9b95e | ||
|
|
40abae7caa | ||
|
|
3d87aa767d | ||
|
|
a0ef6e3611 | ||
|
|
791aa3cb44 | ||
|
|
320a08f250 | ||
|
|
34240606f7 | ||
|
|
b5389c3b23 | ||
|
|
9e3060bb13 | ||
|
|
6999325d36 | ||
|
|
ee90edd0e3 | ||
|
|
0548ed3a1b | ||
|
|
1de733fda5 | ||
|
|
27c05f8c0b | ||
|
|
97ad3e9d02 | ||
|
|
ff26e64648 | ||
|
|
302738ee74 | ||
|
|
9524b08bec | ||
|
|
aabea37af1 |
No files matched your search
@@ -0,0 +1,4 @@
|
|||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
github: chrislusf
|
||||||
|
patreon: seaweedfs
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
|
- package-ecosystem: gomod
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
@@ -4,15 +4,20 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
permissions:
|
||||||
|
contents: write # for mknejp/delete-release-assets to delete release assets
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Delete old release assets
|
- name: Delete old release assets
|
||||||
uses: mknejp/delete-release-assets@v1
|
uses: mknejp/delete-release-assets@a8aaab13272b1eaac16cc46dddd3f725b97ee05a # v1
|
||||||
with:
|
with:
|
||||||
token: ${{ github.token }}
|
token: ${{ github.token }}
|
||||||
tag: dev
|
tag: dev
|
||||||
@@ -20,24 +25,26 @@ jobs:
|
|||||||
assets: |
|
assets: |
|
||||||
weed-*
|
weed-*
|
||||||
|
|
||||||
build_dev_linux:
|
build_dev_linux_windows:
|
||||||
|
permissions:
|
||||||
|
contents: write # for wangyoucao577/go-release-action to upload release assets
|
||||||
needs: cleanup
|
needs: cleanup
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
goos: [linux]
|
goos: [linux, windows]
|
||||||
goarch: [amd64]
|
goarch: [amd64]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
|
||||||
|
|
||||||
- name: Set BUILD_TIME env
|
- name: Set BUILD_TIME env
|
||||||
run: echo BUILD_TIME=$(date -u +%Y%m%d-%H%M) >> ${GITHUB_ENV}
|
run: echo BUILD_TIME=$(date -u +%Y%m%d-%H%M) >> ${GITHUB_ENV}
|
||||||
|
|
||||||
- name: Go Release Binaries Large Disk
|
- name: Go Release Binaries Large Disk
|
||||||
uses: wangyoucao577/go-release-action@bugfix/upload-fail
|
uses: wangyoucao577/go-release-action@16624612d4e2b73de613857a362d294700207fff # v1.22
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
goos: ${{ matrix.goos }}
|
goos: ${{ matrix.goos }}
|
||||||
@@ -53,7 +60,7 @@ jobs:
|
|||||||
asset_name: "weed-large-disk-${{ env.BUILD_TIME }}-${{ matrix.goos }}-${{ matrix.goarch }}"
|
asset_name: "weed-large-disk-${{ env.BUILD_TIME }}-${{ matrix.goos }}-${{ matrix.goarch }}"
|
||||||
|
|
||||||
- name: Go Release Binaries Normal Volume Size
|
- name: Go Release Binaries Normal Volume Size
|
||||||
uses: wangyoucao577/go-release-action@bugfix/upload-fail
|
uses: wangyoucao577/go-release-action@16624612d4e2b73de613857a362d294700207fff # v1.22
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
goos: ${{ matrix.goos }}
|
goos: ${{ matrix.goos }}
|
||||||
@@ -68,7 +75,9 @@ jobs:
|
|||||||
asset_name: "weed-${{ env.BUILD_TIME }}-${{ matrix.goos }}-${{ matrix.goarch }}"
|
asset_name: "weed-${{ env.BUILD_TIME }}-${{ matrix.goos }}-${{ matrix.goarch }}"
|
||||||
|
|
||||||
build_dev_darwin:
|
build_dev_darwin:
|
||||||
needs: build_dev_linux
|
permissions:
|
||||||
|
contents: write # for wangyoucao577/go-release-action to upload release assets
|
||||||
|
needs: build_dev_linux_windows
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@@ -78,13 +87,13 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
|
||||||
|
|
||||||
- name: Set BUILD_TIME env
|
- name: Set BUILD_TIME env
|
||||||
run: echo BUILD_TIME=$(date -u +%Y%m%d-%H%M) >> ${GITHUB_ENV}
|
run: echo BUILD_TIME=$(date -u +%Y%m%d-%H%M) >> ${GITHUB_ENV}
|
||||||
|
|
||||||
- name: Go Release Binaries Large Disk
|
- name: Go Release Binaries Large Disk
|
||||||
uses: wangyoucao577/go-release-action@bugfix/upload-fail
|
uses: wangyoucao577/go-release-action@16624612d4e2b73de613857a362d294700207fff # v1.22
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
goos: ${{ matrix.goos }}
|
goos: ${{ matrix.goos }}
|
||||||
@@ -100,7 +109,7 @@ jobs:
|
|||||||
asset_name: "weed-large-disk-${{ env.BUILD_TIME }}-${{ matrix.goos }}-${{ matrix.goarch }}"
|
asset_name: "weed-large-disk-${{ env.BUILD_TIME }}-${{ matrix.goos }}-${{ matrix.goarch }}"
|
||||||
|
|
||||||
- name: Go Release Binaries Normal Volume Size
|
- name: Go Release Binaries Normal Volume Size
|
||||||
uses: wangyoucao577/go-release-action@bugfix/upload-fail
|
uses: wangyoucao577/go-release-action@16624612d4e2b73de613857a362d294700207fff # v1.22
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
goos: ${{ matrix.goos }}
|
goos: ${{ matrix.goos }}
|
||||||
|
|||||||
@@ -11,9 +11,14 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build-release-binaries_windows:
|
build-release-binaries_windows:
|
||||||
|
permissions:
|
||||||
|
contents: write # for wangyoucao577/go-release-action to upload release assets
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@@ -23,9 +28,9 @@ jobs:
|
|||||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||||
steps:
|
steps:
|
||||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
|
||||||
- name: Go Release Binaries Normal Volume Size
|
- name: Go Release Binaries Normal Volume Size
|
||||||
uses: wangyoucao577/go-release-action@v1.20
|
uses: wangyoucao577/go-release-action@16624612d4e2b73de613857a362d294700207fff # v1.22
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
goos: ${{ matrix.goos }}
|
goos: ${{ matrix.goos }}
|
||||||
@@ -39,7 +44,7 @@ jobs:
|
|||||||
binary_name: weed
|
binary_name: weed
|
||||||
asset_name: "${{ matrix.goos }}_${{ matrix.goarch }}"
|
asset_name: "${{ matrix.goos }}_${{ matrix.goarch }}"
|
||||||
- name: Go Release Large Disk Binaries
|
- name: Go Release Large Disk Binaries
|
||||||
uses: wangyoucao577/go-release-action@v1.20
|
uses: wangyoucao577/go-release-action@16624612d4e2b73de613857a362d294700207fff # v1.22
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
goos: ${{ matrix.goos }}
|
goos: ${{ matrix.goos }}
|
||||||
|
|||||||
@@ -11,9 +11,14 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build-release-binaries_linux:
|
build-release-binaries_linux:
|
||||||
|
permissions:
|
||||||
|
contents: write # for wangyoucao577/go-release-action to upload release assets
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@@ -23,9 +28,9 @@ jobs:
|
|||||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||||
steps:
|
steps:
|
||||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
|
||||||
- name: Go Release Binaries Normal Volume Size
|
- name: Go Release Binaries Normal Volume Size
|
||||||
uses: wangyoucao577/go-release-action@v1.20
|
uses: wangyoucao577/go-release-action@16624612d4e2b73de613857a362d294700207fff # v1.22
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
goos: ${{ matrix.goos }}
|
goos: ${{ matrix.goos }}
|
||||||
@@ -39,7 +44,7 @@ jobs:
|
|||||||
binary_name: weed
|
binary_name: weed
|
||||||
asset_name: "${{ matrix.goos }}_${{ matrix.goarch }}"
|
asset_name: "${{ matrix.goos }}_${{ matrix.goarch }}"
|
||||||
- name: Go Release Large Disk Binaries
|
- name: Go Release Large Disk Binaries
|
||||||
uses: wangyoucao577/go-release-action@v1.20
|
uses: wangyoucao577/go-release-action@16624612d4e2b73de613857a362d294700207fff # v1.22
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
goos: ${{ matrix.goos }}
|
goos: ${{ matrix.goos }}
|
||||||
|
|||||||
@@ -11,9 +11,14 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build-release-binaries_darwin:
|
build-release-binaries_darwin:
|
||||||
|
permissions:
|
||||||
|
contents: write # for wangyoucao577/go-release-action to upload release assets
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@@ -23,9 +28,9 @@ jobs:
|
|||||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||||
steps:
|
steps:
|
||||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
|
||||||
- name: Go Release Binaries Normal Volume Size
|
- name: Go Release Binaries Normal Volume Size
|
||||||
uses: wangyoucao577/go-release-action@v1.20
|
uses: wangyoucao577/go-release-action@16624612d4e2b73de613857a362d294700207fff # v1.22
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
goos: ${{ matrix.goos }}
|
goos: ${{ matrix.goos }}
|
||||||
@@ -39,7 +44,7 @@ jobs:
|
|||||||
binary_name: weed
|
binary_name: weed
|
||||||
asset_name: "${{ matrix.goos }}_${{ matrix.goarch }}"
|
asset_name: "${{ matrix.goos }}_${{ matrix.goarch }}"
|
||||||
- name: Go Release Large Disk Binaries
|
- name: Go Release Large Disk Binaries
|
||||||
uses: wangyoucao577/go-release-action@v1.20
|
uses: wangyoucao577/go-release-action@16624612d4e2b73de613857a362d294700207fff # v1.22
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
goos: ${{ matrix.goos }}
|
goos: ${{ matrix.goos }}
|
||||||
|
|||||||
@@ -11,9 +11,14 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build-release-binaries_freebsd:
|
build-release-binaries_freebsd:
|
||||||
|
permissions:
|
||||||
|
contents: write # for wangyoucao577/go-release-action to upload release assets
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@@ -23,9 +28,9 @@ jobs:
|
|||||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||||
steps:
|
steps:
|
||||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
|
||||||
- name: Go Release Binaries Normal Volume Size
|
- name: Go Release Binaries Normal Volume Size
|
||||||
uses: wangyoucao577/go-release-action@v1.20
|
uses: wangyoucao577/go-release-action@16624612d4e2b73de613857a362d294700207fff # v1.22
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
goos: ${{ matrix.goos }}
|
goos: ${{ matrix.goos }}
|
||||||
@@ -39,7 +44,7 @@ jobs:
|
|||||||
binary_name: weed
|
binary_name: weed
|
||||||
asset_name: "${{ matrix.goos }}_${{ matrix.goarch }}"
|
asset_name: "${{ matrix.goos }}_${{ matrix.goarch }}"
|
||||||
- name: Go Release Large Disk Binaries
|
- name: Go Release Large Disk Binaries
|
||||||
uses: wangyoucao577/go-release-action@v1.20
|
uses: wangyoucao577/go-release-action@16624612d4e2b73de613857a362d294700207fff # v1.22
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
goos: ${{ matrix.goos }}
|
goos: ${{ matrix.goos }}
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ on:
|
|||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
workflow_dispatch: []
|
workflow_dispatch: []
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build-dev-containers:
|
build-dev-containers:
|
||||||
@@ -13,11 +16,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: docker_meta
|
id: docker_meta
|
||||||
uses: docker/metadata-action@v3
|
uses: docker/metadata-action@b2391d37b4157fa4aa2e118d643f417910ff3242 # v3
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
chrislusf/seaweedfs
|
chrislusf/seaweedfs
|
||||||
@@ -30,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@v1
|
uses: docker/setup-qemu-action@27d0a4f181a40b142cce983c5393082c365d1480 # v1
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@f211e3e9ded2d9377c8cadc4489a4e38014bc4c9 # 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@v1
|
uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7 # 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@v1
|
uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7 # 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@v2
|
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a # v2
|
||||||
with:
|
with:
|
||||||
context: ./docker
|
context: ./docker
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ on:
|
|||||||
- '*'
|
- '*'
|
||||||
workflow_dispatch: []
|
workflow_dispatch: []
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build-latest-container:
|
build-latest-container:
|
||||||
@@ -14,11 +17,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: docker_meta
|
id: docker_meta
|
||||||
uses: docker/metadata-action@v3
|
uses: docker/metadata-action@b2391d37b4157fa4aa2e118d643f417910ff3242 # v3
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
chrislusf/seaweedfs
|
chrislusf/seaweedfs
|
||||||
@@ -31,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@v1
|
uses: docker/setup-qemu-action@27d0a4f181a40b142cce983c5393082c365d1480 # v1
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@f211e3e9ded2d9377c8cadc4489a4e38014bc4c9 # 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@v1
|
uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7 # 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@v1
|
uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7 # 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@v2
|
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a # v2
|
||||||
with:
|
with:
|
||||||
context: ./docker
|
context: ./docker
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ on:
|
|||||||
- '*'
|
- '*'
|
||||||
workflow_dispatch: []
|
workflow_dispatch: []
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-default-release-container:
|
build-default-release-container:
|
||||||
runs-on: [ubuntu-latest]
|
runs-on: [ubuntu-latest]
|
||||||
@@ -13,11 +16,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: docker_meta
|
id: docker_meta
|
||||||
uses: docker/metadata-action@v3
|
uses: docker/metadata-action@b2391d37b4157fa4aa2e118d643f417910ff3242 # v3
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
chrislusf/seaweedfs
|
chrislusf/seaweedfs
|
||||||
@@ -31,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@v1
|
uses: docker/setup-qemu-action@27d0a4f181a40b142cce983c5393082c365d1480 # v1
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@f211e3e9ded2d9377c8cadc4489a4e38014bc4c9 # 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@v1
|
uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7 # 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@v2
|
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a # v2
|
||||||
with:
|
with:
|
||||||
context: ./docker
|
context: ./docker
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ on:
|
|||||||
- '*'
|
- '*'
|
||||||
workflow_dispatch: []
|
workflow_dispatch: []
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build-large-release-container:
|
build-large-release-container:
|
||||||
@@ -14,11 +17,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: docker_meta
|
id: docker_meta
|
||||||
uses: docker/metadata-action@v3
|
uses: docker/metadata-action@b2391d37b4157fa4aa2e118d643f417910ff3242 # v3
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
chrislusf/seaweedfs
|
chrislusf/seaweedfs
|
||||||
@@ -32,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@v1
|
uses: docker/setup-qemu-action@27d0a4f181a40b142cce983c5393082c365d1480 # v1
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@f211e3e9ded2d9377c8cadc4489a4e38014bc4c9 # 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@v1
|
uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7 # 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@v2
|
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a # v2
|
||||||
with:
|
with:
|
||||||
context: ./docker
|
context: ./docker
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ on:
|
|||||||
- '*'
|
- '*'
|
||||||
workflow_dispatch: []
|
workflow_dispatch: []
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build-large-release-container_rocksdb:
|
build-large-release-container_rocksdb:
|
||||||
@@ -14,11 +17,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: docker_meta
|
id: docker_meta
|
||||||
uses: docker/metadata-action@v3
|
uses: docker/metadata-action@b2391d37b4157fa4aa2e118d643f417910ff3242 # v3
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
chrislusf/seaweedfs
|
chrislusf/seaweedfs
|
||||||
@@ -32,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@v1
|
uses: docker/setup-qemu-action@27d0a4f181a40b142cce983c5393082c365d1480 # v1
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@f211e3e9ded2d9377c8cadc4489a4e38014bc4c9 # 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@v1
|
uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7 # 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@v2
|
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a # v2
|
||||||
with:
|
with:
|
||||||
context: ./docker
|
context: ./docker
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
|||||||
@@ -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@3f943b86c9a289f4e632c632695e2e0898d9d67d
|
||||||
@@ -10,6 +10,9 @@ concurrency:
|
|||||||
group: ${{ github.head_ref }}/go
|
group: ${{ github.head_ref }}/go
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
@@ -18,24 +21,20 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Set up Go 1.x
|
- name: Set up Go 1.x
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v2
|
||||||
with:
|
with:
|
||||||
go-version: ^1.13
|
go-version: ^1.13
|
||||||
id: go
|
id: go
|
||||||
|
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
|
||||||
|
|
||||||
- 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 hdfs ydb" -v .
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: cd weed; go test -v ./...
|
run: cd weed; go test -tags "elastic gocdk sqlite hdfs ydb" -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,11 @@
|
|||||||
|
BINARY = weed
|
||||||
|
|
||||||
|
SOURCE_DIR = .
|
||||||
|
|
||||||
|
all: install
|
||||||
|
|
||||||
|
install:
|
||||||
|
cd weed; go install
|
||||||
|
|
||||||
|
full_install:
|
||||||
|
cd weed; go install -tags "elastic gocdk sqlite hdfs ydb"
|
||||||
@@ -33,7 +33,7 @@ Your support will be really appreciated by me and other supporters!
|
|||||||
|
|
||||||
|
|
||||||
### Gold Sponsors
|
### Gold Sponsors
|
||||||

|
- [](https://www.nodion.com)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -41,6 +41,8 @@ Your support will be really appreciated by me and other supporters!
|
|||||||
- [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 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)
|
||||||
@@ -51,6 +53,9 @@ 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 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)
|
||||||
@@ -73,12 +78,15 @@ Table of Contents
|
|||||||
|
|
||||||
`docker run -p 8333:8333 chrislusf/seaweedfs server -s3`
|
`docker run -p 8333:8333 chrislusf/seaweedfs server -s3`
|
||||||
|
|
||||||
## Quick Start with single binary ##
|
## Quick Start with Single Binary ##
|
||||||
* Download the latest binary from https://github.com/chrislusf/seaweedfs/releases and unzip a single binary file `weed` or `weed.exe`
|
* Download the latest binary from https://github.com/chrislusf/seaweedfs/releases and unzip a single binary file `weed` or `weed.exe`
|
||||||
* Run `weed server -dir=/some/data/dir -s3` to start one master, one volume server, one filer, and one S3 gateway.
|
* Run `weed server -dir=/some/data/dir -s3` to start one master, one volume server, one filer, and one S3 gateway.
|
||||||
|
|
||||||
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:
|
||||||
@@ -102,7 +110,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,
|
||||||
@@ -404,7 +412,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 stores, e.g., Redis, Cassandra, HBase, Mongodb, Elastic Search, MySql, Postgres, Sqlite, MemSql, TiDB, CockroachDB, Etcd, YDB etc, and is easy to customized.
|
||||||
* 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 |
|
||||||
@@ -446,7 +454,7 @@ Ceph uses CRUSH hashing to automatically manage the data placement, which is eff
|
|||||||
|
|
||||||
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 |
|
||||||
| ------------- | ------------- | ---------------- |
|
| ------------- | ------------- | ---------------- |
|
||||||
@@ -501,7 +509,7 @@ git clone https://github.com/chrislusf/seaweedfs.git
|
|||||||
Step 3: download, compile, and install the project by executing the following command
|
Step 3: download, compile, and install the project by executing the following command
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
make install
|
cd seaweedfs/weed && make install
|
||||||
```
|
```
|
||||||
|
|
||||||
Once this is done, you will find the executable "weed" in your `$GOPATH/bin` directory
|
Once this is done, you will find the executable "weed" in your `$GOPATH/bin` directory
|
||||||
|
|||||||
@@ -1,57 +0,0 @@
|
|||||||
FROM alpine
|
|
||||||
|
|
||||||
# 'latest' or 'dev'
|
|
||||||
ARG RELEASE=latest
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
ARCH=$(if [ $(uname -m) == "x86_64" ] && [ $(getconf LONG_BIT) == "64" ]; then echo "amd64"; \
|
|
||||||
elif [ $(uname -m) == "x86_64" ] && [ $(getconf LONG_BIT) == "32" ]; then echo "386"; \
|
|
||||||
elif [ $(uname -m) == "aarch64" ]; then echo "arm64"; \
|
|
||||||
elif [ $(uname -m) == "armv7l" ]; then echo "arm"; \
|
|
||||||
elif [ $(uname -m) == "armv6l" ]; then echo "arm"; \
|
|
||||||
elif [ $(uname -m) == "s390x" ]; then echo "s390x"; \
|
|
||||||
elif [ $(uname -m) == "ppc64le" ]; then echo "ppc64le"; fi;) && \
|
|
||||||
echo "Building for $ARCH" 1>&2 && \
|
|
||||||
SUPERCRONIC_SHA1SUM=$(echo $ARCH | sed 's/386/e0126b0102b9f388ecd55714358e3ad60d0cebdb/g' | sed 's/amd64/5ddf8ea26b56d4a7ff6faecdd8966610d5cb9d85/g' | sed 's/arm64/e2714c43e7781bf1579c85aa61259245f56dbba1/g' | sed 's/arm/47481c3341bc3a1ae91a728e0cc63c8e6d3791ad/g') && \
|
|
||||||
SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.9/supercronic-linux-$ARCH && \
|
|
||||||
SUPERCRONIC=supercronic-linux-$ARCH && \
|
|
||||||
# Install SeaweedFS and Supercronic ( for cron job mode )
|
|
||||||
apk add --no-cache --virtual build-dependencies --update wget curl ca-certificates && \
|
|
||||||
apk add fuse && \
|
|
||||||
wget -P /tmp https://github.com/$(curl -s -L https://github.com/chrislusf/seaweedfs/releases/${RELEASE} | egrep -o "chrislusf/seaweedfs/releases/download/.*/linux_$ARCH.tar.gz" | head -n 1) && \
|
|
||||||
tar -C /usr/bin/ -xzvf /tmp/linux_$ARCH.tar.gz && \
|
|
||||||
curl -fsSLO "$SUPERCRONIC_URL" && \
|
|
||||||
echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - && \
|
|
||||||
chmod +x "$SUPERCRONIC" && \
|
|
||||||
mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" && \
|
|
||||||
ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic && \
|
|
||||||
apk del build-dependencies && \
|
|
||||||
rm -rf /tmp/*
|
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
COPY filer.toml /etc/seaweedfs/filer.toml
|
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
|
||||||
RUN chmod +x /entrypoint.sh
|
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
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
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
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
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
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 v6.22.1
|
ENV ROCKSDB_VERSION v7.0.4
|
||||||
|
|
||||||
# build RocksDB
|
# build RocksDB
|
||||||
RUN cd /tmp && \
|
RUN cd /tmp && \
|
||||||
git clone https://github.com/facebook/rocksdb.git /tmp/rocksdb --depth 1 --single-branch --branch $ROCKSDB_VERSION && \
|
git clone https://github.com/facebook/rocksdb.git /tmp/rocksdb --depth 1 --single-branch --branch $ROCKSDB_VERSION && \
|
||||||
cd rocksdb && \
|
cd rocksdb && \
|
||||||
make static_lib && \
|
PORTABLE=1 make static_lib && \
|
||||||
make install-static
|
make install-static
|
||||||
|
|
||||||
ENV CGO_CFLAGS "-I/tmp/rocksdb/include"
|
ENV CGO_CFLAGS "-I/tmp/rocksdb/include"
|
||||||
@@ -29,7 +29,7 @@ FROM alpine AS final
|
|||||||
LABEL author="Chris Lu"
|
LABEL author="Chris Lu"
|
||||||
COPY --from=builder /go/bin/weed /usr/bin/
|
COPY --from=builder /go/bin/weed /usr/bin/
|
||||||
RUN mkdir -p /etc/seaweedfs
|
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/filer_rocksdb.toml /etc/seaweedfs/filer.toml
|
||||||
COPY --from=builder /go/src/github.com/chrislusf/seaweedfs/docker/entrypoint.sh /entrypoint.sh
|
COPY --from=builder /go/src/github.com/chrislusf/seaweedfs/docker/entrypoint.sh /entrypoint.sh
|
||||||
RUN apk add fuse snappy gflags
|
RUN apk add fuse snappy gflags
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ EXPOSE 8333
|
|||||||
# webdav server http port
|
# webdav server http port
|
||||||
EXPOSE 7333
|
EXPOSE 7333
|
||||||
|
|
||||||
RUN mkdir -p /data/filerldb2
|
RUN mkdir -p /data/filer_rocksdb
|
||||||
|
|
||||||
VOLUME /data
|
VOLUME /data
|
||||||
|
|
||||||
|
|||||||
+16
-1
@@ -46,18 +46,33 @@ dev_registry: build
|
|||||||
dev_replicate: build
|
dev_replicate: build
|
||||||
docker-compose -f compose/local-replicate-compose.yml -p seaweedfs up
|
docker-compose -f compose/local-replicate-compose.yml -p seaweedfs up
|
||||||
|
|
||||||
|
dev_auditlog: build
|
||||||
|
docker-compose -f compose/local-auditlog-compose.yml -p seaweedfs up
|
||||||
|
|
||||||
|
dev_ydb: build
|
||||||
|
docker-compose -f compose/local-ydb-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
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm ./weed
|
rm ./weed
|
||||||
|
|
||||||
@@ -71,4 +86,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
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"fluent_port": 24224,
|
||||||
|
"fluent_host": "fluent"
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
version: '2'
|
||||||
|
|
||||||
|
services:
|
||||||
|
s3:
|
||||||
|
image: chrislusf/seaweedfs:local
|
||||||
|
ports:
|
||||||
|
- 8333:8333
|
||||||
|
- 9333:9333
|
||||||
|
- 19333:19333
|
||||||
|
- 8084:8080
|
||||||
|
- 18084:18080
|
||||||
|
- 8888:8888
|
||||||
|
- 18888:18888
|
||||||
|
- 8000:8000
|
||||||
|
command: "server -ip=s3 -filer -s3 -s3.config=/etc/seaweedfs/s3.json -s3.port=8000 -s3.auditLogConfig=/etc/seaweedfs/fluent.json -volume.max=0 -master.volumeSizeLimitMB=8 -volume.preStopSeconds=1"
|
||||||
|
volumes:
|
||||||
|
- ./fluent.json:/etc/seaweedfs/fluent.json
|
||||||
|
- ./s3.json:/etc/seaweedfs/s3.json
|
||||||
|
depends_on:
|
||||||
|
- fluent
|
||||||
|
fluent:
|
||||||
|
image: fluent/fluentd:v1.14
|
||||||
|
ports:
|
||||||
|
- 24224:24224
|
||||||
|
#s3tests:
|
||||||
|
# image: chrislusf/ceph-s3-tests:local
|
||||||
|
# volumes:
|
||||||
|
# - ./s3tests.conf:/opt/s3-tests/s3tests.conf
|
||||||
|
# environment:
|
||||||
|
# S3TEST_CONF: "s3tests.conf"
|
||||||
|
# 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_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_notexist|bucketv2_notexist|bucket_delete_nonempty|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|multipart_upload_incorrect_etag|100_continue|ranged_request_invalid_range|ranged_request_empty_object|access_bucket)"
|
||||||
|
# depends_on:
|
||||||
|
# - s3
|
||||||
|
# - fluent
|
||||||
@@ -36,7 +36,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 8080:8080
|
- 8080:8080
|
||||||
- 18080:18080
|
- 18080:18080
|
||||||
command: 'volume -dataCenter dc1 -rack v1 -mserver="master0:9333,master1:9334,master2:9335" -port=8080 -ip=volume1 -publicUrl=localhost:8080 -preStopSeconds=1'
|
command: 'volume -dataCenter=dc1 -rack=v1 -mserver="master0:9333,master1:9334,master2:9335" -port=8080 -ip=volume1 -publicUrl=localhost:8080 -preStopSeconds=1'
|
||||||
depends_on:
|
depends_on:
|
||||||
- master0
|
- master0
|
||||||
- master1
|
- master1
|
||||||
@@ -46,7 +46,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 8082:8082
|
- 8082:8082
|
||||||
- 18082:18082
|
- 18082:18082
|
||||||
command: 'volume -dataCenter dc2 -rack v2 -mserver="master0:9333,master1:9334,master2:9335" -port=8082 -ip=volume2 -publicUrl=localhost:8082 -preStopSeconds=1'
|
command: 'volume -dataCenter=dc2 -rack=v2 -mserver="master0:9333,master1:9334,master2:9335" -port=8082 -ip=volume2 -publicUrl=localhost:8082 -preStopSeconds=1'
|
||||||
depends_on:
|
depends_on:
|
||||||
- master0
|
- master0
|
||||||
- master1
|
- master1
|
||||||
@@ -56,7 +56,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 8083:8083
|
- 8083:8083
|
||||||
- 18083:18083
|
- 18083:18083
|
||||||
command: 'volume -dataCenter dc3 -rack v3 -mserver="master0:9333,master1:9334,master2:9335" -port=8083 -ip=volume3 -publicUrl=localhost:8083 -preStopSeconds=1'
|
command: 'volume -dataCenter=dc3 -rack=v3 -mserver="master0:9333,master1:9334,master2:9335" -port=8083 -ip=volume3 -publicUrl=localhost:8083 -preStopSeconds=1'
|
||||||
depends_on:
|
depends_on:
|
||||||
- master0
|
- master0
|
||||||
- master1
|
- master1
|
||||||
@@ -67,7 +67,7 @@ services:
|
|||||||
- 8888:8888
|
- 8888:8888
|
||||||
- 18888:18888
|
- 18888:18888
|
||||||
- 8111:8111
|
- 8111:8111
|
||||||
command: 'filer -defaultReplicaPlacement 100 -iam -master="master0:9333,master1:9334,master2:9335"'
|
command: 'filer -defaultReplicaPlacement=100 -iam -master="master0:9333,master1:9334,master2:9335"'
|
||||||
depends_on:
|
depends_on:
|
||||||
- master0
|
- master0
|
||||||
- master1
|
- master1
|
||||||
@@ -85,4 +85,4 @@ services:
|
|||||||
- master2
|
- master2
|
||||||
- volume1
|
- volume1
|
||||||
- volume2
|
- volume2
|
||||||
- filer
|
- filer
|
||||||
@@ -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
|
||||||
@@ -24,7 +24,7 @@ services:
|
|||||||
- 8888:8888
|
- 8888:8888
|
||||||
- 18888:18888
|
- 18888:18888
|
||||||
- 8000:8000
|
- 8000:8000
|
||||||
command: 'filer -master="master:9333" -s3 -s3.config=/etc/seaweedfs/s3.json -s3.port=8000'
|
command: 'filer -master="master:9333" -s3 -s3.config=/etc/seaweedfs/s3.json -s3.port=8000 -s3.allowEmptyFolder=false -s3.allowDeleteBucketNotEmpty=false'
|
||||||
volumes:
|
volumes:
|
||||||
- ./s3.json:/etc/seaweedfs/s3.json
|
- ./s3.json:/etc/seaweedfs/s3.json
|
||||||
depends_on:
|
depends_on:
|
||||||
@@ -38,7 +38,7 @@ services:
|
|||||||
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: "!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_EXCLUDE: "(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_notexist|bucketv2_notexist|bucket_delete_nonempty|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|multipart_upload_incorrect_etag|100_continue|ranged_request_invalid_range|ranged_request_empty_object|access_bucket)"
|
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)"
|
||||||
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"
|
||||||
@@ -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
|
||||||
|
- 8084:8080
|
||||||
|
- 18084:18080
|
||||||
|
- 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
|
||||||
@@ -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
|
||||||
+5
-15
@@ -24,7 +24,7 @@ case "$1" in
|
|||||||
'master')
|
'master')
|
||||||
ARGS="-mdir=/data -volumePreallocate -volumeSizeLimitMB=1024"
|
ARGS="-mdir=/data -volumePreallocate -volumeSizeLimitMB=1024"
|
||||||
shift
|
shift
|
||||||
exec /usr/bin/weed master $ARGS $@
|
exec /usr/bin/weed -logtostderr=true master $ARGS $@
|
||||||
;;
|
;;
|
||||||
|
|
||||||
'volume')
|
'volume')
|
||||||
@@ -33,7 +33,7 @@ case "$1" in
|
|||||||
ARGS="-dir=/data"
|
ARGS="-dir=/data"
|
||||||
fi
|
fi
|
||||||
shift
|
shift
|
||||||
exec /usr/bin/weed volume $ARGS $@
|
exec /usr/bin/weed -logtostderr=true volume $ARGS $@
|
||||||
;;
|
;;
|
||||||
|
|
||||||
'server')
|
'server')
|
||||||
@@ -42,31 +42,21 @@ case "$1" in
|
|||||||
ARGS="-dir=/data -master.volumePreallocate -master.volumeSizeLimitMB=1024"
|
ARGS="-dir=/data -master.volumePreallocate -master.volumeSizeLimitMB=1024"
|
||||||
fi
|
fi
|
||||||
shift
|
shift
|
||||||
exec /usr/bin/weed server $ARGS $@
|
exec /usr/bin/weed -logtostderr=true server $ARGS $@
|
||||||
;;
|
;;
|
||||||
|
|
||||||
'filer')
|
'filer')
|
||||||
ARGS=""
|
ARGS=""
|
||||||
shift
|
shift
|
||||||
exec /usr/bin/weed filer $ARGS $@
|
exec /usr/bin/weed -logtostderr=true filer $ARGS $@
|
||||||
;;
|
;;
|
||||||
|
|
||||||
's3')
|
's3')
|
||||||
ARGS="-domainName=$S3_DOMAIN_NAME -key.file=$S3_KEY_FILE -cert.file=$S3_CERT_FILE"
|
ARGS="-domainName=$S3_DOMAIN_NAME -key.file=$S3_KEY_FILE -cert.file=$S3_CERT_FILE"
|
||||||
shift
|
shift
|
||||||
exec /usr/bin/weed s3 $ARGS $@
|
exec /usr/bin/weed -logtostderr=true s3 $ARGS $@
|
||||||
;;
|
;;
|
||||||
|
|
||||||
'cronjob')
|
|
||||||
MASTER=${WEED_MASTER-localhost:9333}
|
|
||||||
FIX_REPLICATION_CRON_SCHEDULE=${CRON_SCHEDULE-*/7 * * * * *}
|
|
||||||
echo "$FIX_REPLICATION_CRON_SCHEDULE" 'echo "lock; volume.fix.replication; unlock" | weed shell -master='$MASTER > /crontab
|
|
||||||
BALANCING_CRON_SCHEDULE=${CRON_SCHEDULE-25 * * * * *}
|
|
||||||
echo "$BALANCING_CRON_SCHEDULE" 'echo "lock; volume.balance -collection ALL_COLLECTIONS -force; unlock" | weed shell -master='$MASTER >> /crontab
|
|
||||||
echo "Running Crontab:"
|
|
||||||
cat /crontab
|
|
||||||
exec supercronic /crontab
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
exec /usr/bin/weed $@
|
exec /usr/bin/weed $@
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
[rocksdb]
|
||||||
|
enabled = true
|
||||||
|
dir = "/data/filer_rocksdb"
|
||||||
@@ -6,14 +6,14 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 9333:9333
|
- 9333:9333
|
||||||
- 19333:19333
|
- 19333:19333
|
||||||
command: "master -ip=master"
|
command: "master -ip=master -ip.bind=0.0.0.0"
|
||||||
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,28 +22,18 @@ 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:
|
||||||
- master
|
- master
|
||||||
- volume
|
- volume
|
||||||
cronjob:
|
|
||||||
image: chrislusf/seaweedfs # use a remote image
|
|
||||||
command: 'cronjob'
|
|
||||||
environment:
|
|
||||||
# Run re-replication every 2 minutes
|
|
||||||
CRON_SCHEDULE: '*/2 * * * * *' # Default: '*/5 * * * * *'
|
|
||||||
WEED_MASTER: master:9333 # Default: localhost:9333
|
|
||||||
depends_on:
|
|
||||||
- master
|
|
||||||
- volume
|
|
||||||
s3:
|
s3:
|
||||||
image: chrislusf/seaweedfs # use a remote image
|
image: chrislusf/seaweedfs # use a remote image
|
||||||
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
|
||||||
|
|||||||
@@ -1,24 +1,23 @@
|
|||||||
module github.com/chrislusf/seaweedfs
|
module github.com/chrislusf/seaweedfs
|
||||||
|
|
||||||
go 1.17
|
go 1.18
|
||||||
|
|
||||||
require (
|
require (
|
||||||
cloud.google.com/go v0.94.1 // indirect
|
cloud.google.com/go v0.100.2 // indirect
|
||||||
cloud.google.com/go/pubsub v1.3.1
|
cloud.google.com/go/pubsub v1.21.0
|
||||||
cloud.google.com/go/storage v1.16.1
|
cloud.google.com/go/storage v1.22.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.14.0
|
||||||
github.com/DataDog/zstd v1.3.6-0.20190409195224-796139022798 // indirect
|
github.com/OneOfOne/xxhash v1.2.8
|
||||||
github.com/OneOfOne/xxhash v1.2.2
|
github.com/Shopify/sarama v1.32.0
|
||||||
github.com/Shopify/sarama v1.23.1
|
github.com/aws/aws-sdk-go v1.43.45
|
||||||
github.com/aws/aws-sdk-go v1.35.3
|
|
||||||
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.1 // indirect
|
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
||||||
github.com/chrislusf/raft v1.0.7
|
github.com/chrislusf/raft v1.0.8
|
||||||
github.com/colinmarc/hdfs/v2 v2.2.0
|
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
|
||||||
@@ -33,86 +32,77 @@ 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.8.0
|
github.com/fclairamb/ftpserverlib v0.18.0
|
||||||
github.com/frankban/quicktest v1.7.2 // indirect
|
github.com/fsnotify/fsnotify v1.5.1 // indirect
|
||||||
github.com/fsnotify/fsnotify v1.4.9 // 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.4.4
|
github.com/go-redis/redis/v8 v8.11.5
|
||||||
github.com/go-redsync/redsync/v4 v4.4.1
|
github.com/go-redsync/redsync/v4 v4.5.0
|
||||||
github.com/go-sql-driver/mysql v1.5.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.1+incompatible
|
github.com/golang-jwt/jwt v3.2.2+incompatible
|
||||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
|
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.0
|
github.com/google/btree v1.0.1
|
||||||
github.com/google/go-cmp v0.5.6 // indirect
|
github.com/google/go-cmp v0.5.7 // indirect
|
||||||
github.com/google/uuid v1.3.0
|
github.com/google/uuid v1.3.0
|
||||||
github.com/google/wire v0.4.0 // indirect
|
github.com/google/wire v0.5.0 // indirect
|
||||||
github.com/googleapis/gax-go v2.0.2+incompatible // indirect
|
github.com/googleapis/gax-go/v2 v2.3.0 // indirect
|
||||||
github.com/googleapis/gax-go/v2 v2.1.0 // indirect
|
github.com/gorilla/mux v1.8.0
|
||||||
github.com/gorilla/mux v1.7.4
|
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
|
||||||
github.com/grpc-ecosystem/go-grpc-middleware v1.1.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.0 // 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.1
|
github.com/jcmturner/gokrb5/v8 v8.4.2
|
||||||
github.com/jinzhu/copier v0.2.8
|
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.11
|
github.com/json-iterator/go v1.1.12
|
||||||
github.com/karlseguin/ccache/v2 v2.0.7
|
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.10.9 // indirect
|
github.com/klauspost/compress v1.15.1 // indirect
|
||||||
github.com/klauspost/cpuid v1.2.1 // indirect
|
github.com/klauspost/reedsolomon v1.9.16
|
||||||
github.com/klauspost/reedsolomon v1.9.2
|
|
||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect
|
|
||||||
github.com/kurin/blazer v0.5.3
|
github.com/kurin/blazer v0.5.3
|
||||||
github.com/lib/pq v1.10.0
|
github.com/lib/pq v1.10.5
|
||||||
github.com/linxGnu/grocksdb v1.6.38
|
github.com/linxGnu/grocksdb v1.7.1
|
||||||
github.com/magiconair/properties v1.8.1 // indirect
|
github.com/magiconair/properties v1.8.6 // indirect
|
||||||
github.com/mailru/easyjson v0.7.1 // indirect
|
github.com/mailru/easyjson v0.7.7 // indirect
|
||||||
github.com/mattn/go-ieproxy v0.0.1 // indirect
|
github.com/mattn/go-ieproxy v0.0.3 // indirect
|
||||||
github.com/mattn/go-isatty v0.0.12 // 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.1.2 // indirect
|
github.com/mitchellh/mapstructure v1.4.3 // 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.1 // indirect
|
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||||
github.com/nats-io/jwt v1.0.1 // indirect
|
github.com/olivere/elastic/v7 v7.0.32
|
||||||
github.com/nats-io/nats.go v1.10.0 // indirect
|
github.com/pelletier/go-toml v1.9.4 // indirect
|
||||||
github.com/nats-io/nkeys v0.2.0 // indirect
|
github.com/peterh/liner v1.2.2
|
||||||
github.com/nats-io/nuid v1.0.1 // indirect
|
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
|
||||||
github.com/olivere/elastic/v7 v7.0.19
|
|
||||||
github.com/pelletier/go-toml v1.7.0 // indirect
|
|
||||||
github.com/peterh/liner v1.1.0
|
|
||||||
github.com/pierrec/lz4 v2.2.7+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.11.0
|
github.com/prometheus/client_golang v1.12.1
|
||||||
github.com/prometheus/client_model v0.2.0 // indirect
|
github.com/prometheus/client_model v0.2.0 // indirect
|
||||||
github.com/prometheus/common v0.26.0 // indirect
|
github.com/prometheus/common v0.32.1 // indirect
|
||||||
github.com/prometheus/procfs v0.6.0 // indirect
|
github.com/prometheus/procfs v0.7.3 // indirect
|
||||||
github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563 // indirect
|
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
|
||||||
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
|
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
|
||||||
github.com/seaweedfs/fuse v1.2.0
|
github.com/seaweedfs/goexif v2.0.0+incompatible
|
||||||
github.com/seaweedfs/goexif v1.0.2
|
github.com/sirupsen/logrus v1.8.1 // indirect
|
||||||
github.com/sirupsen/logrus v1.6.0 // indirect
|
|
||||||
github.com/spaolacci/murmur3 v1.1.0 // indirect
|
github.com/spaolacci/murmur3 v1.1.0 // indirect
|
||||||
github.com/spf13/afero v1.6.0 // indirect
|
github.com/spf13/afero v1.8.2 // indirect
|
||||||
github.com/spf13/cast v1.3.0 // indirect
|
github.com/spf13/cast v1.4.1 // indirect
|
||||||
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
||||||
github.com/spf13/viper v1.4.0
|
github.com/spf13/viper v1.11.0
|
||||||
github.com/streadway/amqp v0.0.0-20200108173154-1c71cc93ed71
|
github.com/streadway/amqp v1.0.0
|
||||||
github.com/stretchr/testify v1.7.0
|
github.com/stretchr/testify v1.7.1
|
||||||
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.10.2
|
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
|
||||||
@@ -122,68 +112,114 @@ 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.0.2 // indirect
|
github.com/xdg-go/scram v1.1.0 // indirect
|
||||||
github.com/xdg-go/stringprep v1.0.2 // indirect
|
github.com/xdg-go/stringprep v1.0.2 // 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.0
|
go.etcd.io/etcd/client/v3 v3.5.4
|
||||||
go.mongodb.org/mongo-driver v1.7.0
|
go.mongodb.org/mongo-driver v1.9.0
|
||||||
go.opencensus.io v0.23.0 // indirect
|
go.opencensus.io v0.23.0 // indirect
|
||||||
go.opentelemetry.io/otel v0.15.0 // indirect
|
gocloud.dev v0.25.0
|
||||||
gocloud.dev v0.20.0
|
gocloud.dev/pubsub/natspubsub v0.25.0
|
||||||
gocloud.dev/pubsub/natspubsub v0.20.0
|
gocloud.dev/pubsub/rabbitpubsub v0.25.0
|
||||||
gocloud.dev/pubsub/rabbitpubsub v0.20.0
|
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect
|
||||||
golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f // 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-20210813160813-60bc85c4be6d
|
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4
|
||||||
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect
|
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect
|
||||||
golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365
|
golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba
|
||||||
golang.org/x/text v0.3.6 // indirect
|
golang.org/x/text v0.3.7 // indirect
|
||||||
golang.org/x/tools v0.1.5
|
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-20220411194840-2f41105eb62f // indirect
|
||||||
google.golang.org/api v0.57.0
|
google.golang.org/api v0.77.0
|
||||||
google.golang.org/appengine v1.6.7 // indirect
|
google.golang.org/appengine v1.6.7 // indirect
|
||||||
google.golang.org/genproto v0.0.0-20210921142501-181ce0d877f6 // indirect
|
google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21 // indirect
|
||||||
google.golang.org/grpc v1.40.0
|
google.golang.org/grpc v1.46.0
|
||||||
google.golang.org/protobuf v1.27.1
|
google.golang.org/protobuf v1.28.0
|
||||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||||
gopkg.in/jcmturner/aescts.v1 v1.0.1 // indirect
|
|
||||||
gopkg.in/jcmturner/dnsutils.v1 v1.0.1 // indirect
|
|
||||||
gopkg.in/jcmturner/goidentity.v3 v3.0.0 // indirect
|
|
||||||
gopkg.in/jcmturner/gokrb5.v7 v7.3.0 // indirect
|
|
||||||
gopkg.in/jcmturner/rpc.v1 v1.1.0 // indirect
|
|
||||||
modernc.org/b v1.0.0 // indirect
|
modernc.org/b v1.0.0 // indirect
|
||||||
modernc.org/cc/v3 v3.33.5 // indirect
|
modernc.org/cc/v3 v3.35.26 // indirect
|
||||||
modernc.org/ccgo/v3 v3.9.4 // indirect
|
modernc.org/ccgo/v3 v3.16.2 // indirect
|
||||||
modernc.org/libc v1.9.5 // indirect
|
modernc.org/libc v1.15.0 // indirect
|
||||||
modernc.org/mathutil v1.2.2 // indirect
|
modernc.org/mathutil v1.4.1 // indirect
|
||||||
modernc.org/memory v1.0.4 // indirect
|
modernc.org/memory v1.0.7 // indirect
|
||||||
modernc.org/opt v0.1.1 // indirect
|
modernc.org/opt v0.1.1 // indirect
|
||||||
modernc.org/sqlite v1.10.7
|
modernc.org/sqlite v1.17.0
|
||||||
modernc.org/strutil v1.1.0 // indirect
|
modernc.org/strutil v1.1.1 // indirect
|
||||||
modernc.org/token v1.0.0 // indirect
|
modernc.org/token v1.0.0 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
cloud.google.com/go/kms v1.0.0 // indirect
|
github.com/Jille/raft-grpc-transport v1.2.0
|
||||||
|
github.com/arangodb/go-driver v1.3.1
|
||||||
|
github.com/fluent/fluent-logger-golang v1.9.0
|
||||||
|
github.com/hanwen/go-fuse/v2 v2.1.0
|
||||||
|
github.com/hashicorp/raft v1.3.9
|
||||||
|
github.com/hashicorp/raft-boltdb v0.0.0-20220329195025-15018e9b97e0
|
||||||
|
)
|
||||||
|
|
||||||
|
require (
|
||||||
|
cloud.google.com/go/compute v1.6.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/config v1.15.3 // indirect
|
||||||
|
github.com/aws/aws-sdk-go-v2/credentials v1.11.2 // indirect
|
||||||
|
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.3 // indirect
|
||||||
|
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.9 // indirect
|
||||||
|
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.3 // indirect
|
||||||
|
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.10 // indirect
|
||||||
|
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.3 // indirect
|
||||||
|
github.com/aws/aws-sdk-go-v2/service/sns v1.17.4 // indirect
|
||||||
|
github.com/aws/aws-sdk-go-v2/service/sqs v1.18.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/smithy-go v1.11.2 // indirect
|
||||||
|
github.com/boltdb/bolt v1.3.1 // indirect
|
||||||
github.com/d4l3k/messagediff v1.2.1 // indirect
|
github.com/d4l3k/messagediff v1.2.1 // 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/go-type-adapters v1.0.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/goidentity/v6 v6.0.1 // indirect
|
||||||
github.com/jcmturner/rpc/v2 v2.0.2 // indirect
|
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
|
||||||
|
github.com/josharian/intern v1.0.0 // indirect
|
||||||
|
github.com/klauspost/cpuid/v2 v2.0.6 // 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/nkeys v0.3.0 // indirect
|
||||||
|
github.com/nats-io/nuid v1.0.1 // indirect
|
||||||
|
github.com/pelletier/go-toml/v2 v2.0.0-beta.8 // indirect
|
||||||
|
github.com/philhofer/fwd v1.1.1 // 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
|
||||||
go.etcd.io/etcd/api/v3 v3.5.0 // indirect
|
github.com/subosito/gotenv v1.2.0 // indirect
|
||||||
go.etcd.io/etcd/client/pkg/v3 v3.5.0 // indirect
|
github.com/tinylib/msgp v1.1.6 // indirect
|
||||||
go.uber.org/atomic v1.7.0 // indirect
|
github.com/yandex-cloud/go-genproto v0.0.0-20211115083454-9ca41db5ed9e // indirect
|
||||||
go.uber.org/multierr v1.7.0 // indirect
|
github.com/ydb-platform/ydb-go-genproto v0.0.0-20220203104745-929cf9c248bc // indirect
|
||||||
go.uber.org/zap v1.17.0 // indirect
|
github.com/ydb-platform/ydb-go-sdk-auth-environ v0.1.0 // indirect
|
||||||
golang.org/x/mod v0.4.2 // indirect
|
github.com/ydb-platform/ydb-go-sdk/v3 v3.24.2 // indirect
|
||||||
|
github.com/ydb-platform/ydb-go-yc v0.6.1 // indirect
|
||||||
|
github.com/ydb-platform/ydb-go-yc-metadata v0.0.9 // 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/multierr v1.8.0 // indirect
|
||||||
|
go.uber.org/zap v1.21.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-20210220032951-036812b2e83c // indirect
|
||||||
|
gopkg.in/ini.v1 v1.66.4 // 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.0-20210107192922-496545a6307b // indirect
|
||||||
|
lukechampine.com/uint128 v1.1.1 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
// replace github.com/seaweedfs/fuse => /Users/chris/go/src/github.com/seaweedfs/fuse
|
// replace github.com/chrislusf/raft => /Users/chrislu/go/src/github.com/chrislusf/raft
|
||||||
// replace github.com/chrislusf/raft => /Users/chris/go/src/github.com/chrislusf/raft
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
description: SeaweedFS
|
description: SeaweedFS
|
||||||
name: seaweedfs
|
name: seaweedfs
|
||||||
appVersion: "2.78"
|
appVersion: "3.02"
|
||||||
version: "2.78"
|
version: "3.02"
|
||||||
@@ -113,21 +113,6 @@ Inject extra environment vars in the format key:value, if populated
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{/* Return the proper cronjob image */}}
|
|
||||||
{{- define "cronjob.image" -}}
|
|
||||||
{{- if .Values.cronjob.imageOverride -}}
|
|
||||||
{{- $imageOverride := .Values.cronjob.imageOverride -}}
|
|
||||||
{{- printf "%s" $imageOverride -}}
|
|
||||||
{{- else -}}
|
|
||||||
{{- $registryName := default .Values.image.registry .Values.global.localRegistry | toString -}}
|
|
||||||
{{- $repositoryName := .Values.image.repository | toString -}}
|
|
||||||
{{- $name := .Values.global.imageName | toString -}}
|
|
||||||
{{- $tag := .Chart.AppVersion | toString -}}
|
|
||||||
{{- printf "%s%s%s:%s" $registryName $repositoryName $name $tag -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
|
|
||||||
{{/* check if any PVC exists */}}
|
{{/* check if any PVC exists */}}
|
||||||
{{- define "volume.pvc_exists" -}}
|
{{- define "volume.pvc_exists" -}}
|
||||||
{{- if or (or (eq .Values.volume.data.type "persistentVolumeClaim") (and (eq .Values.volume.idx.type "persistentVolumeClaim") .Values.volume.dir_idx )) (eq .Values.volume.logs.type "persistentVolumeClaim") -}}
|
{{- if or (or (eq .Values.volume.data.type "persistentVolumeClaim") (and (eq .Values.volume.idx.type "persistentVolumeClaim") .Values.volume.dir_idx )) (eq .Values.volume.logs.type "persistentVolumeClaim") -}}
|
||||||
|
|||||||
@@ -1,58 +0,0 @@
|
|||||||
{{- if .Values.cronjob }}
|
|
||||||
{{- if .Values.cronjob.enabled }}
|
|
||||||
apiVersion: batch/v1beta1
|
|
||||||
kind: CronJob
|
|
||||||
metadata:
|
|
||||||
name: {{ include "seaweedfs.fullname" . }}-cronjob
|
|
||||||
spec:
|
|
||||||
schedule: "{{ .Values.cronjob.schedule }}"
|
|
||||||
startingDeadlineSeconds: 200
|
|
||||||
concurrencyPolicy: Forbid
|
|
||||||
failedJobsHistoryLimit: 2
|
|
||||||
successfulJobsHistoryLimit: 2
|
|
||||||
jobTemplate:
|
|
||||||
spec:
|
|
||||||
backoffLimit: 2
|
|
||||||
template:
|
|
||||||
spec:
|
|
||||||
{{- if .Values.cronjob.nodeSelector }}
|
|
||||||
nodeSelector:
|
|
||||||
{{ tpl .Values.cronjob.nodeSelector . | indent 12 | trim }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.cronjob.tolerations }}
|
|
||||||
tolerations:
|
|
||||||
{{ tpl .Values.cronjob.tolerations . | nindent 12 | trim }}
|
|
||||||
{{- end }}
|
|
||||||
restartPolicy: OnFailure
|
|
||||||
containers:
|
|
||||||
- name: shell
|
|
||||||
image: {{ template "cronjob.image" . }}
|
|
||||||
imagePullPolicy: {{ default "IfNotPresent" .Values.global.imagePullPolicy }}
|
|
||||||
resources:
|
|
||||||
{{- toYaml .Values.cronjob.resources| nindent 16 }}
|
|
||||||
command:
|
|
||||||
- sh
|
|
||||||
- -c
|
|
||||||
- |
|
|
||||||
set -ex
|
|
||||||
echo -e "lock\n\
|
|
||||||
volume.balance -force \
|
|
||||||
{{ if .Values.volume.dataCenter }} -dataCenter {{ .Values.volume.dataCenter }}{{ end }}\
|
|
||||||
{{ if .Values.cronjob.collection }} -collection {{ .Values.cronjob.collection }}{{ end }}\n\
|
|
||||||
{{- if .Values.cronjob.enableFixReplication }}
|
|
||||||
volume.fix.replication -collectionPattern={{ .Values.cronjob.collectionPattern }} \n\
|
|
||||||
{{- end }}
|
|
||||||
unlock\n" | \
|
|
||||||
/usr/bin/weed shell \
|
|
||||||
{{- if .Values.cronjob.master }}
|
|
||||||
-master {{ .Values.cronjob.master }} \
|
|
||||||
{{- else }}
|
|
||||||
-master {{ template "seaweedfs.name" . }}-master.{{ .Release.Namespace }}.svc:{{ .Values.master.port }} \
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.cronjob.filer }}
|
|
||||||
-filer {{ .Values.cronjob.filer }}
|
|
||||||
{{- else }}
|
|
||||||
-filer {{ template "seaweedfs.name" . }}-filer.{{ .Release.Namespace }}.svc:{{ .Values.filer.port }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
@@ -149,15 +149,21 @@ spec:
|
|||||||
{{- if .Values.filer.s3.enableAuth }}
|
{{- if .Values.filer.s3.enableAuth }}
|
||||||
-s3.config=/etc/sw/seaweedfs_s3_config \
|
-s3.config=/etc/sw/seaweedfs_s3_config \
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if .Values.filer.s3.auditLogConfig }}
|
||||||
|
-s3.auditLogConfig=/etc/sw/filer_s3_auditLogConfig.json \
|
||||||
|
{{- 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
|
||||||
@@ -180,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
|
||||||
@@ -247,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 }}
|
||||||
@@ -1,61 +1,67 @@
|
|||||||
|
{{- if .Values.filer.ingress.enabled }}
|
||||||
|
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion }}
|
||||||
|
apiVersion: networking.k8s.io/v1beta1
|
||||||
|
{{- else }}
|
||||||
apiVersion: extensions/v1beta1
|
apiVersion: extensions/v1beta1
|
||||||
|
{{- end }}
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
name: ingress-{{ template "seaweedfs.name" . }}-filer
|
name: ingress-{{ template "seaweedfs.name" . }}-filer
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ .Release.Namespace }}
|
||||||
annotations:
|
annotations:
|
||||||
kubernetes.io/ingress.class: "nginx"
|
{{ omit .Values.filer.ingress.annotations "kubernetes.io/ingress.class" | toYaml | nindent 4 }}
|
||||||
nginx.ingress.kubernetes.io/auth-type: "basic"
|
|
||||||
nginx.ingress.kubernetes.io/auth-secret: "default/ingress-basic-auth-secret"
|
|
||||||
nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required - SW-Filer'
|
|
||||||
nginx.ingress.kubernetes.io/service-upstream: "true"
|
|
||||||
nginx.ingress.kubernetes.io/rewrite-target: /$1
|
|
||||||
nginx.ingress.kubernetes.io/use-regex: "true"
|
|
||||||
nginx.ingress.kubernetes.io/enable-rewrite-log: "true"
|
|
||||||
nginx.ingress.kubernetes.io/ssl-redirect: "false"
|
|
||||||
nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
|
|
||||||
nginx.ingress.kubernetes.io/configuration-snippet: |
|
|
||||||
sub_filter '<head>' '<head> <base href="/sw-filer/">'; #add base url
|
|
||||||
sub_filter '="/' '="./'; #make absolute paths to relative
|
|
||||||
sub_filter '=/' '=./';
|
|
||||||
sub_filter '/seaweedfsstatic' './seaweedfsstatic';
|
|
||||||
sub_filter_once off;
|
|
||||||
spec:
|
spec:
|
||||||
rules:
|
ingressClassName: {{ .Values.filer.ingress.className | quote }}
|
||||||
- http:
|
rules:
|
||||||
paths:
|
- http:
|
||||||
- path: /sw-filer/?(.*)
|
paths:
|
||||||
backend:
|
- path: /sw-filer/?(.*)
|
||||||
serviceName: {{ template "seaweedfs.name" . }}-filer
|
pathType: ImplementationSpecific
|
||||||
servicePort: {{ .Values.filer.port }}
|
backend:
|
||||||
|
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
|
||||||
|
service:
|
||||||
|
name: {{ template "seaweedfs.name" . }}-filer
|
||||||
|
port:
|
||||||
|
number: {{ .Values.filer.port }}
|
||||||
|
#name:
|
||||||
|
{{- else }}
|
||||||
|
serviceName: {{ template "seaweedfs.name" . }}-filer
|
||||||
|
servicePort: {{ .Values.filer.port }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
---
|
---
|
||||||
|
{{- if .Values.master.ingress.enabled }}
|
||||||
|
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion }}
|
||||||
|
apiVersion: networking.k8s.io/v1beta1
|
||||||
|
{{- else }}
|
||||||
apiVersion: extensions/v1beta1
|
apiVersion: extensions/v1beta1
|
||||||
|
{{- end }}
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
name: ingress-{{ template "seaweedfs.name" . }}-master
|
name: ingress-{{ template "seaweedfs.name" . }}-master
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ .Release.Namespace }}
|
||||||
annotations:
|
annotations:
|
||||||
kubernetes.io/ingress.class: "nginx"
|
{{ omit .Values.master.ingress.annotations "kubernetes.io/ingress.class" | toYaml | nindent 4 }}
|
||||||
nginx.ingress.kubernetes.io/auth-type: "basic"
|
|
||||||
nginx.ingress.kubernetes.io/auth-secret: "default/ingress-basic-auth-secret"
|
|
||||||
nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required - SW-Master'
|
|
||||||
nginx.ingress.kubernetes.io/service-upstream: "true"
|
|
||||||
nginx.ingress.kubernetes.io/rewrite-target: /$1
|
|
||||||
nginx.ingress.kubernetes.io/use-regex: "true"
|
|
||||||
nginx.ingress.kubernetes.io/enable-rewrite-log: "true"
|
|
||||||
nginx.ingress.kubernetes.io/ssl-redirect: "false"
|
|
||||||
nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
|
|
||||||
nginx.ingress.kubernetes.io/configuration-snippet: |
|
|
||||||
sub_filter '<head>' '<head> <base href="/sw-master/">'; #add base url
|
|
||||||
sub_filter '="/' '="./'; #make absolute paths to relative
|
|
||||||
sub_filter '=/' '=./';
|
|
||||||
sub_filter '/seaweedfsstatic' './seaweedfsstatic';
|
|
||||||
sub_filter_once off;
|
|
||||||
spec:
|
spec:
|
||||||
|
ingressClassName: {{ .Values.master.ingress.className | quote }}
|
||||||
rules:
|
rules:
|
||||||
- http:
|
- http:
|
||||||
paths:
|
paths:
|
||||||
- path: /sw-master/?(.*)
|
- path: /sw-master/?(.*)
|
||||||
|
pathType: ImplementationSpecific
|
||||||
backend:
|
backend:
|
||||||
|
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
|
||||||
|
service:
|
||||||
|
name: {{ template "seaweedfs.name" . }}-master
|
||||||
|
port:
|
||||||
|
number: {{ .Values.master.port }}
|
||||||
|
#name:
|
||||||
|
{{- else }}
|
||||||
serviceName: {{ template "seaweedfs.name" . }}-master
|
serviceName: {{ template "seaweedfs.name" . }}-master
|
||||||
servicePort: {{ .Values.master.port }}
|
servicePort: {{ .Values.master.port }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
@@ -93,6 +93,9 @@ spec:
|
|||||||
{{- if .Values.s3.enableAuth }}
|
{{- if .Values.s3.enableAuth }}
|
||||||
-config=/etc/sw/seaweedfs_s3_config \
|
-config=/etc/sw/seaweedfs_s3_config \
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if .Values.s3.auditLogConfig }}
|
||||||
|
-auditLogConfig=/etc/sw/s3_auditLogConfig.json \
|
||||||
|
{{- end }}
|
||||||
-filer={{ template "seaweedfs.name" . }}-filer-client:{{ .Values.filer.port }}
|
-filer={{ template "seaweedfs.name" . }}-filer-client:{{ .Values.filer.port }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: logs
|
- name: logs
|
||||||
@@ -127,7 +130,7 @@ spec:
|
|||||||
name: swfs-s3
|
name: swfs-s3
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /
|
path: /status
|
||||||
port: {{ .Values.s3.port }}
|
port: {{ .Values.s3.port }}
|
||||||
scheme: HTTP
|
scheme: HTTP
|
||||||
initialDelaySeconds: 15
|
initialDelaySeconds: 15
|
||||||
@@ -137,7 +140,7 @@ spec:
|
|||||||
timeoutSeconds: 10
|
timeoutSeconds: 10
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /
|
path: /status
|
||||||
port: {{ .Values.s3.port }}
|
port: {{ .Values.s3.port }}
|
||||||
scheme: HTTP
|
scheme: HTTP
|
||||||
initialDelaySeconds: 20
|
initialDelaySeconds: 20
|
||||||
|
|||||||
@@ -18,4 +18,12 @@ stringData:
|
|||||||
read_access_key_id: {{ $access_key_read }}
|
read_access_key_id: {{ $access_key_read }}
|
||||||
read_secret_access_key: {{ $secret_key_read }}
|
read_secret_access_key: {{ $secret_key_read }}
|
||||||
seaweedfs_s3_config: '{"identities":[{"name":"anvAdmin","credentials":[{"accessKey":"{{ $access_key_admin }}","secretKey":"{{ $secret_key_admin }}"}],"actions":["Admin","Read","Write"]},{"name":"anvReadOnly","credentials":[{"accessKey":"{{ $access_key_read }}","secretKey":"{{ $secret_key_read }}"}],"actions":["Read"]}]}'
|
seaweedfs_s3_config: '{"identities":[{"name":"anvAdmin","credentials":[{"accessKey":"{{ $access_key_admin }}","secretKey":"{{ $secret_key_admin }}"}],"actions":["Admin","Read","Write"]},{"name":"anvReadOnly","credentials":[{"accessKey":"{{ $access_key_read }}","secretKey":"{{ $secret_key_read }}"}],"actions":["Read"]}]}'
|
||||||
|
{{- if .Values.filer.s3.auditLogConfig }}
|
||||||
|
filer_s3_auditLogConfig.json: |
|
||||||
|
{{ toJson .Values.filer.s3.auditLogConfig | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.s3.auditLogConfig }}
|
||||||
|
s3_auditLogConfig.json: |
|
||||||
|
{{ toJson .Values.s3.auditLogConfig | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#hack for delete pod master after migration
|
#hack for delete pod master after migration
|
||||||
---
|
---
|
||||||
kind: ClusterRole
|
kind: ClusterRole
|
||||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
metadata:
|
metadata:
|
||||||
name: seaweefds-rw-cr
|
name: seaweefds-rw-cr
|
||||||
rules:
|
rules:
|
||||||
@@ -16,7 +16,7 @@ metadata:
|
|||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ .Release.Namespace }}
|
||||||
---
|
---
|
||||||
kind: ClusterRoleBinding
|
kind: ClusterRoleBinding
|
||||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
metadata:
|
metadata:
|
||||||
name: system:serviceaccount:seaweefds-rw-sa:default
|
name: system:serviceaccount:seaweefds-rw-sa:default
|
||||||
subjects:
|
subjects:
|
||||||
@@ -26,4 +26,4 @@ subjects:
|
|||||||
roleRef:
|
roleRef:
|
||||||
apiGroup: rbac.authorization.k8s.io
|
apiGroup: rbac.authorization.k8s.io
|
||||||
kind: ClusterRole
|
kind: ClusterRole
|
||||||
name: seaweefds-rw-cr
|
name: seaweefds-rw-cr
|
||||||
@@ -40,7 +40,7 @@ spec:
|
|||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
- name: {{ .Values.global.imagePullSecrets }}
|
- name: {{ .Values.global.imagePullSecrets }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
terminationGracePeriodSeconds: 10
|
terminationGracePeriodSeconds: 150
|
||||||
{{- if .Values.volume.priorityClassName }}
|
{{- if .Values.volume.priorityClassName }}
|
||||||
priorityClassName: {{ .Values.volume.priorityClassName | quote }}
|
priorityClassName: {{ .Values.volume.priorityClassName | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|||||||
@@ -41,8 +41,7 @@ master:
|
|||||||
grpcPort: 19333
|
grpcPort: 19333
|
||||||
ipBind: "0.0.0.0"
|
ipBind: "0.0.0.0"
|
||||||
volumePreallocate: false
|
volumePreallocate: false
|
||||||
#Master stops directing writes to oversized volumes
|
volumeSizeLimitMB: 1000
|
||||||
volumeSizeLimitMB: 30000
|
|
||||||
loggingOverrideLevel: null
|
loggingOverrideLevel: null
|
||||||
#number of seconds between heartbeats, default 5
|
#number of seconds between heartbeats, default 5
|
||||||
pulseSeconds: null
|
pulseSeconds: null
|
||||||
@@ -109,6 +108,26 @@ master:
|
|||||||
# ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
# ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
||||||
priorityClassName: ""
|
priorityClassName: ""
|
||||||
|
|
||||||
|
ingress:
|
||||||
|
enabled: false
|
||||||
|
className: "nginx"
|
||||||
|
annotations:
|
||||||
|
nginx.ingress.kubernetes.io/auth-type: "basic"
|
||||||
|
nginx.ingress.kubernetes.io/auth-secret: "default/ingress-basic-auth-secret"
|
||||||
|
nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required - SW-Master'
|
||||||
|
nginx.ingress.kubernetes.io/service-upstream: "true"
|
||||||
|
nginx.ingress.kubernetes.io/rewrite-target: /$1
|
||||||
|
nginx.ingress.kubernetes.io/use-regex: "true"
|
||||||
|
nginx.ingress.kubernetes.io/enable-rewrite-log: "true"
|
||||||
|
nginx.ingress.kubernetes.io/ssl-redirect: "false"
|
||||||
|
nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
|
||||||
|
nginx.ingress.kubernetes.io/configuration-snippet: |
|
||||||
|
sub_filter '<head>' '<head> <base href="/sw-master/">'; #add base url
|
||||||
|
sub_filter '="/' '="./'; #make absolute paths to relative
|
||||||
|
sub_filter '=/' '=./';
|
||||||
|
sub_filter '/seaweedfsstatic' './seaweedfsstatic';
|
||||||
|
sub_filter_once off;
|
||||||
|
|
||||||
extraEnvironmentVars:
|
extraEnvironmentVars:
|
||||||
WEED_MASTER_VOLUME_GROWTH_COPY_1: 7
|
WEED_MASTER_VOLUME_GROWTH_COPY_1: 7
|
||||||
WEED_MASTER_VOLUME_GROWTH_COPY_2: 6
|
WEED_MASTER_VOLUME_GROWTH_COPY_2: 6
|
||||||
@@ -253,12 +272,12 @@ filer:
|
|||||||
# Limit sub dir listing size (default 100000)
|
# Limit sub dir listing size (default 100000)
|
||||||
dirListLimit: 100000
|
dirListLimit: 100000
|
||||||
|
|
||||||
# Turn off directory listing
|
|
||||||
disableDirListing: false
|
|
||||||
|
|
||||||
# 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
|
||||||
@@ -309,6 +328,26 @@ filer:
|
|||||||
# ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
# ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
||||||
priorityClassName: ""
|
priorityClassName: ""
|
||||||
|
|
||||||
|
ingress:
|
||||||
|
enabled: false
|
||||||
|
className: "nginx"
|
||||||
|
annotations:
|
||||||
|
nginx.ingress.kubernetes.io/auth-type: "basic"
|
||||||
|
nginx.ingress.kubernetes.io/auth-secret: "default/ingress-basic-auth-secret"
|
||||||
|
nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required - SW-Filer'
|
||||||
|
nginx.ingress.kubernetes.io/service-upstream: "true"
|
||||||
|
nginx.ingress.kubernetes.io/rewrite-target: /$1
|
||||||
|
nginx.ingress.kubernetes.io/use-regex: "true"
|
||||||
|
nginx.ingress.kubernetes.io/enable-rewrite-log: "true"
|
||||||
|
nginx.ingress.kubernetes.io/ssl-redirect: "false"
|
||||||
|
nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
|
||||||
|
nginx.ingress.kubernetes.io/configuration-snippet: |
|
||||||
|
sub_filter '<head>' '<head> <base href="/sw-filer/">'; #add base url
|
||||||
|
sub_filter '="/' '="./'; #make absolute paths to relative
|
||||||
|
sub_filter '=/' '=./';
|
||||||
|
sub_filter '/seaweedfsstatic' './seaweedfsstatic';
|
||||||
|
sub_filter_once off;
|
||||||
|
|
||||||
# extraEnvVars is a list of extra enviroment variables to set with the stateful set.
|
# extraEnvVars is a list of extra enviroment variables to set with the stateful set.
|
||||||
extraEnvironmentVars:
|
extraEnvironmentVars:
|
||||||
WEED_MYSQL_ENABLED: "true"
|
WEED_MYSQL_ENABLED: "true"
|
||||||
@@ -321,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"
|
||||||
@@ -338,6 +378,7 @@ filer:
|
|||||||
# enable user & permission to s3 (need to inject to all services)
|
# enable user & permission to s3 (need to inject to all services)
|
||||||
enableAuth: false
|
enableAuth: false
|
||||||
skipAuthSecretCreation: false
|
skipAuthSecretCreation: false
|
||||||
|
auditLogConfig: {}
|
||||||
|
|
||||||
s3:
|
s3:
|
||||||
enabled: false
|
enabled: false
|
||||||
@@ -354,6 +395,7 @@ s3:
|
|||||||
# enable user & permission to s3 (need to inject to all services)
|
# enable user & permission to s3 (need to inject to all services)
|
||||||
enableAuth: false
|
enableAuth: false
|
||||||
skipAuthSecretCreation: false
|
skipAuthSecretCreation: false
|
||||||
|
auditLogConfig: {}
|
||||||
|
|
||||||
# Suffix of the host name, {bucket}.{domainName}
|
# Suffix of the host name, {bucket}.{domainName}
|
||||||
domainName: ""
|
domainName: ""
|
||||||
@@ -389,22 +431,6 @@ s3:
|
|||||||
size: ""
|
size: ""
|
||||||
storageClass: ""
|
storageClass: ""
|
||||||
|
|
||||||
cronjob:
|
|
||||||
enabled: true
|
|
||||||
master: "seaweedfs-master:9333"
|
|
||||||
filer: "seaweedfs-filer-client:8888"
|
|
||||||
tolerations: ""
|
|
||||||
nodeSelector: |
|
|
||||||
sw-backend: "true"
|
|
||||||
replication:
|
|
||||||
enable: true
|
|
||||||
collectionPattern: ""
|
|
||||||
schedule: "*/7 * * * *"
|
|
||||||
resources: null
|
|
||||||
# balance all volumes among volume servers
|
|
||||||
# ALL|EACH_COLLECTION|<collection_name>
|
|
||||||
collection: ""
|
|
||||||
|
|
||||||
|
|
||||||
certificates:
|
certificates:
|
||||||
commonName: "SeaweedFS CA"
|
commonName: "SeaweedFS CA"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<groupId>com.github.chrislusf</groupId>
|
<groupId>com.github.chrislusf</groupId>
|
||||||
<artifactId>seaweedfs-client</artifactId>
|
<artifactId>seaweedfs-client</artifactId>
|
||||||
<version>1.7.0</version>
|
<version>2.85</version>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.sonatype.oss</groupId>
|
<groupId>org.sonatype.oss</groupId>
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<protobuf.version>3.9.1</protobuf.version>
|
<protobuf.version>3.16.1</protobuf.version>
|
||||||
<!-- follow https://github.com/grpc/grpc-java -->
|
<!-- follow https://github.com/grpc/grpc-java -->
|
||||||
<grpc.version>1.23.0</grpc.version>
|
<grpc.version>1.23.0</grpc.version>
|
||||||
<guava.version>30.0-jre</guava.version>
|
<guava.version>30.0-jre</guava.version>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<groupId>com.github.chrislusf</groupId>
|
<groupId>com.github.chrislusf</groupId>
|
||||||
<artifactId>seaweedfs-client</artifactId>
|
<artifactId>seaweedfs-client</artifactId>
|
||||||
<version>1.7.0</version>
|
<version>2.85</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>1.7.0</version>
|
<version>2.85</version>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.sonatype.oss</groupId>
|
<groupId>org.sonatype.oss</groupId>
|
||||||
|
|||||||
@@ -368,6 +368,7 @@ public class FilerClient extends FilerGrpcClient {
|
|||||||
.setPathPrefix(prefix)
|
.setPathPrefix(prefix)
|
||||||
.setClientName(clientName)
|
.setClientName(clientName)
|
||||||
.setSinceNs(sinceNs)
|
.setSinceNs(sinceNs)
|
||||||
|
.setClientId(this.randomClientId)
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
import javax.net.ssl.SSLException;
|
import javax.net.ssl.SSLException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Random;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
public class FilerGrpcClient {
|
public class FilerGrpcClient {
|
||||||
@@ -30,6 +31,7 @@ public class FilerGrpcClient {
|
|||||||
public final int VOLUME_SERVER_ACCESS_PUBLIC_URL = 1;
|
public final int VOLUME_SERVER_ACCESS_PUBLIC_URL = 1;
|
||||||
public final int VOLUME_SERVER_ACCESS_FILER_PROXY = 2;
|
public final int VOLUME_SERVER_ACCESS_FILER_PROXY = 2;
|
||||||
public final Map<String, FilerProto.Locations> vidLocations = new HashMap<>();
|
public final Map<String, FilerProto.Locations> vidLocations = new HashMap<>();
|
||||||
|
protected int randomClientId;
|
||||||
private final ManagedChannel channel;
|
private final ManagedChannel channel;
|
||||||
private final SeaweedFilerGrpc.SeaweedFilerBlockingStub blockingStub;
|
private final SeaweedFilerGrpc.SeaweedFilerBlockingStub blockingStub;
|
||||||
private final SeaweedFilerGrpc.SeaweedFilerStub asyncStub;
|
private final SeaweedFilerGrpc.SeaweedFilerStub asyncStub;
|
||||||
@@ -62,6 +64,7 @@ public class FilerGrpcClient {
|
|||||||
cipher = filerConfigurationResponse.getCipher();
|
cipher = filerConfigurationResponse.getCipher();
|
||||||
collection = filerConfigurationResponse.getCollection();
|
collection = filerConfigurationResponse.getCollection();
|
||||||
replication = filerConfigurationResponse.getReplication();
|
replication = filerConfigurationResponse.getReplication();
|
||||||
|
randomClientId = new Random().nextInt();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,11 +29,31 @@ public class SeaweedWrite {
|
|||||||
final byte[] bytes,
|
final byte[] bytes,
|
||||||
final long bytesOffset, final long bytesLength,
|
final long bytesOffset, final long bytesLength,
|
||||||
final String path) throws IOException {
|
final String path) throws IOException {
|
||||||
FilerProto.FileChunk.Builder chunkBuilder = writeChunk(
|
|
||||||
replication, filerClient, offset, bytes, bytesOffset, bytesLength, path);
|
IOException lastException = null;
|
||||||
synchronized (entry) {
|
for (long waitTime = 1000L; waitTime < 10 * 1000; waitTime += waitTime / 2) {
|
||||||
entry.addChunks(chunkBuilder);
|
try {
|
||||||
|
FilerProto.FileChunk.Builder chunkBuilder = writeChunk(
|
||||||
|
replication, filerClient, offset, bytes, bytesOffset, bytesLength, path);
|
||||||
|
lastException = null;
|
||||||
|
synchronized (entry) {
|
||||||
|
entry.addChunks(chunkBuilder);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
} catch (IOException ioe) {
|
||||||
|
LOG.debug("writeData:{}", ioe);
|
||||||
|
lastException = ioe;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
Thread.sleep(waitTime);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (lastException != null) {
|
||||||
|
throw lastException;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static FilerProto.FileChunk.Builder writeChunk(final String replication,
|
public static FilerProto.FileChunk.Builder writeChunk(final String replication,
|
||||||
|
|||||||
@@ -48,6 +48,9 @@ service SeaweedFiler {
|
|||||||
rpc Statistics (StatisticsRequest) returns (StatisticsResponse) {
|
rpc Statistics (StatisticsRequest) returns (StatisticsResponse) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rpc Ping (PingRequest) returns (PingResponse) {
|
||||||
|
}
|
||||||
|
|
||||||
rpc GetFilerConfiguration (GetFilerConfigurationRequest) returns (GetFilerConfigurationResponse) {
|
rpc GetFilerConfiguration (GetFilerConfigurationRequest) returns (GetFilerConfigurationResponse) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,6 +117,7 @@ message Entry {
|
|||||||
bytes content = 9; // if not empty, the file content
|
bytes content = 9; // if not empty, the file content
|
||||||
|
|
||||||
RemoteEntry remote_entry = 10;
|
RemoteEntry remote_entry = 10;
|
||||||
|
int64 quota = 11; // for bucket only. Positive/Negative means enabled/disabled.
|
||||||
}
|
}
|
||||||
|
|
||||||
message FullEntry {
|
message FullEntry {
|
||||||
@@ -170,6 +174,8 @@ message FuseAttributes {
|
|||||||
string symlink_target = 13;
|
string symlink_target = 13;
|
||||||
bytes md5 = 14;
|
bytes md5 = 14;
|
||||||
string disk_type = 15;
|
string disk_type = 15;
|
||||||
|
uint32 rdev = 16;
|
||||||
|
uint64 inode = 17;
|
||||||
}
|
}
|
||||||
|
|
||||||
message CreateEntryRequest {
|
message CreateEntryRequest {
|
||||||
@@ -178,6 +184,7 @@ message CreateEntryRequest {
|
|||||||
bool o_excl = 3;
|
bool o_excl = 3;
|
||||||
bool is_from_other_cluster = 4;
|
bool is_from_other_cluster = 4;
|
||||||
repeated int32 signatures = 5;
|
repeated int32 signatures = 5;
|
||||||
|
bool skip_check_parent_directory = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
message CreateEntryResponse {
|
message CreateEntryResponse {
|
||||||
@@ -247,6 +254,7 @@ message AssignVolumeRequest {
|
|||||||
string data_center = 5;
|
string data_center = 5;
|
||||||
string path = 6;
|
string path = 6;
|
||||||
string rack = 7;
|
string rack = 7;
|
||||||
|
string data_node = 9;
|
||||||
string disk_type = 8;
|
string disk_type = 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -306,6 +314,16 @@ message StatisticsResponse {
|
|||||||
uint64 file_count = 6;
|
uint64 file_count = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message PingRequest {
|
||||||
|
string target = 1; // default to ping itself
|
||||||
|
string target_type = 2;
|
||||||
|
}
|
||||||
|
message PingResponse {
|
||||||
|
int64 start_time_ns = 1;
|
||||||
|
int64 remote_time_ns = 2;
|
||||||
|
int64 stop_time_ns = 3;
|
||||||
|
}
|
||||||
|
|
||||||
message GetFilerConfigurationRequest {
|
message GetFilerConfigurationRequest {
|
||||||
}
|
}
|
||||||
message GetFilerConfigurationResponse {
|
message GetFilerConfigurationResponse {
|
||||||
@@ -328,6 +346,7 @@ message SubscribeMetadataRequest {
|
|||||||
int64 since_ns = 3;
|
int64 since_ns = 3;
|
||||||
int32 signature = 4;
|
int32 signature = 4;
|
||||||
repeated string path_prefixes = 6;
|
repeated string path_prefixes = 6;
|
||||||
|
int32 client_id = 7;
|
||||||
}
|
}
|
||||||
message SubscribeMetadataResponse {
|
message SubscribeMetadataResponse {
|
||||||
string directory = 1;
|
string directory = 1;
|
||||||
@@ -396,6 +415,9 @@ message FilerConf {
|
|||||||
bool fsync = 6;
|
bool fsync = 6;
|
||||||
uint32 volume_growth_count = 7;
|
uint32 volume_growth_count = 7;
|
||||||
bool read_only = 8;
|
bool read_only = 8;
|
||||||
|
string data_center = 9;
|
||||||
|
string rack = 10;
|
||||||
|
string data_node = 11;
|
||||||
}
|
}
|
||||||
repeated PathConf locations = 2;
|
repeated PathConf locations = 2;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,22 +11,22 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.chrislusf</groupId>
|
<groupId>com.github.chrislusf</groupId>
|
||||||
<artifactId>seaweedfs-client</artifactId>
|
<artifactId>seaweedfs-client</artifactId>
|
||||||
<version>1.7.0</version>
|
<version>2.85</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>1.7.0</version>
|
<version>2.85</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<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>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
@@ -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.1</version>
|
<version>3.2.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.hadoop</groupId>
|
<groupId>org.apache.hadoop</groupId>
|
||||||
|
|||||||
@@ -301,7 +301,7 @@
|
|||||||
</snapshotRepository>
|
</snapshotRepository>
|
||||||
</distributionManagement>
|
</distributionManagement>
|
||||||
<properties>
|
<properties>
|
||||||
<seaweedfs.client.version>1.7.0</seaweedfs.client.version>
|
<seaweedfs.client.version>2.85</seaweedfs.client.version>
|
||||||
<hadoop.version>2.9.2</hadoop.version>
|
<hadoop.version>2.9.2</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>1.7.0</seaweedfs.client.version>
|
<seaweedfs.client.version>2.85</seaweedfs.client.version>
|
||||||
<hadoop.version>2.9.2</hadoop.version>
|
<hadoop.version>2.10.1</hadoop.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<groupId>com.github.chrislusf</groupId>
|
<groupId>com.github.chrislusf</groupId>
|
||||||
|
|||||||
@@ -309,7 +309,7 @@
|
|||||||
</snapshotRepository>
|
</snapshotRepository>
|
||||||
</distributionManagement>
|
</distributionManagement>
|
||||||
<properties>
|
<properties>
|
||||||
<seaweedfs.client.version>1.7.0</seaweedfs.client.version>
|
<seaweedfs.client.version>2.85</seaweedfs.client.version>
|
||||||
<hadoop.version>3.1.1</hadoop.version>
|
<hadoop.version>3.1.1</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>1.7.0</seaweedfs.client.version>
|
<seaweedfs.client.version>2.85</seaweedfs.client.version>
|
||||||
<hadoop.version>3.1.1</hadoop.version>
|
<hadoop.version>3.2.3</hadoop.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<groupId>com.github.chrislusf</groupId>
|
<groupId>com.github.chrislusf</groupId>
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,2 @@
|
|||||||
|
/s3-tests
|
||||||
|
/tmp
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# the tests only support python 3.6, not newer
|
||||||
|
FROM ubuntu:latest
|
||||||
|
|
||||||
|
RUN apt-get update && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y git-core sudo tzdata
|
||||||
|
RUN git clone https://github.com/ceph/s3-tests.git
|
||||||
|
WORKDIR s3-tests
|
||||||
|
|
||||||
|
# we pin a certain commit
|
||||||
|
RUN git checkout 9a6a1e9f197fc9fb031b809d1e057635c2ff8d4e
|
||||||
|
|
||||||
|
RUN ./bootstrap
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# Running S3 Compatibility tests against SeaweedFS
|
||||||
|
|
||||||
|
This is using [the tests from CephFS](https://github.com/ceph/s3-tests).
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- have Docker installed
|
||||||
|
- this has been executed on Mac. On Linux, the hostname in `s3tests.conf` needs to be adjusted.
|
||||||
|
|
||||||
|
## Running tests
|
||||||
|
|
||||||
|
- `./prepare.sh` to build the docker image
|
||||||
|
- `./run.sh` to execute all tests
|
||||||
Executable
+5
@@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
docker build --progress=plain -t s3tests .
|
||||||
Executable
+24
@@ -0,0 +1,24 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
killall -9 weed || echo "already stopped"
|
||||||
|
rm -Rf tmp
|
||||||
|
mkdir tmp
|
||||||
|
docker stop s3test-instance || echo "already stopped"
|
||||||
|
|
||||||
|
ulimit -n 10000
|
||||||
|
../../../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
|
||||||
|
printf '.'
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
|
sleep 3
|
||||||
|
|
||||||
|
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 -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"
|
||||||
|
killall -9 weed
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
[DEFAULT]
|
||||||
|
## this section is just used for host, port and bucket_prefix
|
||||||
|
|
||||||
|
# host set for rgw in vstart.sh
|
||||||
|
host = host.docker.internal
|
||||||
|
|
||||||
|
# port set for rgw in vstart.sh
|
||||||
|
port = 8333
|
||||||
|
|
||||||
|
## say "False" to disable TLS
|
||||||
|
is_secure = False
|
||||||
|
|
||||||
|
## say "False" to disable SSL Verify
|
||||||
|
ssl_verify = False
|
||||||
|
|
||||||
|
[fixtures]
|
||||||
|
## all the buckets created will start with this prefix;
|
||||||
|
## {random} will be filled with random characters to pad
|
||||||
|
## the prefix to 30 characters long, and avoid collisions
|
||||||
|
bucket prefix = yournamehere-{random}-
|
||||||
|
|
||||||
|
[s3 main]
|
||||||
|
# main display_name set in vstart.sh
|
||||||
|
display_name = M. Tester
|
||||||
|
|
||||||
|
# main user_idname set in vstart.sh
|
||||||
|
user_id = testid
|
||||||
|
|
||||||
|
# main email set in vstart.sh
|
||||||
|
email = tester@ceph.com
|
||||||
|
|
||||||
|
# zonegroup api_name for bucket location
|
||||||
|
api_name = default
|
||||||
|
|
||||||
|
## main AWS access key
|
||||||
|
access_key = 0555b35654ad1656d804
|
||||||
|
|
||||||
|
## main AWS secret key
|
||||||
|
secret_key = h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q==
|
||||||
|
|
||||||
|
## replace with key id obtained when secret is created, or delete if KMS not tested
|
||||||
|
#kms_keyid = 01234567-89ab-cdef-0123-456789abcdef
|
||||||
|
|
||||||
|
[s3 alt]
|
||||||
|
# alt display_name set in vstart.sh
|
||||||
|
display_name = john.doe
|
||||||
|
## alt email set in vstart.sh
|
||||||
|
email = john.doe@example.com
|
||||||
|
|
||||||
|
# alt user_id set in vstart.sh
|
||||||
|
user_id = 56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234
|
||||||
|
|
||||||
|
# alt AWS access key set in vstart.sh
|
||||||
|
access_key = NOPQRSTUVWXYZABCDEFG
|
||||||
|
|
||||||
|
# alt AWS secret key set in vstart.sh
|
||||||
|
secret_key = nopqrstuvwxyzabcdefghijklmnabcdefghijklm
|
||||||
|
|
||||||
|
[s3 tenant]
|
||||||
|
# tenant display_name set in vstart.sh
|
||||||
|
display_name = testx$tenanteduser
|
||||||
|
|
||||||
|
# tenant user_id set in vstart.sh
|
||||||
|
user_id = 9876543210abcdef0123456789abcdef0123456789abcdef0123456789abcdef
|
||||||
|
|
||||||
|
# tenant AWS secret key set in vstart.sh
|
||||||
|
access_key = HIJKLMNOPQRSTUVWXYZA
|
||||||
|
|
||||||
|
# tenant AWS secret key set in vstart.sh
|
||||||
|
secret_key = opqrstuvwxyzabcdefghijklmnopqrstuvwxyzab
|
||||||
|
|
||||||
|
# tenant email set in vstart.sh
|
||||||
|
email = tenanteduser@example.com
|
||||||
|
|
||||||
|
#following section needs to be added for all sts-tests
|
||||||
|
[iam]
|
||||||
|
#used for iam operations in sts-tests
|
||||||
|
#email from vstart.sh
|
||||||
|
email = s3@example.com
|
||||||
|
|
||||||
|
#user_id from vstart.sh
|
||||||
|
user_id = 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
|
||||||
|
|
||||||
|
#access_key from vstart.sh
|
||||||
|
access_key = ABCDEFGHIJKLMNOPQRST
|
||||||
|
|
||||||
|
#secret_key vstart.sh
|
||||||
|
secret_key = abcdefghijklmnopqrstuvwxyzabcdefghijklmn
|
||||||
|
|
||||||
|
#display_name from vstart.sh
|
||||||
|
display_name = youruseridhere
|
||||||
|
|
||||||
|
#following section needs to be added when you want to run Assume Role With Webidentity test
|
||||||
|
[webidentity]
|
||||||
|
#used for assume role with web identity test in sts-tests
|
||||||
|
#all parameters will be obtained from ceph/qa/tasks/keycloak.py
|
||||||
|
token=<access_token>
|
||||||
|
|
||||||
|
aud=<obtained after introspecting token>
|
||||||
|
|
||||||
|
sub=<obtained after introspecting token>
|
||||||
|
|
||||||
|
azp=<obtained after introspecting token>
|
||||||
|
|
||||||
|
user_token=<access token for a user, with attribute Department=[Engineering, Marketing>]
|
||||||
|
|
||||||
|
thumbprint=<obtained from x509 certificate>
|
||||||
|
|
||||||
|
KC_REALM=<name of the realm>
|
||||||
@@ -122,7 +122,7 @@ type needleState struct {
|
|||||||
|
|
||||||
func getVolumeFiles(v uint32, addr pb.ServerAddress) (map[types.NeedleId]needleState, int64, error) {
|
func getVolumeFiles(v uint32, addr pb.ServerAddress) (map[types.NeedleId]needleState, int64, error) {
|
||||||
var idxFile *bytes.Reader
|
var idxFile *bytes.Reader
|
||||||
err := operation.WithVolumeServerClient(addr, grpcDialOption, func(vs volume_server_pb.VolumeServerClient) error {
|
err := operation.WithVolumeServerClient(false, addr, grpcDialOption, func(vs volume_server_pb.VolumeServerClient) error {
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
copyFileClient, err := vs.CopyFile(ctx, &volume_server_pb.CopyFileRequest{
|
copyFileClient, err := vs.CopyFile(ctx, &volume_server_pb.CopyFileRequest{
|
||||||
@@ -180,7 +180,7 @@ func getVolumeFiles(v uint32, addr pb.ServerAddress) (map[types.NeedleId]needleS
|
|||||||
|
|
||||||
func getNeedleFileId(v uint32, nid types.NeedleId, addr pb.ServerAddress) (string, error) {
|
func getNeedleFileId(v uint32, nid types.NeedleId, addr pb.ServerAddress) (string, error) {
|
||||||
var id string
|
var id string
|
||||||
err := operation.WithVolumeServerClient(addr, grpcDialOption, func(vs volume_server_pb.VolumeServerClient) error {
|
err := operation.WithVolumeServerClient(false, addr, grpcDialOption, func(vs volume_server_pb.VolumeServerClient) error {
|
||||||
resp, err := vs.VolumeNeedleStatus(context.Background(), &volume_server_pb.VolumeNeedleStatusRequest{
|
resp, err := vs.VolumeNeedleStatus(context.Background(), &volume_server_pb.VolumeNeedleStatusRequest{
|
||||||
VolumeId: v,
|
VolumeId: v,
|
||||||
NeedleId: uint64(nid),
|
NeedleId: uint64(nid),
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func startGenerateMetadata() {
|
func startGenerateMetadata() {
|
||||||
pb.WithFilerClient(pb.ServerAddress(*tailFiler), grpc.WithInsecure(), func(client filer_pb.SeaweedFilerClient) error {
|
pb.WithFilerClient(false, pb.ServerAddress(*tailFiler), grpc.WithInsecure(), func(client filer_pb.SeaweedFilerClient) error {
|
||||||
|
|
||||||
for i := 0; i < *n; i++ {
|
for i := 0; i < *n; i++ {
|
||||||
name := fmt.Sprintf("file%d", i)
|
name := fmt.Sprintf("file%d", i)
|
||||||
@@ -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", *dir, nil, 0, 0, eachEntryFunc, false)
|
tailErr := pb.FollowMetadata(pb.ServerAddress(*tailFiler), grpc.WithInsecure(), "tail", 0, *dir, nil, 0, 0, eachEntryFunc, false)
|
||||||
|
|
||||||
if tailErr != nil {
|
if tailErr != nil {
|
||||||
fmt.Printf("tail %s: %v\n", *tailFiler, tailErr)
|
fmt.Printf("tail %s: %v\n", *tailFiler, tailErr)
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
volumeServer = flag.String("volumeServer", "localhost:8080", "a volume server")
|
volumeServer = flag.String("volumeServer", "localhost:8080", "a volume server")
|
||||||
volumeId = flag.Int("volumeId", -1, "a volume id to stream read")
|
volumeId = flag.Int("volumeId", -1, "a volume id to stream read")
|
||||||
grpcDialOption grpc.DialOption
|
grpcDialOption grpc.DialOption
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -33,11 +33,11 @@ func main() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
err := operation.WithVolumeServerClient(pb.ServerAddress(*volumeServer), grpcDialOption, func(vs volume_server_pb.VolumeServerClient) error {
|
err := operation.WithVolumeServerClient(true, pb.ServerAddress(*volumeServer), grpcDialOption, func(vs volume_server_pb.VolumeServerClient) error {
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
copyFileClient, err := vs.ReadAllNeedles(ctx, &volume_server_pb.ReadAllNeedlesRequest{
|
copyFileClient, err := vs.ReadAllNeedles(ctx, &volume_server_pb.ReadAllNeedlesRequest{
|
||||||
VolumeIds: []uint32{vid},
|
VolumeIds: []uint32{vid},
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -61,4 +61,3 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
+3
-4
@@ -19,15 +19,15 @@ debug_shell:
|
|||||||
|
|
||||||
debug_mount:
|
debug_mount:
|
||||||
go build -gcflags="all=-N -l"
|
go build -gcflags="all=-N -l"
|
||||||
dlv --listen=:2345 --headless=true --api-version=2 --accept-multiclient exec weed -- -v=4 mount -dir=~/tmp/mm -cacheCapacityMB=0 -filer.path=/
|
dlv --listen=:2345 --headless=true --api-version=2 --accept-multiclient exec weed -- -v=4 mount -dir=~/tmp/mm -cacheCapacityMB=0 -filer.path=/ -umask=000
|
||||||
|
|
||||||
debug_server:
|
debug_server:
|
||||||
go build -gcflags="all=-N -l"
|
go build -gcflags="all=-N -l"
|
||||||
dlv --listen=:2345 --headless=true --api-version=2 --accept-multiclient exec weed -- server -dir=/Volumes/mobile_disk/99 -filer -volume.port=8343 -s3 -volume.max=0 -master.volumeSizeLimitMB=1024 -volume.preStopSeconds=1
|
dlv --listen=:2345 --headless=true --api-version=2 --accept-multiclient exec weed -- server -dir=~/tmp/99 -filer -volume.port=8343 -s3 -volume.max=0 -master.volumeSizeLimitMB=1024 -volume.preStopSeconds=1
|
||||||
|
|
||||||
debug_volume:
|
debug_volume:
|
||||||
go build -gcflags="all=-N -l"
|
go build -gcflags="all=-N -l"
|
||||||
dlv --listen=:2345 --headless=true --api-version=2 --accept-multiclient exec weed -- volume -dir=/Volumes/mobile_disk/100 -port 8564 -max=30 -preStopSeconds=2
|
dlv --listen=:2345 --headless=true --api-version=2 --accept-multiclient exec weed -- volume -dir=~/tmp/100 -port 8564 -max=30 -preStopSeconds=2
|
||||||
|
|
||||||
debug_webdav:
|
debug_webdav:
|
||||||
go build -gcflags="all=-N -l"
|
go build -gcflags="all=-N -l"
|
||||||
@@ -52,4 +52,3 @@ debug_filer_remote_sync_buckets:
|
|||||||
debug_master_follower:
|
debug_master_follower:
|
||||||
go build -gcflags="all=-N -l"
|
go build -gcflags="all=-N -l"
|
||||||
dlv --listen=:2345 --headless=true --api-version=2 --accept-multiclient exec weed -- -v=4 master.follower
|
dlv --listen=:2345 --headless=true --api-version=2 --accept-multiclient exec weed -- -v=4 master.follower
|
||||||
|
|
||||||
+104
-53
@@ -9,11 +9,21 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
MasterType = "master"
|
MasterType = "master"
|
||||||
FilerType = "filer"
|
VolumeServerType = "volumeServer"
|
||||||
BrokerType = "broker"
|
FilerType = "filer"
|
||||||
|
BrokerType = "broker"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type FilerGroup string
|
||||||
|
type Filers struct {
|
||||||
|
filers map[pb.ServerAddress]*ClusterNode
|
||||||
|
leaders *Leaders
|
||||||
|
}
|
||||||
|
type Leaders struct {
|
||||||
|
leaders [3]pb.ServerAddress
|
||||||
|
}
|
||||||
|
|
||||||
type ClusterNode struct {
|
type ClusterNode struct {
|
||||||
Address pb.ServerAddress
|
Address pb.ServerAddress
|
||||||
Version string
|
Version string
|
||||||
@@ -21,42 +31,50 @@ type ClusterNode struct {
|
|||||||
createdTs time.Time
|
createdTs time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
type Leaders struct {
|
|
||||||
leaders [3]pb.ServerAddress
|
|
||||||
}
|
|
||||||
|
|
||||||
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 {
|
||||||
|
cluster.filersLock.Lock()
|
||||||
|
defer cluster.filersLock.Unlock()
|
||||||
|
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()
|
filers := cluster.getFilers(filerGroup, true)
|
||||||
defer cluster.filersLock.Unlock()
|
if existingNode, found := filers.filers[address]; found {
|
||||||
if existingNode, found := cluster.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()
|
||||||
@@ -80,22 +98,34 @@ 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()
|
filers := cluster.getFilers(filerGroup, false)
|
||||||
defer cluster.filersLock.Unlock()
|
if filers == nil {
|
||||||
if existingNode, found := cluster.filers[address]; !found {
|
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:
|
||||||
@@ -119,16 +149,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:
|
||||||
|
filers := cluster.getFilers(filerGroup, false)
|
||||||
|
if filers == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
cluster.filersLock.RLock()
|
cluster.filersLock.RLock()
|
||||||
defer cluster.filersLock.RUnlock()
|
defer cluster.filersLock.RUnlock()
|
||||||
for _, node := range cluster.filers {
|
for _, node := range filers.filers {
|
||||||
nodes = append(nodes, node)
|
nodes = append(nodes, node)
|
||||||
}
|
}
|
||||||
case BrokerType:
|
case BrokerType:
|
||||||
@@ -142,41 +185,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,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -184,8 +234,8 @@ 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()
|
||||||
@@ -195,7 +245,7 @@ func (cluster *Cluster) ensureFilerLeaders(isAdd bool, nodeType string, 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{
|
||||||
@@ -209,10 +259,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,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,39 +9,39 @@ import (
|
|||||||
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"))
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -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).ToAddresses())
|
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()
|
||||||
|
|
||||||
|
|||||||
+59
-9
@@ -2,8 +2,10 @@ package command
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"google.golang.org/grpc/reflection"
|
"google.golang.org/grpc/reflection"
|
||||||
@@ -12,7 +14,7 @@ import (
|
|||||||
"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/security"
|
"github.com/chrislusf/seaweedfs/weed/security"
|
||||||
"github.com/chrislusf/seaweedfs/weed/server"
|
weed_server "github.com/chrislusf/seaweedfs/weed/server"
|
||||||
stats_collect "github.com/chrislusf/seaweedfs/weed/stats"
|
stats_collect "github.com/chrislusf/seaweedfs/weed/stats"
|
||||||
"github.com/chrislusf/seaweedfs/weed/util"
|
"github.com/chrislusf/seaweedfs/weed/util"
|
||||||
)
|
)
|
||||||
@@ -28,13 +30,14 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type FilerOptions struct {
|
type FilerOptions struct {
|
||||||
masters []pb.ServerAddress
|
masters map[string]pb.ServerAddress
|
||||||
mastersString *string
|
mastersString *string
|
||||||
ip *string
|
ip *string
|
||||||
bindIp *string
|
bindIp *string
|
||||||
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
|
||||||
@@ -51,14 +54,16 @@ type FilerOptions struct {
|
|||||||
concurrentUploadLimitMB *int
|
concurrentUploadLimitMB *int
|
||||||
debug *bool
|
debug *bool
|
||||||
debugPort *int
|
debugPort *int
|
||||||
|
localSocket *string
|
||||||
}
|
}
|
||||||
|
|
||||||
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")
|
f.bindIp = cmdFiler.Flag.String("ip.bind", "", "ip address to bind to. If empty, default to same as -ip option.")
|
||||||
f.port = cmdFiler.Flag.Int("port", 8888, "filer server http listen port")
|
f.port = cmdFiler.Flag.Int("port", 8888, "filer server http listen port")
|
||||||
f.portGrpc = cmdFiler.Flag.Int("port.grpc", 0, "filer server grpc listen port")
|
f.portGrpc = cmdFiler.Flag.Int("port.grpc", 0, "filer server grpc listen port")
|
||||||
f.publicPort = cmdFiler.Flag.Int("port.readonly", 0, "readonly port opened to public")
|
f.publicPort = cmdFiler.Flag.Int("port.readonly", 0, "readonly port opened to public")
|
||||||
@@ -76,6 +81,7 @@ func init() {
|
|||||||
f.concurrentUploadLimitMB = cmdFiler.Flag.Int("concurrentUploadLimitMB", 128, "limit total concurrent upload size")
|
f.concurrentUploadLimitMB = cmdFiler.Flag.Int("concurrentUploadLimitMB", 128, "limit total concurrent upload size")
|
||||||
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")
|
||||||
|
|
||||||
// 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")
|
||||||
@@ -84,7 +90,9 @@ func init() {
|
|||||||
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")
|
||||||
filerS3Options.config = cmdFiler.Flag.String("s3.config", "", "path to the config file")
|
filerS3Options.config = cmdFiler.Flag.String("s3.config", "", "path to the config file")
|
||||||
|
filerS3Options.auditLogConfig = cmdFiler.Flag.String("s3.auditLogConfig", "", "path to the audit log config file")
|
||||||
filerS3Options.allowEmptyFolder = cmdFiler.Flag.Bool("s3.allowEmptyFolder", true, "allow empty folders")
|
filerS3Options.allowEmptyFolder = cmdFiler.Flag.Bool("s3.allowEmptyFolder", true, "allow empty folders")
|
||||||
|
filerS3Options.allowDeleteBucketNotEmpty = cmdFiler.Flag.Bool("s3.allowDeleteBucketNotEmpty", true, "allow recursive deleting all entries along with bucket")
|
||||||
|
|
||||||
// start webdav on filer
|
// start webdav on filer
|
||||||
filerStartWebDav = cmdFiler.Flag.Bool("webdav", false, "whether to start webdav gateway")
|
filerStartWebDav = cmdFiler.Flag.Bool("webdav", false, "whether to start webdav gateway")
|
||||||
@@ -95,10 +103,11 @@ func init() {
|
|||||||
filerWebDavOptions.tlsPrivateKey = cmdFiler.Flag.String("webdav.key.file", "", "path to the TLS private key file")
|
filerWebDavOptions.tlsPrivateKey = cmdFiler.Flag.String("webdav.key.file", "", "path to the TLS private key file")
|
||||||
filerWebDavOptions.tlsCertificate = cmdFiler.Flag.String("webdav.cert.file", "", "path to the TLS certificate file")
|
filerWebDavOptions.tlsCertificate = cmdFiler.Flag.String("webdav.cert.file", "", "path to the TLS certificate file")
|
||||||
filerWebDavOptions.cacheDir = cmdFiler.Flag.String("webdav.cacheDir", os.TempDir(), "local cache directory for file chunks")
|
filerWebDavOptions.cacheDir = cmdFiler.Flag.String("webdav.cacheDir", os.TempDir(), "local cache directory for file chunks")
|
||||||
filerWebDavOptions.cacheSizeMB = cmdFiler.Flag.Int64("webdav.cacheCapacityMB", 1000, "local cache capacity in MB")
|
filerWebDavOptions.cacheSizeMB = cmdFiler.Flag.Int64("webdav.cacheCapacityMB", 0, "local cache capacity in MB")
|
||||||
|
|
||||||
// start iam on filer
|
// start iam on filer
|
||||||
filerStartIam = cmdFiler.Flag.Bool("iam", false, "whether to start IAM service")
|
filerStartIam = cmdFiler.Flag.Bool("iam", false, "whether to start IAM service")
|
||||||
|
filerIamOptions.ip = cmdFiler.Flag.String("iam.ip", *f.ip, "iam server http listen ip address")
|
||||||
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")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,11 +146,15 @@ func runFiler(cmd *Command, args []string) bool {
|
|||||||
startDelay := time.Duration(2)
|
startDelay := time.Duration(2)
|
||||||
if *filerStartS3 {
|
if *filerStartS3 {
|
||||||
filerS3Options.filer = &filerAddress
|
filerS3Options.filer = &filerAddress
|
||||||
|
filerS3Options.bindIp = f.bindIp
|
||||||
|
filerS3Options.localFilerSocket = f.localSocket
|
||||||
go func() {
|
go func() {
|
||||||
time.Sleep(startDelay * time.Second)
|
time.Sleep(startDelay * time.Second)
|
||||||
filerS3Options.startS3Server()
|
filerS3Options.startS3Server()
|
||||||
}()
|
}()
|
||||||
startDelay++
|
startDelay++
|
||||||
|
} else {
|
||||||
|
*f.localSocket = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
if *filerStartWebDav {
|
if *filerStartWebDav {
|
||||||
@@ -162,7 +175,7 @@ func runFiler(cmd *Command, args []string) bool {
|
|||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
f.masters = pb.ServerAddresses(*f.mastersString).ToAddresses()
|
f.masters = pb.ServerAddresses(*f.mastersString).ToAddressMap()
|
||||||
|
|
||||||
f.startFiler()
|
f.startFiler()
|
||||||
|
|
||||||
@@ -180,6 +193,9 @@ func (fo *FilerOptions) startFiler() {
|
|||||||
if *fo.portGrpc == 0 {
|
if *fo.portGrpc == 0 {
|
||||||
*fo.portGrpc = 10000 + *fo.port
|
*fo.portGrpc = 10000 + *fo.port
|
||||||
}
|
}
|
||||||
|
if *fo.bindIp == "" {
|
||||||
|
*fo.bindIp = *fo.ip
|
||||||
|
}
|
||||||
|
|
||||||
defaultLevelDbDirectory := util.ResolvePath(*fo.defaultLevelDbDirectory + "/filerldb2")
|
defaultLevelDbDirectory := util.ResolvePath(*fo.defaultLevelDbDirectory + "/filerldb2")
|
||||||
|
|
||||||
@@ -187,6 +203,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,
|
||||||
@@ -208,7 +225,7 @@ func (fo *FilerOptions) startFiler() {
|
|||||||
if *fo.publicPort != 0 {
|
if *fo.publicPort != 0 {
|
||||||
publicListeningAddress := util.JoinHostPort(*fo.bindIp, *fo.publicPort)
|
publicListeningAddress := util.JoinHostPort(*fo.bindIp, *fo.publicPort)
|
||||||
glog.V(0).Infoln("Start Seaweed filer server", util.Version(), "public at", publicListeningAddress)
|
glog.V(0).Infoln("Start Seaweed filer server", util.Version(), "public at", publicListeningAddress)
|
||||||
publicListener, e := util.NewListener(publicListeningAddress, 0)
|
publicListener, localPublicListner, e := util.NewIpAndLocalListeners(*fo.bindIp, *fo.publicPort, 0)
|
||||||
if e != nil {
|
if e != nil {
|
||||||
glog.Fatalf("Filer server public listener error on port %d:%v", *fo.publicPort, e)
|
glog.Fatalf("Filer server public listener error on port %d:%v", *fo.publicPort, e)
|
||||||
}
|
}
|
||||||
@@ -217,11 +234,18 @@ func (fo *FilerOptions) startFiler() {
|
|||||||
glog.Fatalf("Volume server fail to serve public: %v", e)
|
glog.Fatalf("Volume server fail to serve public: %v", e)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
if localPublicListner != nil {
|
||||||
|
go func() {
|
||||||
|
if e := http.Serve(localPublicListner, publicVolumeMux); e != nil {
|
||||||
|
glog.Errorf("Volume server fail to serve public: %v", e)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
glog.V(0).Infof("Start Seaweed Filer %s at %s:%d", util.Version(), *fo.ip, *fo.port)
|
glog.V(0).Infof("Start Seaweed Filer %s at %s:%d", util.Version(), *fo.ip, *fo.port)
|
||||||
filerListener, e := util.NewListener(
|
filerListener, filerLocalListener, e := util.NewIpAndLocalListeners(
|
||||||
util.JoinHostPort(*fo.bindIp, *fo.port),
|
*fo.bindIp, *fo.port,
|
||||||
time.Duration(10)*time.Second,
|
time.Duration(10)*time.Second,
|
||||||
)
|
)
|
||||||
if e != nil {
|
if e != nil {
|
||||||
@@ -230,16 +254,42 @@ func (fo *FilerOptions) startFiler() {
|
|||||||
|
|
||||||
// starting grpc server
|
// starting grpc server
|
||||||
grpcPort := *fo.portGrpc
|
grpcPort := *fo.portGrpc
|
||||||
grpcL, err := util.NewListener(util.JoinHostPort(*fo.bindIp, grpcPort), 0)
|
grpcL, grpcLocalL, err := util.NewIpAndLocalListeners(*fo.bindIp, grpcPort, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Fatalf("failed to listen on grpc port %d: %v", grpcPort, err)
|
glog.Fatalf("failed to listen on grpc port %d: %v", grpcPort, err)
|
||||||
}
|
}
|
||||||
grpcS := pb.NewGrpcServer(security.LoadServerTLS(util.GetViper(), "grpc.filer"))
|
grpcS := pb.NewGrpcServer(security.LoadServerTLS(util.GetViper(), "grpc.filer"))
|
||||||
filer_pb.RegisterSeaweedFilerServer(grpcS, fs)
|
filer_pb.RegisterSeaweedFilerServer(grpcS, fs)
|
||||||
reflection.Register(grpcS)
|
reflection.Register(grpcS)
|
||||||
|
if grpcLocalL != nil {
|
||||||
|
go grpcS.Serve(grpcLocalL)
|
||||||
|
}
|
||||||
go grpcS.Serve(grpcL)
|
go grpcS.Serve(grpcL)
|
||||||
|
|
||||||
httpS := &http.Server{Handler: defaultMux}
|
httpS := &http.Server{Handler: defaultMux}
|
||||||
|
if runtime.GOOS != "windows" {
|
||||||
|
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 {
|
||||||
|
go func() {
|
||||||
|
if err := httpS.Serve(filerLocalListener); err != nil {
|
||||||
|
glog.Errorf("Filer Fail to serve: %v", e)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
}
|
||||||
if err := httpS.Serve(filerListener); err != nil {
|
if err := httpS.Serve(filerListener); err != nil {
|
||||||
glog.Fatalf("Filer Fail to serve: %v", e)
|
glog.Fatalf("Filer Fail to serve: %v", e)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,8 +54,10 @@ func runFilerBackup(cmd *Command, args []string) bool {
|
|||||||
|
|
||||||
grpcDialOption := security.LoadClientTLS(util.GetViper(), "grpc.client")
|
grpcDialOption := security.LoadClientTLS(util.GetViper(), "grpc.client")
|
||||||
|
|
||||||
|
clientId := util.RandomInt32()
|
||||||
|
|
||||||
for {
|
for {
|
||||||
err := doFilerBackup(grpcDialOption, &filerBackupOptions)
|
err := doFilerBackup(grpcDialOption, &filerBackupOptions, clientId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Errorf("backup from %s: %v", *filerBackupOptions.filer, err)
|
glog.Errorf("backup from %s: %v", *filerBackupOptions.filer, err)
|
||||||
time.Sleep(1747 * time.Millisecond)
|
time.Sleep(1747 * time.Millisecond)
|
||||||
@@ -69,7 +71,7 @@ const (
|
|||||||
BackupKeyPrefix = "backup."
|
BackupKeyPrefix = "backup."
|
||||||
)
|
)
|
||||||
|
|
||||||
func doFilerBackup(grpcDialOption grpc.DialOption, backupOption *FilerBackupOptions) error {
|
func doFilerBackup(grpcDialOption grpc.DialOption, backupOption *FilerBackupOptions, clientId int32) error {
|
||||||
|
|
||||||
// find data sink
|
// find data sink
|
||||||
config := util.GetViper()
|
config := util.GetViper()
|
||||||
@@ -112,7 +114,7 @@ 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(),
|
return pb.FollowMetadata(sourceFiler, grpcDialOption, "backup_"+dataSink.GetName(), clientId,
|
||||||
sourcePath, nil, startFrom.UnixNano(), 0, processEventFnWithOffset, false)
|
sourcePath, nil, startFrom.UnixNano(), 0, processEventFnWithOffset, false)
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -8,7 +8,6 @@ import (
|
|||||||
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
|
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
|
||||||
"github.com/chrislusf/seaweedfs/weed/wdclient"
|
"github.com/chrislusf/seaweedfs/weed/wdclient"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"math"
|
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -97,7 +96,7 @@ func runFilerCat(cmd *Command, args []string) bool {
|
|||||||
writer = f
|
writer = f
|
||||||
}
|
}
|
||||||
|
|
||||||
pb.WithFilerClient(filerCat.filerAddress, filerCat.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
pb.WithFilerClient(false, filerCat.filerAddress, filerCat.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||||
|
|
||||||
request := &filer_pb.LookupDirectoryEntryRequest{
|
request := &filer_pb.LookupDirectoryEntryRequest{
|
||||||
Name: name,
|
Name: name,
|
||||||
@@ -115,7 +114,7 @@ func runFilerCat(cmd *Command, args []string) bool {
|
|||||||
|
|
||||||
filerCat.filerClient = client
|
filerCat.filerClient = client
|
||||||
|
|
||||||
return filer.StreamContent(&filerCat, writer, respLookupEntry.Entry.Chunks, 0, math.MaxInt64)
|
return filer.StreamContent(&filerCat, writer, respLookupEntry.Entry.Chunks, 0, int64(filer.FileSize(respLookupEntry.Entry)))
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
+11
-10
@@ -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.
|
||||||
@@ -172,7 +172,7 @@ func runCopy(cmd *Command, args []string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func readFilerConfiguration(grpcDialOption grpc.DialOption, filerGrpcAddress pb.ServerAddress) (masters []string, collection, replication string, dirBuckets string, maxMB uint32, cipher bool, err error) {
|
func readFilerConfiguration(grpcDialOption grpc.DialOption, filerGrpcAddress pb.ServerAddress) (masters []string, collection, replication string, dirBuckets string, maxMB uint32, cipher bool, err error) {
|
||||||
err = pb.WithGrpcFilerClient(filerGrpcAddress, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
err = pb.WithGrpcFilerClient(false, filerGrpcAddress, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||||
resp, err := client.GetFilerConfiguration(context.Background(), &filer_pb.GetFilerConfigurationRequest{})
|
resp, err := client.GetFilerConfiguration(context.Background(), &filer_pb.GetFilerConfigurationRequest{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("get filer %s configuration: %v", filerGrpcAddress, err)
|
return fmt.Errorf("get filer %s configuration: %v", filerGrpcAddress, err)
|
||||||
@@ -212,7 +212,7 @@ func genFileCopyTask(fileOrDir string, destPath string, fileCopyTaskChan chan Fi
|
|||||||
if mode.IsDir() {
|
if mode.IsDir() {
|
||||||
files, _ := os.ReadDir(fileOrDir)
|
files, _ := os.ReadDir(fileOrDir)
|
||||||
for _, subFileOrDir := range files {
|
for _, subFileOrDir := range files {
|
||||||
cleanedDestDirectory := filepath.Clean(destPath + fi.Name())
|
cleanedDestDirectory := destPath + fi.Name()
|
||||||
if err = genFileCopyTask(fileOrDir+"/"+subFileOrDir.Name(), cleanedDestDirectory+"/", fileCopyTaskChan); err != nil {
|
if err = genFileCopyTask(fileOrDir+"/"+subFileOrDir.Name(), cleanedDestDirectory+"/", fileCopyTaskChan); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -302,7 +302,7 @@ func (worker *FileCopyWorker) checkExistingFileFirst(task FileCopyTask, f *os.Fi
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
err = pb.WithGrpcFilerClient(worker.filerAddress, worker.options.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
err = pb.WithGrpcFilerClient(false, worker.filerAddress, worker.options.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||||
|
|
||||||
request := &filer_pb.LookupDirectoryEntryRequest{
|
request := &filer_pb.LookupDirectoryEntryRequest{
|
||||||
Directory: task.destinationUrlPath,
|
Directory: task.destinationUrlPath,
|
||||||
@@ -344,7 +344,7 @@ func (worker *FileCopyWorker) uploadFileAsOne(task FileCopyTask, f *os.File) err
|
|||||||
|
|
||||||
err = util.Retry("upload", func() error {
|
err = util.Retry("upload", func() error {
|
||||||
// assign a volume
|
// assign a volume
|
||||||
assignErr := pb.WithGrpcFilerClient(worker.filerAddress, worker.options.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
assignErr := pb.WithGrpcFilerClient(false, worker.filerAddress, worker.options.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||||
|
|
||||||
request := &filer_pb.AssignVolumeRequest{
|
request := &filer_pb.AssignVolumeRequest{
|
||||||
Count: 1,
|
Count: 1,
|
||||||
@@ -404,7 +404,7 @@ func (worker *FileCopyWorker) uploadFileAsOne(task FileCopyTask, f *os.File) err
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := pb.WithGrpcFilerClient(worker.filerAddress, worker.options.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
if err := pb.WithGrpcFilerClient(false, worker.filerAddress, worker.options.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||||
request := &filer_pb.CreateEntryRequest{
|
request := &filer_pb.CreateEntryRequest{
|
||||||
Directory: task.destinationUrlPath,
|
Directory: task.destinationUrlPath,
|
||||||
Entry: &filer_pb.Entry{
|
Entry: &filer_pb.Entry{
|
||||||
@@ -461,7 +461,7 @@ func (worker *FileCopyWorker) uploadFileInChunks(task FileCopyTask, f *os.File,
|
|||||||
var assignResult *filer_pb.AssignVolumeResponse
|
var assignResult *filer_pb.AssignVolumeResponse
|
||||||
var assignError error
|
var assignError error
|
||||||
err := util.Retry("assignVolume", func() error {
|
err := util.Retry("assignVolume", func() error {
|
||||||
return pb.WithGrpcFilerClient(worker.filerAddress, worker.options.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
return pb.WithGrpcFilerClient(false, worker.filerAddress, worker.options.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||||
request := &filer_pb.AssignVolumeRequest{
|
request := &filer_pb.AssignVolumeRequest{
|
||||||
Count: 1,
|
Count: 1,
|
||||||
Replication: *worker.options.replication,
|
Replication: *worker.options.replication,
|
||||||
@@ -482,7 +482,8 @@ func (worker *FileCopyWorker) uploadFileInChunks(task FileCopyTask, f *os.File,
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("Failed to assign from %v: %v\n", worker.options.masters, err)
|
uploadError = fmt.Errorf("Failed to assign from %v: %v\n", worker.options.masters, err)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
targetUrl := "http://" + assignResult.Location.Url + "/" + assignResult.FileId
|
targetUrl := "http://" + assignResult.Location.Url + "/" + assignResult.FileId
|
||||||
@@ -540,7 +541,7 @@ func (worker *FileCopyWorker) uploadFileInChunks(task FileCopyTask, f *os.File,
|
|||||||
return fmt.Errorf("create manifest: %v", manifestErr)
|
return fmt.Errorf("create manifest: %v", manifestErr)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := pb.WithGrpcFilerClient(worker.filerAddress, worker.options.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
if err := pb.WithGrpcFilerClient(false, worker.filerAddress, worker.options.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||||
request := &filer_pb.CreateEntryRequest{
|
request := &filer_pb.CreateEntryRequest{
|
||||||
Directory: task.destinationUrlPath,
|
Directory: task.destinationUrlPath,
|
||||||
Entry: &filer_pb.Entry{
|
Entry: &filer_pb.Entry{
|
||||||
@@ -598,7 +599,7 @@ func (worker *FileCopyWorker) saveDataAsChunk(reader io.Reader, name string, off
|
|||||||
var fileId, host string
|
var fileId, host string
|
||||||
var auth security.EncodedJwt
|
var auth security.EncodedJwt
|
||||||
|
|
||||||
if flushErr := pb.WithGrpcFilerClient(worker.filerAddress, worker.options.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
if flushErr := pb.WithGrpcFilerClient(false, worker.filerAddress, worker.options.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||||
|
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ type FilerMetaBackupOptions struct {
|
|||||||
restart *bool
|
restart *bool
|
||||||
backupFilerConfig *string
|
backupFilerConfig *string
|
||||||
|
|
||||||
store filer.FilerStore
|
store filer.FilerStore
|
||||||
|
clientId int32
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -36,6 +37,7 @@ func init() {
|
|||||||
metaBackup.filerDirectory = cmdFilerMetaBackup.Flag.String("filerDir", "/", "a folder on the filer")
|
metaBackup.filerDirectory = cmdFilerMetaBackup.Flag.String("filerDir", "/", "a folder on the filer")
|
||||||
metaBackup.restart = cmdFilerMetaBackup.Flag.Bool("restart", false, "copy the full metadata before async incremental backup")
|
metaBackup.restart = cmdFilerMetaBackup.Flag.Bool("restart", false, "copy the full metadata before async incremental backup")
|
||||||
metaBackup.backupFilerConfig = cmdFilerMetaBackup.Flag.String("config", "", "path to filer.toml specifying backup filer store")
|
metaBackup.backupFilerConfig = cmdFilerMetaBackup.Flag.String("config", "", "path to filer.toml specifying backup filer store")
|
||||||
|
metaBackup.clientId = util.RandomInt32()
|
||||||
}
|
}
|
||||||
|
|
||||||
var cmdFilerMetaBackup = &Command{
|
var cmdFilerMetaBackup = &Command{
|
||||||
@@ -160,24 +162,21 @@ func (metaBackup *FilerMetaBackupOptions) streamMetadataBackup() error {
|
|||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
message := resp.EventNotification
|
message := resp.EventNotification
|
||||||
|
|
||||||
if message.OldEntry == nil && message.NewEntry == nil {
|
if filer_pb.IsEmpty(resp) {
|
||||||
return nil
|
return nil
|
||||||
}
|
} else if filer_pb.IsCreate(resp) {
|
||||||
if message.OldEntry == nil && message.NewEntry != nil {
|
|
||||||
println("+", util.FullPath(message.NewParentPath).Child(message.NewEntry.Name))
|
println("+", util.FullPath(message.NewParentPath).Child(message.NewEntry.Name))
|
||||||
entry := filer.FromPbEntry(message.NewParentPath, message.NewEntry)
|
entry := filer.FromPbEntry(message.NewParentPath, message.NewEntry)
|
||||||
return store.InsertEntry(ctx, entry)
|
return store.InsertEntry(ctx, entry)
|
||||||
}
|
} else if filer_pb.IsDelete(resp) {
|
||||||
if message.OldEntry != nil && message.NewEntry == nil {
|
|
||||||
println("-", util.FullPath(resp.Directory).Child(message.OldEntry.Name))
|
println("-", util.FullPath(resp.Directory).Child(message.OldEntry.Name))
|
||||||
return store.DeleteEntry(ctx, util.FullPath(resp.Directory).Child(message.OldEntry.Name))
|
return store.DeleteEntry(ctx, util.FullPath(resp.Directory).Child(message.OldEntry.Name))
|
||||||
}
|
} else if filer_pb.IsUpdate(resp) {
|
||||||
if message.OldEntry != nil && message.NewEntry != nil {
|
println("~", util.FullPath(message.NewParentPath).Child(message.NewEntry.Name))
|
||||||
if resp.Directory == message.NewParentPath && message.OldEntry.Name == message.NewEntry.Name {
|
entry := filer.FromPbEntry(message.NewParentPath, message.NewEntry)
|
||||||
println("~", util.FullPath(message.NewParentPath).Child(message.NewEntry.Name))
|
return store.UpdateEntry(ctx, entry)
|
||||||
entry := filer.FromPbEntry(message.NewParentPath, message.NewEntry)
|
} else {
|
||||||
return store.UpdateEntry(ctx, entry)
|
// renaming
|
||||||
}
|
|
||||||
println("-", util.FullPath(resp.Directory).Child(message.OldEntry.Name))
|
println("-", util.FullPath(resp.Directory).Child(message.OldEntry.Name))
|
||||||
if err := store.DeleteEntry(ctx, util.FullPath(resp.Directory).Child(message.OldEntry.Name)); err != nil {
|
if err := store.DeleteEntry(ctx, util.FullPath(resp.Directory).Child(message.OldEntry.Name)); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -195,7 +194,7 @@ func (metaBackup *FilerMetaBackupOptions) streamMetadataBackup() error {
|
|||||||
return metaBackup.setOffset(lastTime)
|
return metaBackup.setOffset(lastTime)
|
||||||
})
|
})
|
||||||
|
|
||||||
return pb.FollowMetadata(pb.ServerAddress(*metaBackup.filerAddress), metaBackup.grpcDialOption, "meta_backup",
|
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, processEventFnWithOffset, false)
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -222,9 +221,9 @@ func (metaBackup *FilerMetaBackupOptions) setOffset(lastWriteTime time.Time) err
|
|||||||
|
|
||||||
var _ = filer_pb.FilerClient(&FilerMetaBackupOptions{})
|
var _ = filer_pb.FilerClient(&FilerMetaBackupOptions{})
|
||||||
|
|
||||||
func (metaBackup *FilerMetaBackupOptions) WithFilerClient(fn func(filer_pb.SeaweedFilerClient) error) error {
|
func (metaBackup *FilerMetaBackupOptions) WithFilerClient(streamingMode bool, fn func(filer_pb.SeaweedFilerClient) error) error {
|
||||||
|
|
||||||
return pb.WithFilerClient(pb.ServerAddress(*metaBackup.filerAddress), metaBackup.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
return pb.WithFilerClient(streamingMode, pb.ServerAddress(*metaBackup.filerAddress), metaBackup.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||||
return fn(client)
|
return fn(client)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -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"
|
|
||||||
"github.com/olivere/elastic/v7"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -48,6 +45,7 @@ func runFilerMetaTail(cmd *Command, args []string) bool {
|
|||||||
|
|
||||||
util.LoadConfiguration("security", false)
|
util.LoadConfiguration("security", false)
|
||||||
grpcDialOption := security.LoadClientTLS(util.GetViper(), "grpc.client")
|
grpcDialOption := security.LoadClientTLS(util.GetViper(), "grpc.client")
|
||||||
|
clientId := util.RandomInt32()
|
||||||
|
|
||||||
var filterFunc func(dir, fname string) bool
|
var filterFunc func(dir, fname string) bool
|
||||||
if *tailPattern != "" {
|
if *tailPattern != "" {
|
||||||
@@ -73,7 +71,7 @@ func runFilerMetaTail(cmd *Command, args []string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
shouldPrint := func(resp *filer_pb.SubscribeMetadataResponse) bool {
|
shouldPrint := func(resp *filer_pb.SubscribeMetadataResponse) bool {
|
||||||
if resp.EventNotification.OldEntry == nil && resp.EventNotification.NewEntry == nil {
|
if filer_pb.IsEmpty(resp) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if filterFunc == nil {
|
if filterFunc == nil {
|
||||||
@@ -105,7 +103,7 @@ func runFilerMetaTail(cmd *Command, args []string) bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tailErr := pb.FollowMetadata(pb.ServerAddress(*tailFiler), grpcDialOption, "tail",
|
tailErr := pb.FollowMetadata(pb.ServerAddress(*tailFiler), grpcDialOption, "tail", clientId,
|
||||||
*tailTarget, nil, time.Now().Add(-*tailStart).UnixNano(), 0,
|
*tailTarget, nil, time.Now().Add(-*tailStart).UnixNano(), 0,
|
||||||
func(resp *filer_pb.SubscribeMetadataResponse) error {
|
func(resp *filer_pb.SubscribeMetadataResponse) error {
|
||||||
if !shouldPrint(resp) {
|
if !shouldPrint(resp) {
|
||||||
@@ -123,72 +121,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,82 @@
|
|||||||
|
//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"`
|
||||||
|
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,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
|
||||||
|
}
|
||||||
@@ -28,12 +28,13 @@ type RemoteGatewayOptions struct {
|
|||||||
mappings *remote_pb.RemoteStorageMapping
|
mappings *remote_pb.RemoteStorageMapping
|
||||||
remoteConfs map[string]*remote_pb.RemoteConf
|
remoteConfs map[string]*remote_pb.RemoteConf
|
||||||
bucketsDir string
|
bucketsDir string
|
||||||
|
clientId int32
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ = filer_pb.FilerClient(&RemoteGatewayOptions{})
|
var _ = filer_pb.FilerClient(&RemoteGatewayOptions{})
|
||||||
|
|
||||||
func (option *RemoteGatewayOptions) WithFilerClient(fn func(filer_pb.SeaweedFilerClient) error) error {
|
func (option *RemoteGatewayOptions) WithFilerClient(streamingMode bool, fn func(filer_pb.SeaweedFilerClient) error) error {
|
||||||
return pb.WithFilerClient(pb.ServerAddress(*option.filerAddress), option.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
return pb.WithFilerClient(streamingMode, pb.ServerAddress(*option.filerAddress), option.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||||
return fn(client)
|
return fn(client)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -54,6 +55,7 @@ func init() {
|
|||||||
remoteGatewayOptions.timeAgo = cmdFilerRemoteGateway.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\"")
|
remoteGatewayOptions.timeAgo = cmdFilerRemoteGateway.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\"")
|
||||||
remoteGatewayOptions.include = cmdFilerRemoteGateway.Flag.String("include", "", "pattens of new bucket names, e.g., s3*")
|
remoteGatewayOptions.include = cmdFilerRemoteGateway.Flag.String("include", "", "pattens of new bucket names, e.g., s3*")
|
||||||
remoteGatewayOptions.exclude = cmdFilerRemoteGateway.Flag.String("exclude", "", "pattens of new bucket names, e.g., local*")
|
remoteGatewayOptions.exclude = cmdFilerRemoteGateway.Flag.String("exclude", "", "pattens of new bucket names, e.g., local*")
|
||||||
|
remoteGatewayOptions.clientId = util.RandomInt32()
|
||||||
}
|
}
|
||||||
|
|
||||||
var cmdFilerRemoteGateway = &Command{
|
var cmdFilerRemoteGateway = &Command{
|
||||||
@@ -87,7 +89,7 @@ func runFilerRemoteGateway(cmd *Command, args []string) bool {
|
|||||||
|
|
||||||
remoteGatewayOptions.bucketsDir = "/buckets"
|
remoteGatewayOptions.bucketsDir = "/buckets"
|
||||||
// check buckets again
|
// check buckets again
|
||||||
remoteGatewayOptions.WithFilerClient(func(filerClient filer_pb.SeaweedFilerClient) error {
|
remoteGatewayOptions.WithFilerClient(false, func(filerClient filer_pb.SeaweedFilerClient) error {
|
||||||
resp, err := filerClient.GetFilerConfiguration(context.Background(), &filer_pb.GetFilerConfigurationRequest{})
|
resp, err := filerClient.GetFilerConfiguration(context.Background(), &filer_pb.GetFilerConfigurationRequest{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@@ -38,7 +38,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",
|
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, processEventFnWithOffset, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,12 +86,26 @@ func (option *RemoteGatewayOptions) makeBucketedEventProcessor(filerSource *sour
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if *option.createBucketRandomSuffix {
|
|
||||||
// https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html
|
bucketPath := util.FullPath(option.bucketsDir).Child(entry.Name)
|
||||||
if len(bucketName)+5 > 63 {
|
remoteLocation, found := option.mappings.Mappings[string(bucketPath)]
|
||||||
bucketName = bucketName[:58]
|
if !found {
|
||||||
|
if *option.createBucketRandomSuffix {
|
||||||
|
// https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html
|
||||||
|
if len(bucketName)+5 > 63 {
|
||||||
|
bucketName = bucketName[:58]
|
||||||
|
}
|
||||||
|
bucketName = fmt.Sprintf("%s-%04d", bucketName, rand.Uint32()%10000)
|
||||||
}
|
}
|
||||||
bucketName = fmt.Sprintf("%s-%4d", bucketName, rand.Uint32()%10000)
|
remoteLocation = &remote_pb.RemoteStorageLocation{
|
||||||
|
Name: *option.createBucketAt,
|
||||||
|
Bucket: bucketName,
|
||||||
|
Path: "/",
|
||||||
|
}
|
||||||
|
// need to add new mapping here before getting updates from metadata tailing
|
||||||
|
option.mappings.Mappings[string(bucketPath)] = remoteLocation
|
||||||
|
} else {
|
||||||
|
bucketName = remoteLocation.Bucket
|
||||||
}
|
}
|
||||||
|
|
||||||
glog.V(0).Infof("create bucket %s", bucketName)
|
glog.V(0).Infof("create bucket %s", bucketName)
|
||||||
@@ -99,16 +113,6 @@ func (option *RemoteGatewayOptions) makeBucketedEventProcessor(filerSource *sour
|
|||||||
return fmt.Errorf("create bucket %s in %s: %v", bucketName, remoteConf.Name, err)
|
return fmt.Errorf("create bucket %s in %s: %v", bucketName, remoteConf.Name, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
bucketPath := util.FullPath(option.bucketsDir).Child(entry.Name)
|
|
||||||
remoteLocation := &remote_pb.RemoteStorageLocation{
|
|
||||||
Name: *option.createBucketAt,
|
|
||||||
Bucket: bucketName,
|
|
||||||
Path: "/",
|
|
||||||
}
|
|
||||||
|
|
||||||
// need to add new mapping here before getting upates from metadata tailing
|
|
||||||
option.mappings.Mappings[string(bucketPath)] = remoteLocation
|
|
||||||
|
|
||||||
return filer.InsertMountMapping(option, string(bucketPath), remoteLocation)
|
return filer.InsertMountMapping(option, string(bucketPath), remoteLocation)
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -170,13 +174,16 @@ func (option *RemoteGatewayOptions) makeBucketedEventProcessor(filerSource *sour
|
|||||||
return handleEtcRemoteChanges(resp)
|
return handleEtcRemoteChanges(resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
if message.OldEntry == nil && message.NewEntry == nil {
|
if filer_pb.IsEmpty(resp) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if message.OldEntry == nil && message.NewEntry != nil {
|
if filer_pb.IsCreate(resp) {
|
||||||
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/") {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
if !filer.HasData(message.NewEntry) {
|
if !filer.HasData(message.NewEntry) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -199,14 +206,13 @@ func (option *RemoteGatewayOptions) makeBucketedEventProcessor(filerSource *sour
|
|||||||
return client.WriteDirectory(dest, message.NewEntry)
|
return client.WriteDirectory(dest, message.NewEntry)
|
||||||
}
|
}
|
||||||
glog.V(0).Infof("create %s", remote_storage.FormatLocation(dest))
|
glog.V(0).Infof("create %s", remote_storage.FormatLocation(dest))
|
||||||
reader := filer.NewFileReader(filerSource, message.NewEntry)
|
remoteEntry, writeErr := retriedWriteFile(client, filerSource, message.NewEntry, dest)
|
||||||
remoteEntry, writeErr := client.WriteFile(dest, message.NewEntry, reader)
|
|
||||||
if writeErr != nil {
|
if writeErr != nil {
|
||||||
return writeErr
|
return writeErr
|
||||||
}
|
}
|
||||||
return updateLocalEntry(&remoteSyncOptions, message.NewParentPath, message.NewEntry, remoteEntry)
|
return updateLocalEntry(&remoteSyncOptions, message.NewParentPath, message.NewEntry, remoteEntry)
|
||||||
}
|
}
|
||||||
if message.OldEntry != nil && message.NewEntry == nil {
|
if filer_pb.IsDelete(resp) {
|
||||||
if resp.Directory == option.bucketsDir {
|
if resp.Directory == option.bucketsDir {
|
||||||
return handleDeleteBucket(message.OldEntry)
|
return handleDeleteBucket(message.OldEntry)
|
||||||
}
|
}
|
||||||
@@ -258,15 +264,13 @@ func (option *RemoteGatewayOptions) makeBucketedEventProcessor(filerSource *sour
|
|||||||
// update directory property
|
// update directory property
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if filer.IsSameData(message.OldEntry, message.NewEntry) {
|
if message.OldEntry.RemoteEntry != nil && filer.IsSameData(message.OldEntry, message.NewEntry) {
|
||||||
glog.V(2).Infof("update meta: %+v", resp)
|
glog.V(2).Infof("update meta: %+v", resp)
|
||||||
oldDest := toRemoteStorageLocation(oldBucket, util.NewFullPath(resp.Directory, message.OldEntry.Name), oldRemoteStorageMountLocation)
|
oldDest := toRemoteStorageLocation(oldBucket, util.NewFullPath(resp.Directory, message.OldEntry.Name), oldRemoteStorageMountLocation)
|
||||||
return client.UpdateFileMetadata(oldDest, message.OldEntry, message.NewEntry)
|
return client.UpdateFileMetadata(oldDest, message.OldEntry, message.NewEntry)
|
||||||
} else {
|
} else {
|
||||||
newDest := toRemoteStorageLocation(newBucket, util.NewFullPath(message.NewParentPath, message.NewEntry.Name), newRemoteStorageMountLocation)
|
newDest := toRemoteStorageLocation(newBucket, util.NewFullPath(message.NewParentPath, message.NewEntry.Name), newRemoteStorageMountLocation)
|
||||||
reader := filer.NewFileReader(filerSource, message.NewEntry)
|
remoteEntry, writeErr := retriedWriteFile(client, filerSource, message.NewEntry, newDest)
|
||||||
glog.V(0).Infof("create %s", remote_storage.FormatLocation(newDest))
|
|
||||||
remoteEntry, writeErr := client.WriteFile(newDest, message.NewEntry, reader)
|
|
||||||
if writeErr != nil {
|
if writeErr != nil {
|
||||||
return writeErr
|
return writeErr
|
||||||
}
|
}
|
||||||
@@ -303,9 +307,7 @@ func (option *RemoteGatewayOptions) makeBucketedEventProcessor(filerSource *sour
|
|||||||
if message.NewEntry.IsDirectory {
|
if message.NewEntry.IsDirectory {
|
||||||
return client.WriteDirectory(newDest, message.NewEntry)
|
return client.WriteDirectory(newDest, message.NewEntry)
|
||||||
}
|
}
|
||||||
reader := filer.NewFileReader(filerSource, message.NewEntry)
|
remoteEntry, writeErr := retriedWriteFile(client, filerSource, message.NewEntry, newDest)
|
||||||
glog.V(0).Infof("create %s", remote_storage.FormatLocation(newDest))
|
|
||||||
remoteEntry, writeErr := client.WriteFile(newDest, message.NewEntry, reader)
|
|
||||||
if writeErr != nil {
|
if writeErr != nil {
|
||||||
return writeErr
|
return writeErr
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,12 +18,13 @@ type RemoteSyncOptions struct {
|
|||||||
readChunkFromFiler *bool
|
readChunkFromFiler *bool
|
||||||
timeAgo *time.Duration
|
timeAgo *time.Duration
|
||||||
dir *string
|
dir *string
|
||||||
|
clientId int32
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ = filer_pb.FilerClient(&RemoteSyncOptions{})
|
var _ = filer_pb.FilerClient(&RemoteSyncOptions{})
|
||||||
|
|
||||||
func (option *RemoteSyncOptions) WithFilerClient(fn func(filer_pb.SeaweedFilerClient) error) error {
|
func (option *RemoteSyncOptions) WithFilerClient(streamingMode bool, fn func(filer_pb.SeaweedFilerClient) error) error {
|
||||||
return pb.WithFilerClient(pb.ServerAddress(*option.filerAddress), option.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
return pb.WithFilerClient(streamingMode, pb.ServerAddress(*option.filerAddress), option.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||||
return fn(client)
|
return fn(client)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -40,7 +41,8 @@ func init() {
|
|||||||
remoteSyncOptions.filerAddress = cmdFilerRemoteSynchronize.Flag.String("filer", "localhost:8888", "filer of the SeaweedFS cluster")
|
remoteSyncOptions.filerAddress = cmdFilerRemoteSynchronize.Flag.String("filer", "localhost:8888", "filer of the SeaweedFS cluster")
|
||||||
remoteSyncOptions.dir = cmdFilerRemoteSynchronize.Flag.String("dir", "", "a mounted directory on filer")
|
remoteSyncOptions.dir = cmdFilerRemoteSynchronize.Flag.String("dir", "", "a mounted directory on filer")
|
||||||
remoteSyncOptions.readChunkFromFiler = cmdFilerRemoteSynchronize.Flag.Bool("filerProxy", false, "read file chunks from filer instead of volume servers")
|
remoteSyncOptions.readChunkFromFiler = cmdFilerRemoteSynchronize.Flag.Bool("filerProxy", false, "read file chunks from filer instead of volume servers")
|
||||||
remoteSyncOptions.timeAgo = cmdFilerRemoteSynchronize.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\"")
|
remoteSyncOptions.timeAgo = cmdFilerRemoteSynchronize.Flag.Duration("timeAgo", 0, "start time before now, skipping previous metadata changes. \"300ms\", \"1.5h\" or \"2h45m\". Valid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\"")
|
||||||
|
remoteSyncOptions.clientId = util.RandomInt32()
|
||||||
}
|
}
|
||||||
|
|
||||||
var cmdFilerRemoteSynchronize = &Command{
|
var cmdFilerRemoteSynchronize = &Command{
|
||||||
@@ -54,6 +56,11 @@ var cmdFilerRemoteSynchronize = &Command{
|
|||||||
|
|
||||||
weed filer.remote.sync -dir=/mount/s3_on_cloud
|
weed filer.remote.sync -dir=/mount/s3_on_cloud
|
||||||
|
|
||||||
|
The metadata sync starting time is determined with the following priority order:
|
||||||
|
1. specified by timeAgo
|
||||||
|
2. last sync timestamp for this directory
|
||||||
|
3. directory creation time
|
||||||
|
|
||||||
`,
|
`,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,10 @@ package command
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/chrislusf/seaweedfs/weed/filer"
|
"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"
|
||||||
@@ -13,9 +17,6 @@ import (
|
|||||||
"github.com/chrislusf/seaweedfs/weed/util"
|
"github.com/chrislusf/seaweedfs/weed/util"
|
||||||
"github.com/golang/protobuf/proto"
|
"github.com/golang/protobuf/proto"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"os"
|
|
||||||
"strings"
|
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func followUpdatesAndUploadToRemote(option *RemoteSyncOptions, filerSource *source.FilerSource, mountedDir string) error {
|
func followUpdatesAndUploadToRemote(option *RemoteSyncOptions, filerSource *source.FilerSource, mountedDir string) error {
|
||||||
@@ -39,7 +40,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",
|
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, processEventFnWithOffset, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,10 +91,10 @@ func makeEventProcessor(remoteStorage *remote_pb.RemoteConf, mountedDir string,
|
|||||||
return handleEtcRemoteChanges(resp)
|
return handleEtcRemoteChanges(resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
if message.OldEntry == nil && message.NewEntry == nil {
|
if filer_pb.IsEmpty(resp) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if message.OldEntry == nil && message.NewEntry != nil {
|
if filer_pb.IsCreate(resp) {
|
||||||
if !filer.HasData(message.NewEntry) {
|
if !filer.HasData(message.NewEntry) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -108,14 +109,13 @@ func makeEventProcessor(remoteStorage *remote_pb.RemoteConf, mountedDir string,
|
|||||||
return client.WriteDirectory(dest, message.NewEntry)
|
return client.WriteDirectory(dest, message.NewEntry)
|
||||||
}
|
}
|
||||||
glog.V(0).Infof("create %s", remote_storage.FormatLocation(dest))
|
glog.V(0).Infof("create %s", remote_storage.FormatLocation(dest))
|
||||||
reader := filer.NewFileReader(filerSource, message.NewEntry)
|
remoteEntry, writeErr := retriedWriteFile(client, filerSource, message.NewEntry, dest)
|
||||||
remoteEntry, writeErr := client.WriteFile(dest, message.NewEntry, reader)
|
|
||||||
if writeErr != nil {
|
if writeErr != nil {
|
||||||
return writeErr
|
return writeErr
|
||||||
}
|
}
|
||||||
return updateLocalEntry(&remoteSyncOptions, message.NewParentPath, message.NewEntry, remoteEntry)
|
return updateLocalEntry(&remoteSyncOptions, message.NewParentPath, message.NewEntry, remoteEntry)
|
||||||
}
|
}
|
||||||
if message.OldEntry != nil && message.NewEntry == nil {
|
if filer_pb.IsDelete(resp) {
|
||||||
glog.V(2).Infof("delete: %+v", resp)
|
glog.V(2).Infof("delete: %+v", resp)
|
||||||
dest := toRemoteStorageLocation(util.FullPath(mountedDir), util.NewFullPath(resp.Directory, message.OldEntry.Name), remoteStorageMountLocation)
|
dest := toRemoteStorageLocation(util.FullPath(mountedDir), util.NewFullPath(resp.Directory, message.OldEntry.Name), remoteStorageMountLocation)
|
||||||
if message.OldEntry.IsDirectory {
|
if message.OldEntry.IsDirectory {
|
||||||
@@ -146,9 +146,7 @@ func makeEventProcessor(remoteStorage *remote_pb.RemoteConf, mountedDir string,
|
|||||||
if err := client.DeleteFile(oldDest); err != nil {
|
if err := client.DeleteFile(oldDest); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
reader := filer.NewFileReader(filerSource, message.NewEntry)
|
remoteEntry, writeErr := retriedWriteFile(client, filerSource, message.NewEntry, dest)
|
||||||
glog.V(0).Infof("create %s", remote_storage.FormatLocation(dest))
|
|
||||||
remoteEntry, writeErr := client.WriteFile(dest, message.NewEntry, reader)
|
|
||||||
if writeErr != nil {
|
if writeErr != nil {
|
||||||
return writeErr
|
return writeErr
|
||||||
}
|
}
|
||||||
@@ -160,6 +158,23 @@ func makeEventProcessor(remoteStorage *remote_pb.RemoteConf, mountedDir string,
|
|||||||
return eachEntryFunc, nil
|
return eachEntryFunc, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func retriedWriteFile(client remote_storage.RemoteStorageClient, filerSource *source.FilerSource, newEntry *filer_pb.Entry, dest *remote_pb.RemoteStorageLocation) (remoteEntry *filer_pb.RemoteEntry, err error) {
|
||||||
|
var writeErr error
|
||||||
|
err = util.Retry("writeFile", func() error {
|
||||||
|
reader := filer.NewFileReader(filerSource, newEntry)
|
||||||
|
glog.V(0).Infof("create %s", remote_storage.FormatLocation(dest))
|
||||||
|
remoteEntry, writeErr = client.WriteFile(dest, newEntry, reader)
|
||||||
|
if writeErr != nil {
|
||||||
|
return writeErr
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
glog.Errorf("write to %s: %v", dest, err)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func collectLastSyncOffset(filerClient filer_pb.FilerClient, grpcDialOption grpc.DialOption, filerAddress pb.ServerAddress, mountedDir string, timeAgo time.Duration) time.Time {
|
func collectLastSyncOffset(filerClient filer_pb.FilerClient, grpcDialOption grpc.DialOption, filerAddress pb.ServerAddress, mountedDir string, timeAgo time.Duration) time.Time {
|
||||||
// 1. specified by timeAgo
|
// 1. specified by timeAgo
|
||||||
// 2. last offset timestamp for this directory
|
// 2. last offset timestamp for this directory
|
||||||
@@ -212,7 +227,7 @@ func shouldSendToRemote(entry *filer_pb.Entry) bool {
|
|||||||
func updateLocalEntry(filerClient filer_pb.FilerClient, dir string, entry *filer_pb.Entry, remoteEntry *filer_pb.RemoteEntry) error {
|
func updateLocalEntry(filerClient filer_pb.FilerClient, dir string, entry *filer_pb.Entry, remoteEntry *filer_pb.RemoteEntry) error {
|
||||||
remoteEntry.LastLocalSyncTsNs = time.Now().UnixNano()
|
remoteEntry.LastLocalSyncTsNs = time.Now().UnixNano()
|
||||||
entry.RemoteEntry = remoteEntry
|
entry.RemoteEntry = remoteEntry
|
||||||
return filerClient.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error {
|
return filerClient.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error {
|
||||||
_, err := client.UpdateEntry(context.Background(), &filer_pb.UpdateEntryRequest{
|
_, err := client.UpdateEntry(context.Background(), &filer_pb.UpdateEntryRequest{
|
||||||
Directory: dir,
|
Directory: dir,
|
||||||
Entry: entry,
|
Entry: entry,
|
||||||
|
|||||||
+19
-11
@@ -37,6 +37,7 @@ type SyncOptions struct {
|
|||||||
bDebug *bool
|
bDebug *bool
|
||||||
aProxyByFiler *bool
|
aProxyByFiler *bool
|
||||||
bProxyByFiler *bool
|
bProxyByFiler *bool
|
||||||
|
clientId int32
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -66,6 +67,7 @@ func init() {
|
|||||||
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")
|
||||||
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.clientId = util.RandomInt32()
|
||||||
}
|
}
|
||||||
|
|
||||||
var cmdFilerSynchronize = &Command{
|
var cmdFilerSynchronize = &Command{
|
||||||
@@ -97,7 +99,7 @@ func runFilerSynchronize(cmd *Command, args []string) bool {
|
|||||||
filerB := pb.ServerAddress(*syncOptions.filerB)
|
filerB := pb.ServerAddress(*syncOptions.filerB)
|
||||||
go func() {
|
go func() {
|
||||||
for {
|
for {
|
||||||
err := doSubscribeFilerMetaChanges(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)
|
||||||
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)
|
||||||
@@ -109,7 +111,7 @@ func runFilerSynchronize(cmd *Command, args []string) bool {
|
|||||||
if !*syncOptions.isActivePassive {
|
if !*syncOptions.isActivePassive {
|
||||||
go func() {
|
go func() {
|
||||||
for {
|
for {
|
||||||
err := doSubscribeFilerMetaChanges(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)
|
||||||
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)
|
||||||
@@ -124,7 +126,7 @@ func runFilerSynchronize(cmd *Command, args []string) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func doSubscribeFilerMetaChanges(grpcDialOption grpc.DialOption, sourceFiler pb.ServerAddress, sourcePath string, sourceReadChunkFromFiler bool, targetFiler pb.ServerAddress, targetPath string,
|
func doSubscribeFilerMetaChanges(clientId int32, grpcDialOption grpc.DialOption, sourceFiler pb.ServerAddress, sourcePath string, sourceReadChunkFromFiler bool, targetFiler pb.ServerAddress, targetPath string,
|
||||||
replicationStr, collection string, ttlSec int, sinkWriteChunkByFiler bool, diskType string, debug bool) error {
|
replicationStr, collection string, ttlSec int, sinkWriteChunkByFiler bool, diskType string, debug bool) error {
|
||||||
|
|
||||||
// read source filer signature
|
// read source filer signature
|
||||||
@@ -167,12 +169,15 @@ func doSubscribeFilerMetaChanges(grpcDialOption grpc.DialOption, sourceFiler pb.
|
|||||||
return persistEventFn(resp)
|
return persistEventFn(resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var lastLogTsNs = time.Now().Nanosecond()
|
||||||
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 {
|
||||||
glog.V(0).Infof("sync %s to %s progressed to %v %0.2f/sec", sourceFiler, targetFiler, time.Unix(0, lastTsNs), float64(counter)/float64(3))
|
now := time.Now().Nanosecond()
|
||||||
|
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
|
||||||
return setOffset(grpcDialOption, targetFiler, SyncKeyPrefix, sourceFilerSignature, lastTsNs)
|
return setOffset(grpcDialOption, targetFiler, SyncKeyPrefix, sourceFilerSignature, lastTsNs)
|
||||||
})
|
})
|
||||||
|
|
||||||
return pb.FollowMetadata(sourceFiler, grpcDialOption, "syncTo_"+string(targetFiler),
|
return pb.FollowMetadata(sourceFiler, grpcDialOption, "syncTo_"+string(targetFiler), clientId,
|
||||||
sourcePath, nil, sourceFilerOffsetTsNs, targetFilerSignature, processEventFnWithOffset, false)
|
sourcePath, nil, sourceFilerOffsetTsNs, targetFilerSignature, processEventFnWithOffset, false)
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -183,7 +188,7 @@ const (
|
|||||||
|
|
||||||
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(filer, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
readErr = pb.WithFilerClient(false, filer, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||||
syncKey := []byte(signaturePrefix + "____")
|
syncKey := []byte(signaturePrefix + "____")
|
||||||
util.Uint32toBytes(syncKey[len(signaturePrefix):len(signaturePrefix)+4], uint32(signature))
|
util.Uint32toBytes(syncKey[len(signaturePrefix):len(signaturePrefix)+4], uint32(signature))
|
||||||
|
|
||||||
@@ -209,7 +214,7 @@ func getOffset(grpcDialOption grpc.DialOption, filer pb.ServerAddress, signature
|
|||||||
}
|
}
|
||||||
|
|
||||||
func setOffset(grpcDialOption grpc.DialOption, filer pb.ServerAddress, signaturePrefix string, signature int32, offsetTsNs int64) error {
|
func setOffset(grpcDialOption grpc.DialOption, filer pb.ServerAddress, signaturePrefix string, signature int32, offsetTsNs int64) error {
|
||||||
return pb.WithFilerClient(filer, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
return pb.WithFilerClient(false, filer, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||||
|
|
||||||
syncKey := []byte(signaturePrefix + "____")
|
syncKey := []byte(signaturePrefix + "____")
|
||||||
util.Uint32toBytes(syncKey[len(signaturePrefix):len(signaturePrefix)+4], uint32(signature))
|
util.Uint32toBytes(syncKey[len(signaturePrefix):len(signaturePrefix)+4], uint32(signature))
|
||||||
@@ -257,16 +262,19 @@ func genProcessFunction(sourcePath string, targetPath string, dataSink sink.Repl
|
|||||||
}
|
}
|
||||||
|
|
||||||
// handle deletions
|
// handle deletions
|
||||||
if message.OldEntry != nil && message.NewEntry == nil {
|
if filer_pb.IsDelete(resp) {
|
||||||
if !strings.HasPrefix(string(sourceOldKey), sourcePath) {
|
if !strings.HasPrefix(string(sourceOldKey), sourcePath) {
|
||||||
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
|
||||||
if message.OldEntry == nil && message.NewEntry != nil {
|
if filer_pb.IsCreate(resp) {
|
||||||
if !strings.HasPrefix(string(sourceNewKey), sourcePath) {
|
if !strings.HasPrefix(string(sourceNewKey), sourcePath) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -275,7 +283,7 @@ func genProcessFunction(sourcePath string, targetPath string, dataSink sink.Repl
|
|||||||
}
|
}
|
||||||
|
|
||||||
// this is something special?
|
// this is something special?
|
||||||
if message.OldEntry == nil && message.NewEntry == nil {
|
if filer_pb.IsEmpty(resp) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+59
-18
@@ -1,9 +1,12 @@
|
|||||||
package command
|
package command
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
"io/fs"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/chrislusf/seaweedfs/weed/glog"
|
"github.com/chrislusf/seaweedfs/weed/glog"
|
||||||
"github.com/chrislusf/seaweedfs/weed/storage"
|
"github.com/chrislusf/seaweedfs/weed/storage"
|
||||||
@@ -19,17 +22,15 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var cmdFix = &Command{
|
var cmdFix = &Command{
|
||||||
UsageLine: "fix -dir=/tmp -volumeId=234",
|
UsageLine: "fix [-volumeId=234] [-collection=bigData] /tmp",
|
||||||
Short: "run weed tool fix on index file if corrupted",
|
Short: "run weed tool fix on files or whole folders to recreate index file(s) if corrupted",
|
||||||
Long: `Fix runs the SeaweedFS fix command to re-create the index .idx file.
|
Long: `Fix runs the SeaweedFS fix command on dat files or whole folders to re-create the index .idx file.
|
||||||
|
|
||||||
`,
|
`,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
fixVolumePath = cmdFix.Flag.String("dir", ".", "data directory to store files")
|
fixVolumeCollection = cmdFix.Flag.String("collection", "", "an optional volume collection name, if specified only it will be processed")
|
||||||
fixVolumeCollection = cmdFix.Flag.String("collection", "", "the volume collection name")
|
fixVolumeId = cmdFix.Flag.Int64("volumeId", 0, "an optional volume id, if not 0 (default) only it will be processed")
|
||||||
fixVolumeId = cmdFix.Flag.Int("volumeId", -1, "a volume id. The volume should already exist in the dir. The volume index file should not exist.")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type VolumeFileScanner4Fix struct {
|
type VolumeFileScanner4Fix struct {
|
||||||
@@ -59,26 +60,68 @@ func (scanner *VolumeFileScanner4Fix) VisitNeedle(n *needle.Needle, offset int64
|
|||||||
}
|
}
|
||||||
|
|
||||||
func runFix(cmd *Command, args []string) bool {
|
func runFix(cmd *Command, args []string) bool {
|
||||||
|
for _, arg := range args {
|
||||||
|
basePath, f := path.Split(util.ResolvePath(arg))
|
||||||
|
|
||||||
if *fixVolumeId == -1 {
|
files := []fs.DirEntry{}
|
||||||
return false
|
if f == "" {
|
||||||
}
|
fileInfo, err := os.ReadDir(basePath)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
files = fileInfo
|
||||||
|
} else {
|
||||||
|
fileInfo, err := os.Stat(basePath + f)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
files = []fs.DirEntry{fs.FileInfoToDirEntry(fileInfo)}
|
||||||
|
}
|
||||||
|
|
||||||
baseFileName := strconv.Itoa(*fixVolumeId)
|
for _, file := range files {
|
||||||
if *fixVolumeCollection != "" {
|
if !strings.HasSuffix(file.Name(), ".dat") {
|
||||||
baseFileName = *fixVolumeCollection + "_" + baseFileName
|
continue
|
||||||
|
}
|
||||||
|
if *fixVolumeCollection != "" {
|
||||||
|
if !strings.HasPrefix(file.Name(), *fixVolumeCollection+"_") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
baseFileName := file.Name()[:len(file.Name())-4]
|
||||||
|
collection, volumeIdStr := "", baseFileName
|
||||||
|
if sepIndex := strings.LastIndex(baseFileName, "_"); sepIndex > 0 {
|
||||||
|
collection = baseFileName[:sepIndex]
|
||||||
|
volumeIdStr = baseFileName[sepIndex+1:]
|
||||||
|
}
|
||||||
|
volumeId, parseErr := strconv.ParseInt(volumeIdStr, 10, 64)
|
||||||
|
if parseErr != nil {
|
||||||
|
fmt.Printf("Failed to parse volume id from %s: %v\n", baseFileName, parseErr)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if *fixVolumeId != 0 && *fixVolumeId != volumeId {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
doFixOneVolume(basePath, baseFileName, collection, volumeId)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
indexFileName := path.Join(util.ResolvePath(*fixVolumePath), baseFileName+".idx")
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func doFixOneVolume(basepath string, baseFileName string, collection string, volumeId int64) {
|
||||||
|
|
||||||
|
indexFileName := path.Join(basepath, baseFileName+".idx")
|
||||||
|
|
||||||
nm := needle_map.NewMemDb()
|
nm := needle_map.NewMemDb()
|
||||||
defer nm.Close()
|
defer nm.Close()
|
||||||
|
|
||||||
vid := needle.VolumeId(*fixVolumeId)
|
vid := needle.VolumeId(volumeId)
|
||||||
scanner := &VolumeFileScanner4Fix{
|
scanner := &VolumeFileScanner4Fix{
|
||||||
nm: nm,
|
nm: nm,
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := storage.ScanVolumeFile(util.ResolvePath(*fixVolumePath), *fixVolumeCollection, vid, storage.NeedleMapInMemory, scanner); err != nil {
|
if err := storage.ScanVolumeFile(basepath, collection, vid, storage.NeedleMapInMemory, scanner); err != nil {
|
||||||
glog.Fatalf("scan .dat File: %v", err)
|
glog.Fatalf("scan .dat File: %v", err)
|
||||||
os.Remove(indexFileName)
|
os.Remove(indexFileName)
|
||||||
}
|
}
|
||||||
@@ -87,6 +130,4 @@ func runFix(cmd *Command, args []string) bool {
|
|||||||
glog.Fatalf("save to .idx File: %v", err)
|
glog.Fatalf("save to .idx File: %v", err)
|
||||||
os.Remove(indexFileName)
|
os.Remove(indexFileName)
|
||||||
}
|
}
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
+12
-3
@@ -22,6 +22,7 @@ var (
|
|||||||
type IamOptions struct {
|
type IamOptions struct {
|
||||||
filer *string
|
filer *string
|
||||||
masters *string
|
masters *string
|
||||||
|
ip *string
|
||||||
port *int
|
port *int
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,6 +30,7 @@ func init() {
|
|||||||
cmdIam.Run = runIam // break init cycle
|
cmdIam.Run = runIam // break init cycle
|
||||||
iamStandaloneOptions.filer = cmdIam.Flag.String("filer", "localhost:8888", "filer server address")
|
iamStandaloneOptions.filer = cmdIam.Flag.String("filer", "localhost:8888", "filer server address")
|
||||||
iamStandaloneOptions.masters = cmdIam.Flag.String("master", "localhost:9333", "comma-separated master servers")
|
iamStandaloneOptions.masters = cmdIam.Flag.String("master", "localhost:9333", "comma-separated master servers")
|
||||||
|
iamStandaloneOptions.ip = cmdIam.Flag.String("ip", util.DetectedHostAddress(), "iam server http listen ip address")
|
||||||
iamStandaloneOptions.port = cmdIam.Flag.Int("port", 8111, "iam server http listen port")
|
iamStandaloneOptions.port = cmdIam.Flag.Int("port", 8111, "iam server http listen port")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,7 +50,7 @@ func (iamopt *IamOptions) startIamServer() bool {
|
|||||||
util.LoadConfiguration("security", false)
|
util.LoadConfiguration("security", false)
|
||||||
grpcDialOption := security.LoadClientTLS(util.GetViper(), "grpc.client")
|
grpcDialOption := security.LoadClientTLS(util.GetViper(), "grpc.client")
|
||||||
for {
|
for {
|
||||||
err := pb.WithGrpcFilerClient(filerAddress, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
err := pb.WithGrpcFilerClient(false, filerAddress, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||||
resp, err := client.GetFilerConfiguration(context.Background(), &filer_pb.GetFilerConfigurationRequest{})
|
resp, err := client.GetFilerConfiguration(context.Background(), &filer_pb.GetFilerConfigurationRequest{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("get filer %s configuration: %v", filerAddress, err)
|
return fmt.Errorf("get filer %s configuration: %v", filerAddress, err)
|
||||||
@@ -65,7 +67,7 @@ func (iamopt *IamOptions) startIamServer() bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
masters := pb.ServerAddresses(*iamopt.masters).ToAddresses()
|
masters := pb.ServerAddresses(*iamopt.masters).ToAddressMap()
|
||||||
router := mux.NewRouter().SkipClean(true)
|
router := mux.NewRouter().SkipClean(true)
|
||||||
_, iamApiServer_err := iamapi.NewIamApiServer(router, &iamapi.IamServerOption{
|
_, iamApiServer_err := iamapi.NewIamApiServer(router, &iamapi.IamServerOption{
|
||||||
Masters: masters,
|
Masters: masters,
|
||||||
@@ -81,12 +83,19 @@ func (iamopt *IamOptions) startIamServer() bool {
|
|||||||
httpS := &http.Server{Handler: router}
|
httpS := &http.Server{Handler: router}
|
||||||
|
|
||||||
listenAddress := fmt.Sprintf(":%d", *iamopt.port)
|
listenAddress := fmt.Sprintf(":%d", *iamopt.port)
|
||||||
iamApiListener, err := util.NewListener(listenAddress, time.Duration(10)*time.Second)
|
iamApiListener, iamApiLocalListener, err := util.NewIpAndLocalListeners(*iamopt.ip, *iamopt.port, time.Duration(10)*time.Second)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Fatalf("IAM API Server listener on %s error: %v", listenAddress, err)
|
glog.Fatalf("IAM API Server listener on %s error: %v", listenAddress, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
glog.V(0).Infof("Start Seaweed IAM API Server %s at http port %d", util.Version(), *iamopt.port)
|
glog.V(0).Infof("Start Seaweed IAM API Server %s at http port %d", util.Version(), *iamopt.port)
|
||||||
|
if iamApiLocalListener != nil {
|
||||||
|
go func() {
|
||||||
|
if err = httpS.Serve(iamApiLocalListener); err != nil {
|
||||||
|
glog.Errorf("IAM API Server Fail to serve: %v", err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
}
|
||||||
if err = httpS.Serve(iamApiListener); err != nil {
|
if err = httpS.Serve(iamApiListener); err != nil {
|
||||||
glog.Fatalf("IAM API Server Fail to serve: %v", err)
|
glog.Fatalf("IAM API Server Fail to serve: %v", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,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 +32,5 @@ 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/ydb"
|
||||||
)
|
)
|
||||||
+109
-24
@@ -1,22 +1,25 @@
|
|||||||
package command
|
package command
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/chrislusf/raft/protobuf"
|
"golang.org/x/exp/slices"
|
||||||
"github.com/gorilla/mux"
|
|
||||||
"google.golang.org/grpc/reflection"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"sort"
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/chrislusf/raft/protobuf"
|
||||||
|
stats_collect "github.com/chrislusf/seaweedfs/weed/stats"
|
||||||
|
"github.com/gorilla/mux"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
"google.golang.org/grpc/reflection"
|
||||||
|
|
||||||
"github.com/chrislusf/seaweedfs/weed/util/grace"
|
"github.com/chrislusf/seaweedfs/weed/util/grace"
|
||||||
|
|
||||||
"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/master_pb"
|
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
|
||||||
"github.com/chrislusf/seaweedfs/weed/security"
|
"github.com/chrislusf/seaweedfs/weed/security"
|
||||||
"github.com/chrislusf/seaweedfs/weed/server"
|
weed_server "github.com/chrislusf/seaweedfs/weed/server"
|
||||||
"github.com/chrislusf/seaweedfs/weed/storage/backend"
|
"github.com/chrislusf/seaweedfs/weed/storage/backend"
|
||||||
"github.com/chrislusf/seaweedfs/weed/util"
|
"github.com/chrislusf/seaweedfs/weed/util"
|
||||||
)
|
)
|
||||||
@@ -42,6 +45,11 @@ type MasterOptions struct {
|
|||||||
metricsAddress *string
|
metricsAddress *string
|
||||||
metricsIntervalSec *int
|
metricsIntervalSec *int
|
||||||
raftResumeState *bool
|
raftResumeState *bool
|
||||||
|
metricsHttpPort *int
|
||||||
|
heartbeatInterval *time.Duration
|
||||||
|
electionTimeout *time.Duration
|
||||||
|
raftHashicorp *bool
|
||||||
|
raftBootstrap *bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -49,7 +57,7 @@ func init() {
|
|||||||
m.port = cmdMaster.Flag.Int("port", 9333, "http listen port")
|
m.port = cmdMaster.Flag.Int("port", 9333, "http listen port")
|
||||||
m.portGrpc = cmdMaster.Flag.Int("port.grpc", 0, "grpc listen port")
|
m.portGrpc = cmdMaster.Flag.Int("port.grpc", 0, "grpc listen port")
|
||||||
m.ip = cmdMaster.Flag.String("ip", util.DetectedHostAddress(), "master <ip>|<server> address, also used as identifier")
|
m.ip = cmdMaster.Flag.String("ip", util.DetectedHostAddress(), "master <ip>|<server> address, also used as identifier")
|
||||||
m.ipBind = cmdMaster.Flag.String("ip.bind", "", "ip address to bind to")
|
m.ipBind = cmdMaster.Flag.String("ip.bind", "", "ip address to bind to. If empty, default to same as -ip option.")
|
||||||
m.metaFolder = cmdMaster.Flag.String("mdir", os.TempDir(), "data directory to store meta data")
|
m.metaFolder = cmdMaster.Flag.String("mdir", os.TempDir(), "data directory to store meta data")
|
||||||
m.peers = cmdMaster.Flag.String("peers", "", "all master nodes in comma separated ip:port list, example: 127.0.0.1:9093,127.0.0.1:9094,127.0.0.1:9095")
|
m.peers = cmdMaster.Flag.String("peers", "", "all master nodes in comma separated ip:port list, example: 127.0.0.1:9093,127.0.0.1:9094,127.0.0.1:9095")
|
||||||
m.volumeSizeLimitMB = cmdMaster.Flag.Uint("volumeSizeLimitMB", 30*1000, "Master stops directing writes to oversized volumes.")
|
m.volumeSizeLimitMB = cmdMaster.Flag.Uint("volumeSizeLimitMB", 30*1000, "Master stops directing writes to oversized volumes.")
|
||||||
@@ -61,7 +69,12 @@ func init() {
|
|||||||
m.disableHttp = cmdMaster.Flag.Bool("disableHttp", false, "disable http requests, only gRPC operations are allowed.")
|
m.disableHttp = cmdMaster.Flag.Bool("disableHttp", false, "disable http requests, only gRPC operations are allowed.")
|
||||||
m.metricsAddress = cmdMaster.Flag.String("metrics.address", "", "Prometheus gateway address <host>:<port>")
|
m.metricsAddress = cmdMaster.Flag.String("metrics.address", "", "Prometheus gateway address <host>:<port>")
|
||||||
m.metricsIntervalSec = cmdMaster.Flag.Int("metrics.intervalSeconds", 15, "Prometheus push interval in seconds")
|
m.metricsIntervalSec = cmdMaster.Flag.Int("metrics.intervalSeconds", 15, "Prometheus push interval in seconds")
|
||||||
|
m.metricsHttpPort = cmdMaster.Flag.Int("metricsPort", 0, "Prometheus metrics listen port")
|
||||||
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.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{
|
||||||
@@ -104,6 +117,7 @@ func runMaster(cmd *Command, args []string) bool {
|
|||||||
glog.Fatalf("volumeSizeLimitMB should be smaller than 30000")
|
glog.Fatalf("volumeSizeLimitMB should be smaller than 30000")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
go stats_collect.StartMetricsServer(*m.metricsHttpPort)
|
||||||
startMaster(m, masterWhiteList)
|
startMaster(m, masterWhiteList)
|
||||||
|
|
||||||
return true
|
return true
|
||||||
@@ -116,52 +130,123 @@ func startMaster(masterOption MasterOptions, masterWhiteList []string) {
|
|||||||
if *masterOption.portGrpc == 0 {
|
if *masterOption.portGrpc == 0 {
|
||||||
*masterOption.portGrpc = 10000 + *masterOption.port
|
*masterOption.portGrpc = 10000 + *masterOption.port
|
||||||
}
|
}
|
||||||
|
if *masterOption.ipBind == "" {
|
||||||
|
*masterOption.ipBind = *masterOption.ip
|
||||||
|
}
|
||||||
|
|
||||||
myMasterAddress, peers := checkPeers(*masterOption.ip, *masterOption.port, *masterOption.portGrpc, *masterOption.peers)
|
myMasterAddress, peers := checkPeers(*masterOption.ip, *masterOption.port, *masterOption.portGrpc, *masterOption.peers)
|
||||||
|
|
||||||
|
masterPeers := make(map[string]pb.ServerAddress)
|
||||||
|
for _, peer := range peers {
|
||||||
|
masterPeers[string(peer)] = peer
|
||||||
|
}
|
||||||
|
|
||||||
r := mux.NewRouter()
|
r := mux.NewRouter()
|
||||||
ms := weed_server.NewMasterServer(r, masterOption.toMasterOption(masterWhiteList), peers)
|
ms := weed_server.NewMasterServer(r, masterOption.toMasterOption(masterWhiteList), masterPeers)
|
||||||
listeningAddress := util.JoinHostPort(*masterOption.ipBind, *masterOption.port)
|
listeningAddress := util.JoinHostPort(*masterOption.ipBind, *masterOption.port)
|
||||||
glog.V(0).Infof("Start Seaweed Master %s at %s", util.Version(), listeningAddress)
|
glog.V(0).Infof("Start Seaweed Master %s at %s", util.Version(), listeningAddress)
|
||||||
masterListener, e := util.NewListener(listeningAddress, 0)
|
masterListener, masterLocalListner, e := util.NewIpAndLocalListeners(*masterOption.ipBind, *masterOption.port, 0)
|
||||||
if e != nil {
|
if e != nil {
|
||||||
glog.Fatalf("Master startup error: %v", e)
|
glog.Fatalf("Master startup error: %v", e)
|
||||||
}
|
}
|
||||||
|
|
||||||
// start raftServer
|
// start raftServer
|
||||||
raftServer, err := weed_server.NewRaftServer(security.LoadClientTLS(util.GetViper(), "grpc.master"),
|
raftServerOption := &weed_server.RaftServerOption{
|
||||||
peers, myMasterAddress, util.ResolvePath(*masterOption.metaFolder), ms.Topo, *masterOption.raftResumeState)
|
GrpcDialOption: security.LoadClientTLS(util.GetViper(), "grpc.master"),
|
||||||
if raftServer == nil {
|
Peers: masterPeers,
|
||||||
glog.Fatalf("please verify %s is writable, see https://github.com/chrislusf/seaweedfs/issues/717: %s", *masterOption.metaFolder, err)
|
ServerAddr: myMasterAddress,
|
||||||
|
DataDir: util.ResolvePath(*masterOption.metaFolder),
|
||||||
|
Topo: ms.Topo,
|
||||||
|
RaftResumeState: *masterOption.raftResumeState,
|
||||||
|
HeartbeatInterval: *masterOption.heartbeatInterval,
|
||||||
|
ElectionTimeout: *masterOption.electionTimeout,
|
||||||
|
RaftBootstrap: *m.raftBootstrap,
|
||||||
|
}
|
||||||
|
var raftServer *weed_server.RaftServer
|
||||||
|
var err error
|
||||||
|
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, err := util.NewListener(util.JoinHostPort(*masterOption.ipBind, grpcPort), 0)
|
grpcL, grpcLocalL, err := util.NewIpAndLocalListeners(*masterOption.ipBind, grpcPort, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Fatalf("master failed to listen on grpc port %d: %v", grpcPort, err)
|
glog.Fatalf("master failed to listen on grpc port %d: %v", grpcPort, err)
|
||||||
}
|
}
|
||||||
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 {
|
||||||
|
go grpcS.Serve(grpcLocalL)
|
||||||
|
}
|
||||||
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()
|
||||||
|
|
||||||
// start http server
|
// start http server
|
||||||
|
var (
|
||||||
|
clientCertFile,
|
||||||
|
certFile,
|
||||||
|
keyFile string
|
||||||
|
)
|
||||||
|
useTLS := false
|
||||||
|
useMTLS := false
|
||||||
|
|
||||||
|
if viper.GetString("https.master.key") != "" {
|
||||||
|
useTLS = true
|
||||||
|
certFile = viper.GetString("https.master.cert")
|
||||||
|
keyFile = viper.GetString("https.master.key")
|
||||||
|
}
|
||||||
|
|
||||||
|
if viper.GetString("https.master.ca") != "" {
|
||||||
|
useMTLS = true
|
||||||
|
clientCertFile = viper.GetString("https.master.ca")
|
||||||
|
}
|
||||||
|
|
||||||
httpS := &http.Server{Handler: r}
|
httpS := &http.Server{Handler: r}
|
||||||
go httpS.Serve(masterListener)
|
if masterLocalListner != nil {
|
||||||
|
go httpS.Serve(masterLocalListner)
|
||||||
|
}
|
||||||
|
|
||||||
|
if useMTLS {
|
||||||
|
httpS.TLSConfig = security.LoadClientTLSHTTP(clientCertFile)
|
||||||
|
}
|
||||||
|
|
||||||
|
if useTLS {
|
||||||
|
go httpS.ServeTLS(masterListener, certFile, keyFile)
|
||||||
|
} else {
|
||||||
|
go httpS.Serve(masterListener)
|
||||||
|
}
|
||||||
|
|
||||||
select {}
|
select {}
|
||||||
}
|
}
|
||||||
@@ -189,8 +274,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
|
||||||
|
|||||||
@@ -3,17 +3,18 @@ package command
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"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/master_pb"
|
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
|
||||||
"github.com/chrislusf/seaweedfs/weed/security"
|
"github.com/chrislusf/seaweedfs/weed/security"
|
||||||
"github.com/chrislusf/seaweedfs/weed/server"
|
weed_server "github.com/chrislusf/seaweedfs/weed/server"
|
||||||
"github.com/chrislusf/seaweedfs/weed/util"
|
"github.com/chrislusf/seaweedfs/weed/util"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"google.golang.org/grpc/reflection"
|
"google.golang.org/grpc/reflection"
|
||||||
"net/http"
|
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -24,7 +25,7 @@ func init() {
|
|||||||
cmdMasterFollower.Run = runMasterFollower // break init cycle
|
cmdMasterFollower.Run = runMasterFollower // break init cycle
|
||||||
mf.port = cmdMasterFollower.Flag.Int("port", 9334, "http listen port")
|
mf.port = cmdMasterFollower.Flag.Int("port", 9334, "http listen port")
|
||||||
mf.portGrpc = cmdMasterFollower.Flag.Int("port.grpc", 0, "grpc listen port")
|
mf.portGrpc = cmdMasterFollower.Flag.Int("port.grpc", 0, "grpc listen port")
|
||||||
mf.ipBind = cmdMasterFollower.Flag.String("ip.bind", "", "ip address to bind to")
|
mf.ipBind = cmdMasterFollower.Flag.String("ip.bind", "", "ip address to bind to. Default to localhost.")
|
||||||
mf.peers = cmdMasterFollower.Flag.String("masters", "localhost:9333", "all master nodes in comma separated ip:port list, example: 127.0.0.1:9093,127.0.0.1:9094,127.0.0.1:9095")
|
mf.peers = cmdMasterFollower.Flag.String("masters", "localhost:9333", "all master nodes in comma separated ip:port list, example: 127.0.0.1:9093,127.0.0.1:9094,127.0.0.1:9095")
|
||||||
|
|
||||||
mf.ip = aws.String(util.DetectedHostAddress())
|
mf.ip = aws.String(util.DetectedHostAddress())
|
||||||
@@ -45,13 +46,13 @@ var cmdMasterFollower = &Command{
|
|||||||
Short: "start a master follower",
|
Short: "start a master follower",
|
||||||
Long: `start a master follower to provide volume=>location mapping service
|
Long: `start a master follower to provide volume=>location mapping service
|
||||||
|
|
||||||
The master follower does not participate in master election.
|
The master follower does not participate in master election.
|
||||||
It just follow the existing masters, and listen for any volume location changes.
|
It just follow the existing masters, and listen for any volume location changes.
|
||||||
|
|
||||||
In most cases, the master follower is not needed. In big data centers with thousands of volume
|
In most cases, the master follower is not needed. In big data centers with thousands of volume
|
||||||
servers. In theory, the master may have trouble to keep up with the write requests and read requests.
|
servers. In theory, the master may have trouble to keep up with the write requests and read requests.
|
||||||
|
|
||||||
The master follower can relieve the master from from read requests, which only needs to
|
The master follower can relieve the master from from read requests, which only needs to
|
||||||
lookup a fileId or volumeId.
|
lookup a fileId or volumeId.
|
||||||
|
|
||||||
The master follower currently can handle fileId lookup requests:
|
The master follower currently can handle fileId lookup requests:
|
||||||
@@ -82,12 +83,12 @@ func runMasterFollower(cmd *Command, args []string) bool {
|
|||||||
func startMasterFollower(masterOptions MasterOptions) {
|
func startMasterFollower(masterOptions MasterOptions) {
|
||||||
|
|
||||||
// collect settings from main masters
|
// collect settings from main masters
|
||||||
masters := pb.ServerAddresses(*mf.peers).ToAddresses()
|
masters := pb.ServerAddresses(*mf.peers).ToAddressMap()
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
grpcDialOption := security.LoadClientTLS(util.GetViper(), "grpc.master")
|
grpcDialOption := security.LoadClientTLS(util.GetViper(), "grpc.master")
|
||||||
for i := 0; i < 10; i++ {
|
for i := 0; i < 10; i++ {
|
||||||
err = pb.WithOneOfGrpcMasterClients(masters, grpcDialOption, func(client master_pb.SeaweedClient) error {
|
err = pb.WithOneOfGrpcMasterClients(false, masters, grpcDialOption, func(client master_pb.SeaweedClient) error {
|
||||||
resp, err := client.GetMasterConfiguration(context.Background(), &master_pb.GetMasterConfigurationRequest{})
|
resp, err := client.GetMasterConfiguration(context.Background(), &master_pb.GetMasterConfigurationRequest{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("get master grpc address %v configuration: %v", masters, err)
|
return fmt.Errorf("get master grpc address %v configuration: %v", masters, err)
|
||||||
@@ -111,18 +112,22 @@ func startMasterFollower(masterOptions MasterOptions) {
|
|||||||
option := masterOptions.toMasterOption(nil)
|
option := masterOptions.toMasterOption(nil)
|
||||||
option.IsFollower = true
|
option.IsFollower = true
|
||||||
|
|
||||||
|
if *masterOptions.ipBind == "" {
|
||||||
|
*masterOptions.ipBind = *masterOptions.ip
|
||||||
|
}
|
||||||
|
|
||||||
r := mux.NewRouter()
|
r := mux.NewRouter()
|
||||||
ms := weed_server.NewMasterServer(r, option, masters)
|
ms := weed_server.NewMasterServer(r, option, masters)
|
||||||
listeningAddress := util.JoinHostPort(*masterOptions.ipBind, *masterOptions.port)
|
listeningAddress := util.JoinHostPort(*masterOptions.ipBind, *masterOptions.port)
|
||||||
glog.V(0).Infof("Start Seaweed Master %s at %s", util.Version(), listeningAddress)
|
glog.V(0).Infof("Start Seaweed Master %s at %s", util.Version(), listeningAddress)
|
||||||
masterListener, e := util.NewListener(listeningAddress, 0)
|
masterListener, masterLocalListner, e := util.NewIpAndLocalListeners(*masterOptions.ipBind, *masterOptions.port, 0)
|
||||||
if e != nil {
|
if e != nil {
|
||||||
glog.Fatalf("Master startup error: %v", e)
|
glog.Fatalf("Master startup error: %v", e)
|
||||||
}
|
}
|
||||||
|
|
||||||
// starting grpc server
|
// starting grpc server
|
||||||
grpcPort := *masterOptions.portGrpc
|
grpcPort := *masterOptions.portGrpc
|
||||||
grpcL, err := util.NewListener(util.JoinHostPort(*masterOptions.ipBind, grpcPort), 0)
|
grpcL, grpcLocalL, err := util.NewIpAndLocalListeners(*masterOptions.ipBind, grpcPort, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Fatalf("master failed to listen on grpc port %d: %v", grpcPort, err)
|
glog.Fatalf("master failed to listen on grpc port %d: %v", grpcPort, err)
|
||||||
}
|
}
|
||||||
@@ -130,12 +135,18 @@ func startMasterFollower(masterOptions MasterOptions) {
|
|||||||
master_pb.RegisterSeaweedServer(grpcS, ms)
|
master_pb.RegisterSeaweedServer(grpcS, ms)
|
||||||
reflection.Register(grpcS)
|
reflection.Register(grpcS)
|
||||||
glog.V(0).Infof("Start Seaweed Master %s grpc server at %s:%d", util.Version(), *masterOptions.ip, grpcPort)
|
glog.V(0).Infof("Start Seaweed Master %s grpc server at %s:%d", util.Version(), *masterOptions.ip, grpcPort)
|
||||||
|
if grpcLocalL != nil {
|
||||||
|
go grpcS.Serve(grpcLocalL)
|
||||||
|
}
|
||||||
go grpcS.Serve(grpcL)
|
go grpcS.Serve(grpcL)
|
||||||
|
|
||||||
go ms.MasterClient.KeepConnectedToMaster()
|
go ms.MasterClient.KeepConnectedToMaster()
|
||||||
|
|
||||||
// start http server
|
// start http server
|
||||||
httpS := &http.Server{Handler: r}
|
httpS := &http.Server{Handler: r}
|
||||||
|
if masterLocalListner != nil {
|
||||||
|
go httpS.Serve(masterLocalListner)
|
||||||
|
}
|
||||||
go httpS.Serve(masterListener)
|
go httpS.Serve(masterListener)
|
||||||
|
|
||||||
select {}
|
select {}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ type MountOptions struct {
|
|||||||
dir *string
|
dir *string
|
||||||
dirAutoCreate *bool
|
dirAutoCreate *bool
|
||||||
collection *string
|
collection *string
|
||||||
|
collectionQuota *int
|
||||||
replication *string
|
replication *string
|
||||||
diskType *string
|
diskType *string
|
||||||
ttlSec *int
|
ttlSec *int
|
||||||
@@ -26,6 +27,9 @@ type MountOptions struct {
|
|||||||
uidMap *string
|
uidMap *string
|
||||||
gidMap *string
|
gidMap *string
|
||||||
readOnly *bool
|
readOnly *bool
|
||||||
|
debug *bool
|
||||||
|
debugPort *int
|
||||||
|
localSocket *string
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -42,13 +46,14 @@ func init() {
|
|||||||
mountOptions.dir = cmdMount.Flag.String("dir", ".", "mount weed filer to this directory")
|
mountOptions.dir = cmdMount.Flag.String("dir", ".", "mount weed filer to this directory")
|
||||||
mountOptions.dirAutoCreate = cmdMount.Flag.Bool("dirAutoCreate", false, "auto create the directory to mount to")
|
mountOptions.dirAutoCreate = cmdMount.Flag.Bool("dirAutoCreate", false, "auto create the directory to mount to")
|
||||||
mountOptions.collection = cmdMount.Flag.String("collection", "", "collection to create the files")
|
mountOptions.collection = cmdMount.Flag.String("collection", "", "collection to create the files")
|
||||||
|
mountOptions.collectionQuota = cmdMount.Flag.Int("collectionQuotaMB", 0, "quota for the collection")
|
||||||
mountOptions.replication = cmdMount.Flag.String("replication", "", "replication(e.g. 000, 001) to create to files. If empty, let filer decide.")
|
mountOptions.replication = cmdMount.Flag.String("replication", "", "replication(e.g. 000, 001) to create to files. If empty, let filer decide.")
|
||||||
mountOptions.diskType = cmdMount.Flag.String("disk", "", "[hdd|ssd|<tag>] hard drive or solid state drive or any tag")
|
mountOptions.diskType = cmdMount.Flag.String("disk", "", "[hdd|ssd|<tag>] hard drive or solid state drive or any tag")
|
||||||
mountOptions.ttlSec = cmdMount.Flag.Int("ttl", 0, "file ttl in seconds")
|
mountOptions.ttlSec = cmdMount.Flag.Int("ttl", 0, "file ttl in seconds")
|
||||||
mountOptions.chunkSizeLimitMB = cmdMount.Flag.Int("chunkSizeLimitMB", 2, "local write buffer size, also chunk large files")
|
mountOptions.chunkSizeLimitMB = cmdMount.Flag.Int("chunkSizeLimitMB", 2, "local write buffer size, also chunk large files")
|
||||||
mountOptions.concurrentWriters = cmdMount.Flag.Int("concurrentWriters", 32, "limit concurrent goroutine writers if not 0")
|
mountOptions.concurrentWriters = cmdMount.Flag.Int("concurrentWriters", 32, "limit concurrent goroutine writers if not 0")
|
||||||
mountOptions.cacheDir = cmdMount.Flag.String("cacheDir", os.TempDir(), "local cache directory for file chunks and meta data")
|
mountOptions.cacheDir = cmdMount.Flag.String("cacheDir", os.TempDir(), "local cache directory for file chunks and meta data")
|
||||||
mountOptions.cacheSizeMB = cmdMount.Flag.Int64("cacheCapacityMB", 1000, "local file chunk cache capacity in MB (0 will disable cache)")
|
mountOptions.cacheSizeMB = cmdMount.Flag.Int64("cacheCapacityMB", 0, "local file chunk cache capacity in MB")
|
||||||
mountOptions.dataCenter = cmdMount.Flag.String("dataCenter", "", "prefer to write to the data center")
|
mountOptions.dataCenter = cmdMount.Flag.String("dataCenter", "", "prefer to write to the data center")
|
||||||
mountOptions.allowOthers = cmdMount.Flag.Bool("allowOthers", true, "allows other users to access the file system")
|
mountOptions.allowOthers = cmdMount.Flag.Bool("allowOthers", true, "allows other users to access the file system")
|
||||||
mountOptions.umaskString = cmdMount.Flag.String("umask", "022", "octal umask, e.g., 022, 0111")
|
mountOptions.umaskString = cmdMount.Flag.String("umask", "022", "octal umask, e.g., 022, 0111")
|
||||||
@@ -57,6 +62,9 @@ func init() {
|
|||||||
mountOptions.uidMap = cmdMount.Flag.String("map.uid", "", "map local uid to uid on filer, comma-separated <local_uid>:<filer_uid>")
|
mountOptions.uidMap = cmdMount.Flag.String("map.uid", "", "map local uid to uid on filer, comma-separated <local_uid>:<filer_uid>")
|
||||||
mountOptions.gidMap = cmdMount.Flag.String("map.gid", "", "map local gid to gid on filer, comma-separated <local_gid>:<filer_gid>")
|
mountOptions.gidMap = cmdMount.Flag.String("map.gid", "", "map local gid to gid on filer, comma-separated <local_gid>:<filer_gid>")
|
||||||
mountOptions.readOnly = cmdMount.Flag.Bool("readOnly", false, "read only")
|
mountOptions.readOnly = cmdMount.Flag.Bool("readOnly", false, "read only")
|
||||||
|
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.localSocket = cmdMount.Flag.String("localSocket", "", "default to /tmp/seaweedfs-mount-<mount_dir_hash>.sock")
|
||||||
|
|
||||||
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")
|
||||||
|
|||||||
@@ -1,13 +1,5 @@
|
|||||||
package command
|
package command
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/seaweedfs/fuse"
|
|
||||||
)
|
|
||||||
|
|
||||||
func osSpecificMountOptions() []fuse.MountOption {
|
|
||||||
return []fuse.MountOption{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func checkMountPointAvailable(dir string) bool {
|
func checkMountPointAvailable(dir string) bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
package command
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/seaweedfs/fuse"
|
|
||||||
)
|
|
||||||
|
|
||||||
func osSpecificMountOptions() []fuse.MountOption {
|
|
||||||
return []fuse.MountOption{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func checkMountPointAvailable(dir string) bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
@@ -6,8 +6,6 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/seaweedfs/fuse"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -137,10 +135,6 @@ func parseInfoFile(r io.Reader) ([]*Info, error) {
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func osSpecificMountOptions() []fuse.MountOption {
|
|
||||||
return []fuse.MountOption{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func checkMountPointAvailable(dir string) bool {
|
func checkMountPointAvailable(dir string) bool {
|
||||||
mountPoint := dir
|
mountPoint := dir
|
||||||
if mountPoint != "/" && strings.HasSuffix(mountPoint, "/") {
|
if mountPoint != "/" && strings.HasSuffix(mountPoint, "/") {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
//go:build !linux && !darwin && !freebsd
|
//go:build !linux && !darwin
|
||||||
// +build !linux,!darwin,!freebsd
|
// +build !linux,!darwin
|
||||||
|
|
||||||
package command
|
package command
|
||||||
|
|
||||||
|
|||||||
+103
-95
@@ -1,39 +1,41 @@
|
|||||||
//go:build linux || darwin || freebsd
|
//go:build linux || darwin
|
||||||
// +build linux darwin freebsd
|
// +build linux darwin
|
||||||
|
|
||||||
package command
|
package command
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/glog"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/mount"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/mount/meta_cache"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/mount/unmount"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/pb"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/pb/mount_pb"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/security"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/storage/types"
|
||||||
|
"github.com/hanwen/go-fuse/v2/fuse"
|
||||||
|
"google.golang.org/grpc/reflection"
|
||||||
|
"net"
|
||||||
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"os/user"
|
"os/user"
|
||||||
"path"
|
|
||||||
"path/filepath"
|
|
||||||
"runtime"
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/chrislusf/seaweedfs/weed/storage/types"
|
|
||||||
|
|
||||||
"github.com/chrislusf/seaweedfs/weed/filesys/meta_cache"
|
|
||||||
|
|
||||||
"github.com/seaweedfs/fuse"
|
|
||||||
"github.com/seaweedfs/fuse/fs"
|
|
||||||
|
|
||||||
"github.com/chrislusf/seaweedfs/weed/filesys"
|
|
||||||
"github.com/chrislusf/seaweedfs/weed/glog"
|
|
||||||
"github.com/chrislusf/seaweedfs/weed/pb"
|
|
||||||
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
|
|
||||||
"github.com/chrislusf/seaweedfs/weed/security"
|
|
||||||
"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"
|
||||||
)
|
)
|
||||||
|
|
||||||
func runMount(cmd *Command, args []string) bool {
|
func runMount(cmd *Command, args []string) bool {
|
||||||
|
|
||||||
|
if *mountOptions.debug {
|
||||||
|
go http.ListenAndServe(fmt.Sprintf(":%d", *mountOptions.debugPort), nil)
|
||||||
|
}
|
||||||
|
|
||||||
grace.SetupProfiling(*mountCpuProfile, *mountMemProfile)
|
grace.SetupProfiling(*mountCpuProfile, *mountMemProfile)
|
||||||
if *mountReadRetryTime < time.Second {
|
if *mountReadRetryTime < time.Second {
|
||||||
*mountReadRetryTime = time.Second
|
*mountReadRetryTime = time.Second
|
||||||
@@ -53,32 +55,23 @@ func runMount(cmd *Command, args []string) bool {
|
|||||||
return RunMount(&mountOptions, os.FileMode(umask))
|
return RunMount(&mountOptions, os.FileMode(umask))
|
||||||
}
|
}
|
||||||
|
|
||||||
func getParentInode(mountDir string) (uint64, error) {
|
|
||||||
parentDir := filepath.Clean(filepath.Join(mountDir, ".."))
|
|
||||||
fi, err := os.Stat(parentDir)
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
|
|
||||||
stat, ok := fi.Sys().(*syscall.Stat_t)
|
|
||||||
if !ok {
|
|
||||||
return 0, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return stat.Ino, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func RunMount(option *MountOptions, umask os.FileMode) bool {
|
func RunMount(option *MountOptions, umask os.FileMode) bool {
|
||||||
|
|
||||||
filerAddresses := pb.ServerAddresses(*option.filer).ToAddresses()
|
// basic checks
|
||||||
|
chunkSizeLimitMB := *mountOptions.chunkSizeLimitMB
|
||||||
|
if chunkSizeLimitMB <= 0 {
|
||||||
|
fmt.Printf("Please specify a reasonable buffer size.")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// try to connect to filer
|
||||||
|
filerAddresses := pb.ServerAddresses(*option.filer).ToAddresses()
|
||||||
util.LoadConfiguration("security", false)
|
util.LoadConfiguration("security", false)
|
||||||
// try to connect to filer, filerBucketsPath may be useful later
|
|
||||||
grpcDialOption := security.LoadClientTLS(util.GetViper(), "grpc.client")
|
grpcDialOption := security.LoadClientTLS(util.GetViper(), "grpc.client")
|
||||||
var cipher bool
|
var cipher bool
|
||||||
var err error
|
var err error
|
||||||
for i := 0; i < 10; i++ {
|
for i := 0; i < 10; i++ {
|
||||||
err = pb.WithOneOfGrpcFilerClients(filerAddresses, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
err = pb.WithOneOfGrpcFilerClients(false, filerAddresses, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||||
resp, err := client.GetFilerConfiguration(context.Background(), &filer_pb.GetFilerConfigurationRequest{})
|
resp, err := client.GetFilerConfiguration(context.Background(), &filer_pb.GetFilerConfigurationRequest{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("get filer grpc address %v configuration: %v", filerAddresses, err)
|
return fmt.Errorf("get filer grpc address %v configuration: %v", filerAddresses, err)
|
||||||
@@ -98,26 +91,31 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
filerMountRootPath := *option.filerMountRootPath
|
filerMountRootPath := *option.filerMountRootPath
|
||||||
dir := util.ResolvePath(*option.dir)
|
|
||||||
parentInode, err := getParentInode(dir)
|
|
||||||
if err != nil {
|
|
||||||
glog.Errorf("failed to retrieve inode for parent directory of %s: %v", dir, err)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
fmt.Printf("This is SeaweedFS version %s %s %s\n", util.Version(), runtime.GOOS, runtime.GOARCH)
|
// clean up mount point
|
||||||
|
dir := util.ResolvePath(*option.dir)
|
||||||
if dir == "" {
|
if dir == "" {
|
||||||
fmt.Printf("Please specify the mount directory via \"-dir\"")
|
fmt.Printf("Please specify the mount directory via \"-dir\"")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
chunkSizeLimitMB := *mountOptions.chunkSizeLimitMB
|
unmount.Unmount(dir)
|
||||||
if chunkSizeLimitMB <= 0 {
|
|
||||||
fmt.Printf("Please specify a reasonable buffer size.")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
fuse.Unmount(dir)
|
// start on local unix socket
|
||||||
|
if *option.localSocket == "" {
|
||||||
|
mountDirHash := util.HashToInt32([]byte(dir))
|
||||||
|
if mountDirHash < 0 {
|
||||||
|
mountDirHash = -mountDirHash
|
||||||
|
}
|
||||||
|
*option.localSocket = fmt.Sprintf("/tmp/seaweefs-mount-%d.sock", mountDirHash)
|
||||||
|
}
|
||||||
|
if err := os.Remove(*option.localSocket); err != nil && !os.IsNotExist(err) {
|
||||||
|
glog.Fatalf("Failed to remove %s, error: %s", *option.localSocket, err.Error())
|
||||||
|
}
|
||||||
|
montSocketListener, err := net.Listen("unix", *option.localSocket)
|
||||||
|
if err != nil {
|
||||||
|
glog.Fatalf("Failed to listen on %s: %v", *option.localSocket, err)
|
||||||
|
}
|
||||||
|
|
||||||
// detect mount folder mode
|
// detect mount folder mode
|
||||||
if *option.dirAutoCreate {
|
if *option.dirAutoCreate {
|
||||||
@@ -125,6 +123,7 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
|
|||||||
}
|
}
|
||||||
fileInfo, err := os.Stat(dir)
|
fileInfo, err := os.Stat(dir)
|
||||||
|
|
||||||
|
// collect uid, gid
|
||||||
uid, gid := uint32(0), uint32(0)
|
uid, gid := uint32(0), uint32(0)
|
||||||
mountMode := os.ModeDir | 0777
|
mountMode := os.ModeDir | 0777
|
||||||
if err == nil {
|
if err == nil {
|
||||||
@@ -136,6 +135,7 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// detect uid, gid
|
||||||
if uid == 0 {
|
if uid == 0 {
|
||||||
if u, err := user.Current(); err == nil {
|
if u, err := user.Current(); err == nil {
|
||||||
if parsedId, pe := strconv.ParseUint(u.Uid, 10, 32); pe == nil {
|
if parsedId, pe := strconv.ParseUint(u.Uid, 10, 32); pe == nil {
|
||||||
@@ -161,34 +161,51 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
mountName := path.Base(dir)
|
serverFriendlyName := strings.ReplaceAll(*option.filer, ",", "+")
|
||||||
|
|
||||||
options := []fuse.MountOption{
|
// mount fuse
|
||||||
fuse.VolumeName(mountName),
|
fuseMountOptions := &fuse.MountOptions{
|
||||||
fuse.FSName(*option.filer + ":" + filerMountRootPath),
|
AllowOther: *option.allowOthers,
|
||||||
fuse.Subtype("seaweedfs"),
|
Options: nil,
|
||||||
// fuse.NoAppleDouble(), // include .DS_Store, otherwise can not delete non-empty folders
|
MaxBackground: 128,
|
||||||
fuse.NoAppleXattr(),
|
MaxWrite: 1024 * 1024 * 2,
|
||||||
fuse.ExclCreate(),
|
MaxReadAhead: 1024 * 1024 * 2,
|
||||||
fuse.DaemonTimeout("3600"),
|
IgnoreSecurityLabels: false,
|
||||||
fuse.AllowSUID(),
|
RememberInodes: false,
|
||||||
fuse.DefaultPermissions(),
|
FsName: serverFriendlyName + ":" + filerMountRootPath,
|
||||||
fuse.MaxReadahead(1024 * 128),
|
Name: "seaweedfs",
|
||||||
fuse.AsyncRead(),
|
SingleThreaded: false,
|
||||||
fuse.WritebackCache(),
|
DisableXAttrs: false,
|
||||||
fuse.MaxBackground(128),
|
Debug: *option.debug,
|
||||||
fuse.CongestionThreshold(128),
|
EnableLocks: false,
|
||||||
}
|
ExplicitDataCacheControl: false,
|
||||||
|
DirectMount: true,
|
||||||
options = append(options, osSpecificMountOptions()...)
|
DirectMountFlags: 0,
|
||||||
if *option.allowOthers {
|
//SyncRead: false, // set to false to enable the FUSE_CAP_ASYNC_READ capability
|
||||||
options = append(options, fuse.AllowOther())
|
//EnableAcl: true,
|
||||||
}
|
}
|
||||||
if *option.nonempty {
|
if *option.nonempty {
|
||||||
options = append(options, fuse.AllowNonEmptyMount())
|
fuseMountOptions.Options = append(fuseMountOptions.Options, "nonempty")
|
||||||
}
|
}
|
||||||
if *option.readOnly {
|
if *option.readOnly {
|
||||||
options = append(options, fuse.ReadOnly())
|
if runtime.GOOS == "darwin" {
|
||||||
|
fuseMountOptions.Options = append(fuseMountOptions.Options, "rdonly")
|
||||||
|
} else {
|
||||||
|
fuseMountOptions.Options = append(fuseMountOptions.Options, "ro")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if runtime.GOOS == "darwin" {
|
||||||
|
// https://github-wiki-see.page/m/macfuse/macfuse/wiki/Mount-Options
|
||||||
|
ioSizeMB := 1
|
||||||
|
for ioSizeMB*2 <= *option.chunkSizeLimitMB && ioSizeMB*2 <= 32 {
|
||||||
|
ioSizeMB *= 2
|
||||||
|
}
|
||||||
|
fuseMountOptions.Options = append(fuseMountOptions.Options, "daemon_timeout=600")
|
||||||
|
fuseMountOptions.Options = append(fuseMountOptions.Options, "noapplexattr")
|
||||||
|
// fuseMountOptions.Options = append(fuseMountOptions.Options, "novncache") // need to test effectiveness
|
||||||
|
fuseMountOptions.Options = append(fuseMountOptions.Options, "slow_statfs")
|
||||||
|
fuseMountOptions.Options = append(fuseMountOptions.Options, "volname="+serverFriendlyName)
|
||||||
|
fuseMountOptions.Options = append(fuseMountOptions.Options, fmt.Sprintf("iosize=%d", ioSizeMB*1024*1024))
|
||||||
}
|
}
|
||||||
|
|
||||||
// find mount point
|
// find mount point
|
||||||
@@ -197,9 +214,7 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
|
|||||||
mountRoot = mountRoot[0 : len(mountRoot)-1]
|
mountRoot = mountRoot[0 : len(mountRoot)-1]
|
||||||
}
|
}
|
||||||
|
|
||||||
diskType := types.ToDiskType(*option.diskType)
|
seaweedFileSystem := mount.NewSeaweedFileSystem(&mount.Option{
|
||||||
|
|
||||||
seaweedFileSystem := filesys.NewSeaweedFileSystem(&filesys.Option{
|
|
||||||
MountDirectory: dir,
|
MountDirectory: dir,
|
||||||
FilerAddresses: filerAddresses,
|
FilerAddresses: filerAddresses,
|
||||||
GrpcDialOption: grpcDialOption,
|
GrpcDialOption: grpcDialOption,
|
||||||
@@ -207,49 +222,42 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
|
|||||||
Collection: *option.collection,
|
Collection: *option.collection,
|
||||||
Replication: *option.replication,
|
Replication: *option.replication,
|
||||||
TtlSec: int32(*option.ttlSec),
|
TtlSec: int32(*option.ttlSec),
|
||||||
DiskType: diskType,
|
DiskType: types.ToDiskType(*option.diskType),
|
||||||
ChunkSizeLimit: int64(chunkSizeLimitMB) * 1024 * 1024,
|
ChunkSizeLimit: int64(chunkSizeLimitMB) * 1024 * 1024,
|
||||||
ConcurrentWriters: *option.concurrentWriters,
|
ConcurrentWriters: *option.concurrentWriters,
|
||||||
CacheDir: *option.cacheDir,
|
CacheDir: *option.cacheDir,
|
||||||
CacheSizeMB: *option.cacheSizeMB,
|
CacheSizeMB: *option.cacheSizeMB,
|
||||||
DataCenter: *option.dataCenter,
|
DataCenter: *option.dataCenter,
|
||||||
|
Quota: int64(*option.collectionQuota) * 1024 * 1024,
|
||||||
MountUid: uid,
|
MountUid: uid,
|
||||||
MountGid: gid,
|
MountGid: gid,
|
||||||
MountMode: mountMode,
|
MountMode: mountMode,
|
||||||
MountCtime: fileInfo.ModTime(),
|
MountCtime: fileInfo.ModTime(),
|
||||||
MountMtime: time.Now(),
|
MountMtime: time.Now(),
|
||||||
MountParentInode: parentInode,
|
|
||||||
Umask: umask,
|
Umask: umask,
|
||||||
VolumeServerAccess: *mountOptions.volumeServerAccess,
|
VolumeServerAccess: *mountOptions.volumeServerAccess,
|
||||||
Cipher: cipher,
|
Cipher: cipher,
|
||||||
UidGidMapper: uidGidMapper,
|
UidGidMapper: uidGidMapper,
|
||||||
})
|
})
|
||||||
|
|
||||||
// mount
|
server, err := fuse.NewServer(seaweedFileSystem, dir, fuseMountOptions)
|
||||||
c, err := fuse.Mount(dir, options...)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.V(0).Infof("mount: %v", err)
|
glog.Fatalf("Mount fail: %v", err)
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
defer fuse.Unmount(dir)
|
|
||||||
|
|
||||||
grace.OnInterrupt(func() {
|
grace.OnInterrupt(func() {
|
||||||
fuse.Unmount(dir)
|
unmount.Unmount(dir)
|
||||||
c.Close()
|
|
||||||
})
|
})
|
||||||
|
|
||||||
glog.V(0).Infof("mounted %s%s to %v", *option.filer, mountRoot, dir)
|
grpcS := pb.NewGrpcServer()
|
||||||
server := fs.New(c, nil)
|
mount_pb.RegisterSeaweedMountServer(grpcS, seaweedFileSystem)
|
||||||
seaweedFileSystem.Server = server
|
reflection.Register(grpcS)
|
||||||
seaweedFileSystem.StartBackgroundTasks()
|
go grpcS.Serve(montSocketListener)
|
||||||
err = server.Serve(seaweedFileSystem)
|
|
||||||
|
|
||||||
// check if the mount process has an error to report
|
seaweedFileSystem.StartBackgroundTasks()
|
||||||
<-c.Ready
|
|
||||||
if err := c.MountError; err != nil {
|
fmt.Printf("This is SeaweedFS version %s %s %s\n", util.Version(), runtime.GOOS, runtime.GOARCH)
|
||||||
glog.V(0).Infof("mount process: %v", err)
|
|
||||||
return true
|
server.Serve()
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@@ -68,7 +68,7 @@ func (msgBrokerOpt *MessageBrokerOptions) startQueueServer() bool {
|
|||||||
cipher := false
|
cipher := false
|
||||||
|
|
||||||
for {
|
for {
|
||||||
err := pb.WithGrpcFilerClient(filerAddress, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
err := pb.WithGrpcFilerClient(false, filerAddress, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||||
resp, err := client.GetFilerConfiguration(context.Background(), &filer_pb.GetFilerConfigurationRequest{})
|
resp, err := client.GetFilerConfiguration(context.Background(), &filer_pb.GetFilerConfigurationRequest{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("get filer %s configuration: %v", filerAddress, err)
|
return fmt.Errorf("get filer %s configuration: %v", filerAddress, err)
|
||||||
@@ -95,7 +95,7 @@ func (msgBrokerOpt *MessageBrokerOptions) startQueueServer() bool {
|
|||||||
}, grpcDialOption)
|
}, grpcDialOption)
|
||||||
|
|
||||||
// start grpc listener
|
// start grpc listener
|
||||||
grpcL, err := util.NewListener(util.JoinHostPort("", *msgBrokerOpt.port), 0)
|
grpcL, _, err := util.NewIpAndLocalListeners("", *msgBrokerOpt.port, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Fatalf("failed to listen on grpc port %d: %v", *msgBrokerOpt.port, err)
|
glog.Fatalf("failed to listen on grpc port %d: %v", *msgBrokerOpt.port, err)
|
||||||
}
|
}
|
||||||
|
|||||||
+53
-18
@@ -3,6 +3,7 @@ package command
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/s3api/s3err"
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -23,26 +24,33 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type S3Options struct {
|
type S3Options struct {
|
||||||
filer *string
|
filer *string
|
||||||
port *int
|
bindIp *string
|
||||||
config *string
|
port *int
|
||||||
domainName *string
|
config *string
|
||||||
tlsPrivateKey *string
|
domainName *string
|
||||||
tlsCertificate *string
|
tlsPrivateKey *string
|
||||||
metricsHttpPort *int
|
tlsCertificate *string
|
||||||
allowEmptyFolder *bool
|
metricsHttpPort *int
|
||||||
|
allowEmptyFolder *bool
|
||||||
|
allowDeleteBucketNotEmpty *bool
|
||||||
|
auditLogConfig *string
|
||||||
|
localFilerSocket *string
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cmdS3.Run = runS3 // break init cycle
|
cmdS3.Run = runS3 // break init cycle
|
||||||
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.port = cmdS3.Flag.Int("port", 8333, "s3 server http listen port")
|
s3StandaloneOptions.port = cmdS3.Flag.Int("port", 8333, "s3 server http 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.tlsPrivateKey = cmdS3.Flag.String("key.file", "", "path to the TLS private key file")
|
s3StandaloneOptions.tlsPrivateKey = cmdS3.Flag.String("key.file", "", "path to the TLS private key file")
|
||||||
s3StandaloneOptions.tlsCertificate = cmdS3.Flag.String("cert.file", "", "path to the TLS certificate file")
|
s3StandaloneOptions.tlsCertificate = cmdS3.Flag.String("cert.file", "", "path to the TLS certificate file")
|
||||||
s3StandaloneOptions.metricsHttpPort = cmdS3.Flag.Int("metricsPort", 0, "Prometheus metrics listen port")
|
s3StandaloneOptions.metricsHttpPort = cmdS3.Flag.Int("metricsPort", 0, "Prometheus metrics listen port")
|
||||||
s3StandaloneOptions.allowEmptyFolder = cmdS3.Flag.Bool("allowEmptyFolder", true, "allow empty folders")
|
s3StandaloneOptions.allowEmptyFolder = cmdS3.Flag.Bool("allowEmptyFolder", true, "allow empty folders")
|
||||||
|
s3StandaloneOptions.allowDeleteBucketNotEmpty = cmdS3.Flag.Bool("allowDeleteBucketNotEmpty", true, "allow recursive deleting all entries along with bucket")
|
||||||
}
|
}
|
||||||
|
|
||||||
var cmdS3 = &Command{
|
var cmdS3 = &Command{
|
||||||
@@ -148,7 +156,7 @@ func (s3opt *S3Options) startS3Server() bool {
|
|||||||
var metricsIntervalSec int
|
var metricsIntervalSec int
|
||||||
|
|
||||||
for {
|
for {
|
||||||
err := pb.WithGrpcFilerClient(filerAddress, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
err := pb.WithGrpcFilerClient(false, filerAddress, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||||
resp, err := client.GetFilerConfiguration(context.Background(), &filer_pb.GetFilerConfigurationRequest{})
|
resp, err := client.GetFilerConfiguration(context.Background(), &filer_pb.GetFilerConfigurationRequest{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("get filer %s configuration: %v", filerAddress, err)
|
return fmt.Errorf("get filer %s configuration: %v", filerAddress, err)
|
||||||
@@ -172,13 +180,15 @@ func (s3opt *S3Options) startS3Server() bool {
|
|||||||
router := mux.NewRouter().SkipClean(true)
|
router := mux.NewRouter().SkipClean(true)
|
||||||
|
|
||||||
_, s3ApiServer_err := s3api.NewS3ApiServer(router, &s3api.S3ApiServerOption{
|
_, s3ApiServer_err := s3api.NewS3ApiServer(router, &s3api.S3ApiServerOption{
|
||||||
Filer: filerAddress,
|
Filer: filerAddress,
|
||||||
Port: *s3opt.port,
|
Port: *s3opt.port,
|
||||||
Config: *s3opt.config,
|
Config: *s3opt.config,
|
||||||
DomainName: *s3opt.domainName,
|
DomainName: *s3opt.domainName,
|
||||||
BucketsPath: filerBucketsPath,
|
BucketsPath: filerBucketsPath,
|
||||||
GrpcDialOption: grpcDialOption,
|
GrpcDialOption: grpcDialOption,
|
||||||
AllowEmptyFolder: *s3opt.allowEmptyFolder,
|
AllowEmptyFolder: *s3opt.allowEmptyFolder,
|
||||||
|
AllowDeleteBucketNotEmpty: *s3opt.allowDeleteBucketNotEmpty,
|
||||||
|
LocalFilerSocket: s3opt.localFilerSocket,
|
||||||
})
|
})
|
||||||
if s3ApiServer_err != nil {
|
if s3ApiServer_err != nil {
|
||||||
glog.Fatalf("S3 API Server startup error: %v", s3ApiServer_err)
|
glog.Fatalf("S3 API Server startup error: %v", s3ApiServer_err)
|
||||||
@@ -186,19 +196,44 @@ func (s3opt *S3Options) startS3Server() bool {
|
|||||||
|
|
||||||
httpS := &http.Server{Handler: router}
|
httpS := &http.Server{Handler: router}
|
||||||
|
|
||||||
listenAddress := fmt.Sprintf(":%d", *s3opt.port)
|
if *s3opt.bindIp == "" {
|
||||||
s3ApiListener, err := util.NewListener(listenAddress, time.Duration(10)*time.Second)
|
*s3opt.bindIp = "localhost"
|
||||||
|
}
|
||||||
|
|
||||||
|
listenAddress := fmt.Sprintf("%s:%d", *s3opt.bindIp, *s3opt.port)
|
||||||
|
s3ApiListener, s3ApiLocalListner, err := util.NewIpAndLocalListeners(*s3opt.bindIp, *s3opt.port, time.Duration(10)*time.Second)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Fatalf("S3 API Server listener on %s error: %v", listenAddress, err)
|
glog.Fatalf("S3 API Server listener on %s error: %v", listenAddress, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(*s3opt.auditLogConfig) > 0 {
|
||||||
|
s3err.InitAuditLog(*s3opt.auditLogConfig)
|
||||||
|
if s3err.Logger != nil {
|
||||||
|
defer s3err.Logger.Close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
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 {
|
||||||
|
go func() {
|
||||||
|
if err = httpS.ServeTLS(s3ApiLocalListner, *s3opt.tlsCertificate, *s3opt.tlsPrivateKey); err != nil {
|
||||||
|
glog.Fatalf("S3 API Server Fail to serve: %v", err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
}
|
||||||
if err = httpS.ServeTLS(s3ApiListener, *s3opt.tlsCertificate, *s3opt.tlsPrivateKey); err != nil {
|
if err = httpS.ServeTLS(s3ApiListener, *s3opt.tlsCertificate, *s3opt.tlsPrivateKey); err != nil {
|
||||||
glog.Fatalf("S3 API Server Fail to serve: %v", err)
|
glog.Fatalf("S3 API Server Fail to serve: %v", err)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
glog.V(0).Infof("Start Seaweed S3 API Server %s at http port %d", util.Version(), *s3opt.port)
|
glog.V(0).Infof("Start Seaweed S3 API Server %s at http port %d", util.Version(), *s3opt.port)
|
||||||
|
if s3ApiLocalListner != nil {
|
||||||
|
go func() {
|
||||||
|
if err = httpS.Serve(s3ApiLocalListner); err != nil {
|
||||||
|
glog.Fatalf("S3 API Server Fail to serve: %v", err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
}
|
||||||
if err = httpS.Serve(s3ApiListener); err != nil {
|
if err = httpS.Serve(s3ApiListener); err != nil {
|
||||||
glog.Fatalf("S3 API Server Fail to serve: %v", err)
|
glog.Fatalf("S3 API Server Fail to serve: %v", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package command
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"github.com/chrislusf/seaweedfs/weed/util"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/chrislusf/seaweedfs/weed/command/scaffold"
|
"github.com/chrislusf/seaweedfs/weed/command/scaffold"
|
||||||
@@ -56,7 +56,7 @@ func runScaffold(cmd *Command, args []string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if *outputPath != "" {
|
if *outputPath != "" {
|
||||||
os.WriteFile(filepath.Join(*outputPath, *config+".toml"), []byte(content), 0644)
|
util.WriteFile(filepath.Join(*outputPath, *config+".toml"), []byte(content), 0644)
|
||||||
} else {
|
} else {
|
||||||
fmt.Println(content)
|
fmt.Println(content)
|
||||||
}
|
}
|
||||||
|
|||||||
Loaded 100 of 496 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user