mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 10:07:28 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c4c2f0994 | ||
|
|
f193942adc | ||
|
|
61c42f9991 | ||
|
|
aafb874ad2 | ||
|
|
c4f44d56f7 | ||
|
|
f8aa5ea844 | ||
|
|
13a8593ab9 | ||
|
|
06471dac9d | ||
|
|
5149b3d07b | ||
|
|
868f7875d7 | ||
|
|
26eff062c8 | ||
|
|
464a71a373 | ||
|
|
ee4f7cd636 | ||
|
|
3fd659df2a | ||
|
|
0d9ba8c612 | ||
|
|
0515014149 | ||
|
|
a82c44972b | ||
|
|
14a19170e2 | ||
|
|
84ced2abf5 | ||
|
|
fe1716ccdf | ||
|
|
1ce725728d | ||
|
|
11549706ef | ||
|
|
8ec1bc2c99 | ||
|
|
f97e663f0d | ||
|
|
656283519b | ||
|
|
88b292fb3f | ||
|
|
ccec3acd5b | ||
|
|
149082f8ac | ||
|
|
f1883a9975 | ||
|
|
63b415bdf4 | ||
|
|
152fc4890a | ||
|
|
3b88ab42aa | ||
|
|
44b9d72ef0 | ||
|
|
572cc440ce | ||
|
|
94fbf02ea2 | ||
|
|
75f7893c11 | ||
|
|
8f99e1defe | ||
|
|
b6a516fed6 | ||
|
|
0b0fb9b9e4 | ||
|
|
1e22d5caf2 | ||
|
|
4dd890d4a2 | ||
|
|
3fbf4f6189 | ||
|
|
4527ead295 | ||
|
|
a25bca0692 | ||
|
|
25535e9c36 | ||
|
|
2e42cdeb22 | ||
|
|
5abb78bbd4 | ||
|
|
c0a0b84c66 | ||
|
|
a5740619e1 | ||
|
|
273d677ebd | ||
|
|
afbef0044a | ||
|
|
609902f0cf | ||
|
|
cd3bc35b8d | ||
|
|
2c14e9ac9f | ||
|
|
476022c2dc | ||
|
|
68feffa4e6 | ||
|
|
5ee04d20fa | ||
|
|
670e2185e4 | ||
|
|
d6af3a8eb6 | ||
|
|
5caff2c0f0 | ||
|
|
9bdbf9c880 | ||
|
|
0bffb3770f | ||
|
|
abef448c51 | ||
|
|
65b4dc6448 | ||
|
|
19fd0f7d5b | ||
|
|
0bd4f5ea61 | ||
|
|
17b0a94419 | ||
|
|
5230bb3656 | ||
|
|
a6b360b9f1 | ||
|
|
6812a5933c | ||
|
|
26f15d0079 | ||
|
|
fb4b61036c | ||
|
|
a0931be0c0 | ||
|
|
5aec6da8a3 | ||
|
|
e23f3d6eca | ||
|
|
70fc8d06f3 | ||
|
|
ca7cc61319 | ||
|
|
b0da8788a1 | ||
|
|
68c3cf767c | ||
|
|
d1d1757520 | ||
|
|
af0727ae4b | ||
|
|
a09a7c53e7 | ||
|
|
38dc1259f9 | ||
|
|
0271eb8732 | ||
|
|
684ef483f1 | ||
|
|
e7f4418855 | ||
|
|
ddd1de1beb | ||
|
|
e32422b971 | ||
|
|
26fb6deb4e | ||
|
|
eacf808877 | ||
|
|
5669d29d04 | ||
|
|
4310e1fac4 | ||
|
|
8fffe3e822 | ||
|
|
8f3bd202e5 | ||
|
|
9187a64975 | ||
|
|
1ebb549f77 | ||
|
|
a90b777ff4 | ||
|
|
17e91d2917 | ||
|
|
b7f011f777 | ||
|
|
65484e80ef | ||
|
|
64b2fbe0f1 | ||
|
|
2c347bec0c | ||
|
|
d77c787ec6 | ||
|
|
7034fd155f | ||
|
|
7d9f9ecda5 | ||
|
|
79d42eede4 | ||
|
|
9204ee2d2d | ||
|
|
2e351aa967 | ||
|
|
b0062c23cb | ||
|
|
51d9066e90 | ||
|
|
d999f1f0e2 | ||
|
|
e624a1c234 | ||
|
|
d232590299 | ||
|
|
953c7d648f | ||
|
|
3297d59360 | ||
|
|
1a97e1ddd8 | ||
|
|
25b237b83c | ||
|
|
59f55c1a66 | ||
|
|
b2a3860290 | ||
|
|
4511edc871 | ||
|
|
7592d013fe | ||
|
|
6fdff0bb18 | ||
|
|
c2129d5555 | ||
|
|
fdf1064a92 | ||
|
|
dc283e3bd9 | ||
|
|
00e243d98e | ||
|
|
b6dd4b8477 | ||
|
|
42766bccc8 | ||
|
|
e9fda774f4 | ||
|
|
4867aa03ab | ||
|
|
d75a7b7f62 | ||
|
|
fafff5896e | ||
|
|
a36967982d | ||
|
|
3e714a53cf | ||
|
|
5a46005ddf | ||
|
|
54440f0d63 | ||
|
|
fab0ab5440 | ||
|
|
f352616b7d | ||
|
|
18686b7375 | ||
|
|
68f1cc34a5 | ||
|
|
e1b92bc701 | ||
|
|
ff7b6d779e | ||
|
|
2e240704ab | ||
|
|
19245dde50 | ||
|
|
4131874fa8 | ||
|
|
9f55c7c90e | ||
|
|
a408b46d95 | ||
|
|
0a22eea55d | ||
|
|
d50d736e68 | ||
|
|
ae9388723f | ||
|
|
31db90942b | ||
|
|
839dd438bc | ||
|
|
bf3d0c4850 | ||
|
|
ea5bbf30bb | ||
|
|
a9b4be50af | ||
|
|
8ecdf958ab | ||
|
|
0f653d2153 | ||
|
|
0122e022ea | ||
|
|
5614ad0000 | ||
|
|
e60a7af644 | ||
|
|
88b2bbadd1 | ||
|
|
095cdb0c7f | ||
|
|
44ad07276c | ||
|
|
ccc030b245 | ||
|
|
130bc3e668 | ||
|
|
d1ce89950e | ||
|
|
da1d3b5a33 | ||
|
|
b5b5c67cf6 | ||
|
|
1d6a348d55 | ||
|
|
04a9dc898f | ||
|
|
adf80dc3f6 | ||
|
|
2d213d87e1 | ||
|
|
efef6e94bf | ||
|
|
d4dec6c730 | ||
|
|
080bfa7052 | ||
|
|
0f2a8b0af1 | ||
|
|
5aa89844b1 | ||
|
|
671ee6af6d | ||
|
|
422bfaed69 | ||
|
|
b9ab65dba5 | ||
|
|
2b82d0f871 | ||
|
|
8e80ce9476 | ||
|
|
ff649d615d | ||
|
|
3e69a3aac5 | ||
|
|
04190f9951 | ||
|
|
d6ecde8a96 | ||
|
|
ddc5234f85 | ||
|
|
47c4227318 | ||
|
|
3cc7b90414 | ||
|
|
f1f14e28bc | ||
|
|
d54798c3ae | ||
|
|
6bfb91b539 | ||
|
|
bbd461b2c6 | ||
|
|
5db9fcccd4 | ||
|
|
de4545c28b | ||
|
|
5c783c16a1 | ||
|
|
fba05959ef | ||
|
|
8d8347d2f7 | ||
|
|
60c20dce99 | ||
|
|
279c2627f9 | ||
|
|
f90d23916e | ||
|
|
b2134b78d4 | ||
|
|
fa00882e81 | ||
|
|
f0b2650adb | ||
|
|
adb90bd252 | ||
|
|
5b43c4bb98 | ||
|
|
50dc2fe96b | ||
|
|
29d1312625 | ||
|
|
784daea1fa | ||
|
|
264be0d2d4 | ||
|
|
d695119073 | ||
|
|
57ab1f8516 | ||
|
|
dd71f54c6b | ||
|
|
71b33faef0 | ||
|
|
f5854d13df | ||
|
|
0454bb2d88 | ||
|
|
2268d38263 | ||
|
|
b12d9b8598 | ||
|
|
99c05a9c29 | ||
|
|
4d3a485992 | ||
|
|
b1cdea3503 | ||
|
|
2b0cb47a43 | ||
|
|
98bc93cf31 | ||
|
|
66dd114933 | ||
|
|
e17429223e | ||
|
|
bd70683871 | ||
|
|
59706c89fb | ||
|
|
7111c08289 | ||
|
|
c589e9837c | ||
|
|
244385bf0d | ||
|
|
889ecf5c9d | ||
|
|
0cf4f2e891 | ||
|
|
113f3b76f4 | ||
|
|
9ed7922bed | ||
|
|
e52bb3112d | ||
|
|
281f5ef6a5 | ||
|
|
c5b8a0554a | ||
|
|
cef493dd0d | ||
|
|
bd6f2716d3 | ||
|
|
0bf56298d5 | ||
|
|
8241c9a829 | ||
|
|
1f7934a89c | ||
|
|
6cf43f9f58 | ||
|
|
8cf75a152b | ||
|
|
9db15c28ec | ||
|
|
83d15b50ce | ||
|
|
32862b815b | ||
|
|
c5bcfd8942 | ||
|
|
ffbc6615bd | ||
|
|
1976ca9160 | ||
|
|
214b7cd286 | ||
|
|
f457956948 | ||
|
|
4daa791b45 | ||
|
|
db5515eada | ||
|
|
ef2f741823 | ||
|
|
2c4dbaedf2 | ||
|
|
673214574a | ||
|
|
3227e4175e | ||
|
|
439b79016d | ||
|
|
508de8f492 | ||
|
|
f86c0d7751 | ||
|
|
d531fffc89 | ||
|
|
e70cf681fe | ||
|
|
6b7cb33f54 | ||
|
|
a554419e45 | ||
|
|
28c36913b4 | ||
|
|
f05261157f | ||
|
|
e3c48e987b | ||
|
|
472528f6f0 | ||
|
|
cbff1dbd0e | ||
|
|
00fda86880 | ||
|
|
3f22a9db18 | ||
|
|
ca102a0b0b | ||
|
|
9bb0a9e306 | ||
|
|
545d5d0cc3 | ||
|
|
a9aa2d581f | ||
|
|
79af6b41d4 | ||
|
|
896c6b8d1a | ||
|
|
3d7baa30cd | ||
|
|
1134de8cbe | ||
|
|
292e98cc22 | ||
|
|
5869945f16 | ||
|
|
e037c71ec3 | ||
|
|
67b8c2853a | ||
|
|
302155a6fa | ||
|
|
5520b81551 | ||
|
|
dc4ed2cd9b | ||
|
|
31bb91583f | ||
|
|
532a352121 | ||
|
|
bac45912e3 | ||
|
|
79d68a81fd | ||
|
|
999a126a3f | ||
|
|
1c2364936a | ||
|
|
5de93fe442 | ||
|
|
5083429704 | ||
|
|
d5f77706a8 | ||
|
|
39be630242 | ||
|
|
3189ee9e57 | ||
|
|
fd517c7a6e | ||
|
|
e19ca6ac3c | ||
|
|
89cee70c2e | ||
|
|
c19d121e5c | ||
|
|
0ce9704c3d | ||
|
|
4cd6f64d92 | ||
|
|
8821d6b161 | ||
|
|
9bd422d2c9 | ||
|
|
84e9934bf9 | ||
|
|
0932437a1c | ||
|
|
c47f75eb5b | ||
|
|
fe573f26a8 | ||
|
|
b9b613a78e | ||
|
|
665917fdf1 | ||
|
|
0d085ec175 | ||
|
|
14d95276c2 | ||
|
|
73f6917c91 | ||
|
|
a8592ecfc3 | ||
|
|
5fb875bd20 | ||
|
|
d182a4fed7 | ||
|
|
61fd3546fe | ||
|
|
4d71af87f3 | ||
|
|
ef70415c70 | ||
|
|
6e8dbf8868 | ||
|
|
de081c0d64 | ||
|
|
b63d1e9c6b | ||
|
|
e98739598a | ||
|
|
0fa02ad5c8 | ||
|
|
6c4fe30cda | ||
|
|
4851302b74 | ||
|
|
92a2d96856 | ||
|
|
715eeced46 | ||
|
|
81fdf3651b | ||
|
|
b048659749 | ||
|
|
e619664eeb | ||
|
|
bfe5d910c6 | ||
|
|
ca901742cb | ||
|
|
11d055bfc1 | ||
|
|
59c8308b21 | ||
|
|
48f263be94 | ||
|
|
805faac753 | ||
|
|
cdce2d9d49 | ||
|
|
2ed54378bf | ||
|
|
700c1f87c9 | ||
|
|
1f727ce4fa | ||
|
|
6465abd9db | ||
|
|
9c04eef92d | ||
|
|
dfb2292da4 | ||
|
|
a3060c11df | ||
|
|
4614e85efa | ||
|
|
c24678153c | ||
|
|
2885ba0e50 | ||
|
|
12f8251d32 | ||
|
|
313fd17ae4 | ||
|
|
1cd2e64aac | ||
|
|
2452f3b2f7 | ||
|
|
361d97941b | ||
|
|
efcffe4f77 | ||
|
|
85f1b70207 | ||
|
|
86657ed3a8 | ||
|
|
28fe578944 | ||
|
|
47fa5ef979 | ||
|
|
9e0d526163 | ||
|
|
7f49c59c14 | ||
|
|
340e7c3a2e | ||
|
|
e650c8397d | ||
|
|
75bdd4a0d1 | ||
|
|
44b0176e9e | ||
|
|
f030186e3a | ||
|
|
36f81bd462 | ||
|
|
d0de2e2dfc | ||
|
|
cc0abaf0f9 | ||
|
|
8abace77d9 | ||
|
|
9b42942cca | ||
|
|
83e29faa55 | ||
|
|
51d4a4b28d | ||
|
|
0b52f08226 | ||
|
|
469c959e6a | ||
|
|
3e2c9ea73d | ||
|
|
296fdc296c | ||
|
|
49b84d5866 | ||
|
|
2abf817580 | ||
|
|
9ffe1d6aec | ||
|
|
e367444586 | ||
|
|
5423790b2c | ||
|
|
7bdae5172e | ||
|
|
8aec430df7 | ||
|
|
c87a3ffce3 | ||
|
|
6b4c033431 | ||
|
|
48f2edc065 | ||
|
|
d4566d4aaa | ||
|
|
367353b936 | ||
|
|
de787ce4ab | ||
|
|
04bba1a6b2 | ||
|
|
c7c9d22f37 | ||
|
|
c2280e94cf | ||
|
|
265a56630b | ||
|
|
ed5f3f073b | ||
|
|
d8cfa1552b | ||
|
|
84492976c9 | ||
|
|
bd176359cb | ||
|
|
b2aa1a23ff | ||
|
|
5f993a5f20 | ||
|
|
3901f2da4d | ||
|
|
569bc7b54d | ||
|
|
77b7c9f7cc | ||
|
|
d1797deccb | ||
|
|
4878e0fd46 | ||
|
|
6ede19e825 | ||
|
|
27d187eed9 | ||
|
|
3b90eb1911 | ||
|
|
f7beba8515 | ||
|
|
28d479e5c0 | ||
|
|
f9fb3cd1fc | ||
|
|
6c7fe40305 | ||
|
|
3fc3e7083c | ||
|
|
a1ffa03d75 | ||
|
|
3886c31ed8 | ||
|
|
9fdf98b826 | ||
|
|
c7a28b20b5 | ||
|
|
6c5d44a5c4 | ||
|
|
ae847c2780 | ||
|
|
3b85dc5fbb | ||
|
|
b8a4ed455f | ||
|
|
038bab3726 | ||
|
|
8a40fa8993 | ||
|
|
f84c13dabd | ||
|
|
693e07b509 | ||
|
|
1949944e18 | ||
|
|
6c8a3d57e4 | ||
|
|
d88199c8b0 | ||
|
|
21f77384f0 | ||
|
|
bb289d7d69 | ||
|
|
438146249f | ||
|
|
ac9dea0ad9 | ||
|
|
fc6b9e6e0c | ||
|
|
38c63c429b | ||
|
|
e1ca6308cb | ||
|
|
549354e324 | ||
|
|
5f59d43c88 | ||
|
|
659f28b855 | ||
|
|
ca49ef8ed8 |
No files matched your search
@@ -38,13 +38,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@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v2
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # 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@90da8ebfdc010a0e7d378419a76fd90230a05228 # v1.22
|
uses: wangyoucao577/go-release-action@0aa3e4818bacdeab4f9a97f768d3a54734a5852e # v1.22
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
goos: ${{ matrix.goos }}
|
goos: ${{ matrix.goos }}
|
||||||
@@ -60,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@90da8ebfdc010a0e7d378419a76fd90230a05228 # v1.22
|
uses: wangyoucao577/go-release-action@0aa3e4818bacdeab4f9a97f768d3a54734a5852e # v1.22
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
goos: ${{ matrix.goos }}
|
goos: ${{ matrix.goos }}
|
||||||
@@ -87,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@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v2
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # 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@90da8ebfdc010a0e7d378419a76fd90230a05228 # v1.22
|
uses: wangyoucao577/go-release-action@0aa3e4818bacdeab4f9a97f768d3a54734a5852e # v1.22
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
goos: ${{ matrix.goos }}
|
goos: ${{ matrix.goos }}
|
||||||
@@ -109,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@90da8ebfdc010a0e7d378419a76fd90230a05228 # v1.22
|
uses: wangyoucao577/go-release-action@0aa3e4818bacdeab4f9a97f768d3a54734a5852e # v1.22
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
goos: ${{ matrix.goos }}
|
goos: ${{ matrix.goos }}
|
||||||
|
|||||||
@@ -28,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@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v2
|
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v2
|
||||||
- name: Go Release Binaries Normal Volume Size
|
- name: Go Release Binaries Normal Volume Size
|
||||||
uses: wangyoucao577/go-release-action@90da8ebfdc010a0e7d378419a76fd90230a05228 # v1.22
|
uses: wangyoucao577/go-release-action@0aa3e4818bacdeab4f9a97f768d3a54734a5852e # v1.22
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
goos: ${{ matrix.goos }}
|
goos: ${{ matrix.goos }}
|
||||||
@@ -44,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@90da8ebfdc010a0e7d378419a76fd90230a05228 # v1.22
|
uses: wangyoucao577/go-release-action@0aa3e4818bacdeab4f9a97f768d3a54734a5852e # v1.22
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
goos: ${{ matrix.goos }}
|
goos: ${{ matrix.goos }}
|
||||||
|
|||||||
@@ -28,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@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v2
|
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v2
|
||||||
- name: Go Release Binaries Normal Volume Size
|
- name: Go Release Binaries Normal Volume Size
|
||||||
uses: wangyoucao577/go-release-action@90da8ebfdc010a0e7d378419a76fd90230a05228 # v1.22
|
uses: wangyoucao577/go-release-action@0aa3e4818bacdeab4f9a97f768d3a54734a5852e # v1.22
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
goos: ${{ matrix.goos }}
|
goos: ${{ matrix.goos }}
|
||||||
@@ -44,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@90da8ebfdc010a0e7d378419a76fd90230a05228 # v1.22
|
uses: wangyoucao577/go-release-action@0aa3e4818bacdeab4f9a97f768d3a54734a5852e # v1.22
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
goos: ${{ matrix.goos }}
|
goos: ${{ matrix.goos }}
|
||||||
|
|||||||
@@ -28,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@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v2
|
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v2
|
||||||
- name: Go Release Binaries Normal Volume Size
|
- name: Go Release Binaries Normal Volume Size
|
||||||
uses: wangyoucao577/go-release-action@90da8ebfdc010a0e7d378419a76fd90230a05228 # v1.22
|
uses: wangyoucao577/go-release-action@0aa3e4818bacdeab4f9a97f768d3a54734a5852e # v1.22
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
goos: ${{ matrix.goos }}
|
goos: ${{ matrix.goos }}
|
||||||
@@ -44,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@90da8ebfdc010a0e7d378419a76fd90230a05228 # v1.22
|
uses: wangyoucao577/go-release-action@0aa3e4818bacdeab4f9a97f768d3a54734a5852e # v1.22
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
goos: ${{ matrix.goos }}
|
goos: ${{ matrix.goos }}
|
||||||
|
|||||||
@@ -28,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@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v2
|
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v2
|
||||||
- name: Go Release Binaries Normal Volume Size
|
- name: Go Release Binaries Normal Volume Size
|
||||||
uses: wangyoucao577/go-release-action@90da8ebfdc010a0e7d378419a76fd90230a05228 # v1.22
|
uses: wangyoucao577/go-release-action@0aa3e4818bacdeab4f9a97f768d3a54734a5852e # v1.22
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
goos: ${{ matrix.goos }}
|
goos: ${{ matrix.goos }}
|
||||||
@@ -44,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@90da8ebfdc010a0e7d378419a76fd90230a05228 # v1.22
|
uses: wangyoucao577/go-release-action@0aa3e4818bacdeab4f9a97f768d3a54734a5852e # v1.22
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
goos: ${{ matrix.goos }}
|
goos: ${{ matrix.goos }}
|
||||||
|
|||||||
@@ -28,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@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v2
|
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v2
|
||||||
- name: Go Release Binaries Normal Volume Size
|
- name: Go Release Binaries Normal Volume Size
|
||||||
uses: wangyoucao577/go-release-action@90da8ebfdc010a0e7d378419a76fd90230a05228 # v1.22
|
uses: wangyoucao577/go-release-action@0aa3e4818bacdeab4f9a97f768d3a54734a5852e # v1.22
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
goos: ${{ matrix.goos }}
|
goos: ${{ matrix.goos }}
|
||||||
@@ -45,7 +45,7 @@ jobs:
|
|||||||
binary_name: weed
|
binary_name: weed
|
||||||
asset_name: "${{ matrix.goos }}_${{ matrix.goarch }}_full"
|
asset_name: "${{ matrix.goos }}_${{ matrix.goarch }}_full"
|
||||||
- name: Go Release Large Disk Binaries
|
- name: Go Release Large Disk Binaries
|
||||||
uses: wangyoucao577/go-release-action@90da8ebfdc010a0e7d378419a76fd90230a05228 # v1.22
|
uses: wangyoucao577/go-release-action@0aa3e4818bacdeab4f9a97f768d3a54734a5852e # v1.22
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
goos: ${{ matrix.goos }}
|
goos: ${{ matrix.goos }}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
# Initializes the CodeQL tools for scanning.
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
|
|||||||
@@ -16,11 +16,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v2
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v2
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: docker_meta
|
id: docker_meta
|
||||||
uses: docker/metadata-action@57396166ad8aefe6098280995947635806a0e6ea # v3
|
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 # v3
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
chrislusf/seaweedfs
|
chrislusf/seaweedfs
|
||||||
@@ -33,30 +33,30 @@ jobs:
|
|||||||
org.opencontainers.image.vendor=Chris Lu
|
org.opencontainers.image.vendor=Chris Lu
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v1
|
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v1
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325 # v1
|
uses: docker/setup-buildx-action@ecf95283f03858871ff00b787d79c419715afc34 # 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@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v1
|
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # 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@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v1
|
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # 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@c56af957549030174b10d6867f20e78cfd7debc5 # v2
|
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v2
|
||||||
with:
|
with:
|
||||||
context: ./docker
|
context: ./docker
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
|||||||
@@ -17,11 +17,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v2
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v2
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: docker_meta
|
id: docker_meta
|
||||||
uses: docker/metadata-action@57396166ad8aefe6098280995947635806a0e6ea # v3
|
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 # v3
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
chrislusf/seaweedfs
|
chrislusf/seaweedfs
|
||||||
@@ -34,30 +34,30 @@ jobs:
|
|||||||
org.opencontainers.image.vendor=Chris Lu
|
org.opencontainers.image.vendor=Chris Lu
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v1
|
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v1
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325 # v1
|
uses: docker/setup-buildx-action@ecf95283f03858871ff00b787d79c419715afc34 # 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@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v1
|
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # 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@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v1
|
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # 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@c56af957549030174b10d6867f20e78cfd7debc5 # v2
|
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v2
|
||||||
with:
|
with:
|
||||||
context: ./docker
|
context: ./docker
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
|||||||
@@ -16,11 +16,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v2
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v2
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: docker_meta
|
id: docker_meta
|
||||||
uses: docker/metadata-action@57396166ad8aefe6098280995947635806a0e6ea # v3
|
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 # v3
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
chrislusf/seaweedfs
|
chrislusf/seaweedfs
|
||||||
@@ -34,20 +34,20 @@ jobs:
|
|||||||
org.opencontainers.image.vendor=Chris Lu
|
org.opencontainers.image.vendor=Chris Lu
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v1
|
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v1
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325 # v1
|
uses: docker/setup-buildx-action@ecf95283f03858871ff00b787d79c419715afc34 # 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@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v1
|
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # 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@c56af957549030174b10d6867f20e78cfd7debc5 # v2
|
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v2
|
||||||
with:
|
with:
|
||||||
context: ./docker
|
context: ./docker
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
|||||||
@@ -17,11 +17,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v2
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v2
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: docker_meta
|
id: docker_meta
|
||||||
uses: docker/metadata-action@57396166ad8aefe6098280995947635806a0e6ea # v3
|
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 # v3
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
chrislusf/seaweedfs
|
chrislusf/seaweedfs
|
||||||
@@ -35,20 +35,20 @@ jobs:
|
|||||||
org.opencontainers.image.vendor=Chris Lu
|
org.opencontainers.image.vendor=Chris Lu
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v1
|
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v1
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325 # v1
|
uses: docker/setup-buildx-action@ecf95283f03858871ff00b787d79c419715afc34 # 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@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v1
|
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # 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@c56af957549030174b10d6867f20e78cfd7debc5 # v2
|
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v2
|
||||||
with:
|
with:
|
||||||
context: ./docker
|
context: ./docker
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
|||||||
@@ -17,11 +17,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v2
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v2
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: docker_meta
|
id: docker_meta
|
||||||
uses: docker/metadata-action@57396166ad8aefe6098280995947635806a0e6ea # v3
|
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 # v3
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
chrislusf/seaweedfs
|
chrislusf/seaweedfs
|
||||||
@@ -35,20 +35,20 @@ jobs:
|
|||||||
org.opencontainers.image.vendor=Chris Lu
|
org.opencontainers.image.vendor=Chris Lu
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v1
|
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v1
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325 # v1
|
uses: docker/setup-buildx-action@ecf95283f03858871ff00b787d79c419715afc34 # 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@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v1
|
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # 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@c56af957549030174b10d6867f20e78cfd7debc5 # v2
|
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v2
|
||||||
with:
|
with:
|
||||||
context: ./docker
|
context: ./docker
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
|||||||
@@ -16,11 +16,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v2
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v2
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: docker_meta
|
id: docker_meta
|
||||||
uses: docker/metadata-action@57396166ad8aefe6098280995947635806a0e6ea # v3
|
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 # v3
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
chrislusf/seaweedfs
|
chrislusf/seaweedfs
|
||||||
@@ -34,20 +34,20 @@ jobs:
|
|||||||
org.opencontainers.image.vendor=Chris Lu
|
org.opencontainers.image.vendor=Chris Lu
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v1
|
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v1
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325 # v1
|
uses: docker/setup-buildx-action@ecf95283f03858871ff00b787d79c419715afc34 # 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@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v1
|
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # 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@c56af957549030174b10d6867f20e78cfd7debc5 # v2
|
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v2
|
||||||
with:
|
with:
|
||||||
context: ./docker
|
context: ./docker
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
|||||||
@@ -16,11 +16,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v2
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v2
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: docker_meta
|
id: docker_meta
|
||||||
uses: docker/metadata-action@57396166ad8aefe6098280995947635806a0e6ea # v3
|
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 # v3
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
chrislusf/seaweedfs
|
chrislusf/seaweedfs
|
||||||
@@ -34,20 +34,20 @@ jobs:
|
|||||||
org.opencontainers.image.vendor=Chris Lu
|
org.opencontainers.image.vendor=Chris Lu
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v1
|
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v1
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325 # v1
|
uses: docker/setup-buildx-action@ecf95283f03858871ff00b787d79c419715afc34 # 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@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v1
|
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # 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@c56af957549030174b10d6867f20e78cfd7debc5 # v2
|
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v2
|
||||||
with:
|
with:
|
||||||
context: ./docker
|
context: ./docker
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
|||||||
@@ -9,6 +9,6 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Repository'
|
- name: 'Checkout Repository'
|
||||||
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||||
- name: 'Dependency Review'
|
- name: 'Dependency Review'
|
||||||
uses: actions/dependency-review-action@11310527b429536e263dc6cc47873e608189ba21
|
uses: actions/dependency-review-action@1360a344ccb0ab6e9475edef90ad2f46bf8003b1
|
||||||
+30
-15
@@ -24,13 +24,13 @@ jobs:
|
|||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go 1.x
|
- name: Set up Go 1.x
|
||||||
uses: actions/setup-go@d0a58c1c4d2b25278816e339b944508c875f3613 # v2
|
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # 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@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v2
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v2
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
@@ -42,28 +42,43 @@ jobs:
|
|||||||
run: make build_e2e && docker compose -f ./compose/e2e-mount.yml up --wait
|
run: make build_e2e && docker compose -f ./compose/e2e-mount.yml up --wait
|
||||||
|
|
||||||
- name: Run FIO
|
- name: Run FIO
|
||||||
timeout-minutes: 5
|
timeout-minutes: 15
|
||||||
run: |
|
run: |
|
||||||
echo "Starting FIO at: $(date)"
|
echo "Starting FIO at: $(date)"
|
||||||
# Concurrent r/w
|
# Concurrent r/w
|
||||||
echo 'Run randrw with size=16M bs=4k'
|
echo 'Run randrw with size=16M bs=4k'
|
||||||
docker compose -f ./compose/e2e-mount.yml exec mount timeout -k5 40 fio --name=fiotest --filename=/mnt/seaweedfs/fiotest --size=16M --rw=randrw --bs=4k --direct=1 --numjobs=8 --ioengine=libaio --iodepth=32 --group_reporting --runtime=30 --time_based=1
|
docker compose -f ./compose/e2e-mount.yml exec mount timeout -k5 60 fio --name=fiotest --filename=/mnt/seaweedfs/fiotest --size=16M --rw=randrw --bs=4k --direct=1 --numjobs=8 --ioengine=libaio --iodepth=32 --group_reporting --runtime=30 --time_based=1
|
||||||
|
|
||||||
echo 'Run randrw with size=16M bs=128k'
|
echo "Verify FIO at: $(date)"
|
||||||
docker compose -f ./compose/e2e-mount.yml exec mount timeout -k5 40 fio --name=fiotest --filename=/mnt/seaweedfs/fiotest --size=16M --rw=randrw --bs=128k --direct=1 --numjobs=8 --ioengine=libaio --iodepth=32 --group_reporting --runtime=30 --time_based=1
|
|
||||||
|
|
||||||
echo 'Run randrw with size=16M bs=1m'
|
|
||||||
docker compose -f ./compose/e2e-mount.yml exec mount timeout -k5 40 fio --name=fiotest --filename=/mnt/seaweedfs/fiotest --size=16M --rw=randrw --bs=1m --direct=1 --numjobs=8 --ioengine=libaio --iodepth=32 --group_reporting --runtime=30 --time_based=1
|
|
||||||
|
|
||||||
# Verified write
|
# Verified write
|
||||||
echo 'Run randwrite with size=16M bs=4k'
|
echo 'Run randwrite with size=16M bs=4k'
|
||||||
docker compose -f ./compose/e2e-mount.yml exec mount timeout -k5 40 fio --name=fiotest --filename=/mnt/seaweedfs/fiotest --size=16M --rw=randwrite --bs=4k --direct=1 --numjobs=8 --ioengine=libaio --iodepth=32 --group_reporting --runtime=30 --time_based=1 --do_verify=0 --verify=crc32c --verify_backlog=1
|
docker compose -f ./compose/e2e-mount.yml exec mount timeout -k5 60 fio --name=fiotest --filename=/mnt/seaweedfs/fiotest --size=16M --rw=randwrite --bs=4k --direct=1 --numjobs=8 --ioengine=libaio --iodepth=32 --group_reporting --runtime=30 --time_based=1 --do_verify=0 --verify=crc32c --verify_backlog=1
|
||||||
|
|
||||||
|
- name: Run FIO
|
||||||
|
timeout-minutes: 15
|
||||||
|
run: |
|
||||||
|
echo "Starting FIO at: $(date)"
|
||||||
|
# Concurrent r/w
|
||||||
|
echo 'Run randrw with size=16M bs=128k'
|
||||||
|
docker compose -f ./compose/e2e-mount.yml exec mount timeout -k5 60 fio --name=fiotest --filename=/mnt/seaweedfs/fiotest --size=16M --rw=randrw --bs=128k --direct=1 --numjobs=8 --ioengine=libaio --iodepth=32 --group_reporting --runtime=30 --time_based=1
|
||||||
|
|
||||||
|
echo "Verify FIO at: $(date)"
|
||||||
|
# Verified write
|
||||||
echo 'Run randwrite with size=16M bs=128k'
|
echo 'Run randwrite with size=16M bs=128k'
|
||||||
docker compose -f ./compose/e2e-mount.yml exec mount timeout -k5 40 fio --name=fiotest --filename=/mnt/seaweedfs/fiotest --size=16M --rw=randwrite --bs=128k --direct=1 --numjobs=8 --ioengine=libaio --iodepth=32 --group_reporting --runtime=30 --time_based=1 --do_verify=0 --verify=crc32c --verify_backlog=1
|
docker compose -f ./compose/e2e-mount.yml exec mount timeout -k5 60 fio --name=fiotest --filename=/mnt/seaweedfs/fiotest --size=16M --rw=randwrite --bs=128k --direct=1 --numjobs=8 --ioengine=libaio --iodepth=32 --group_reporting --runtime=30 --time_based=1 --do_verify=0 --verify=crc32c --verify_backlog=1
|
||||||
|
|
||||||
|
- name: Run FIO
|
||||||
|
timeout-minutes: 15
|
||||||
|
run: |
|
||||||
|
echo "Starting FIO at: $(date)"
|
||||||
|
# Concurrent r/w
|
||||||
|
echo 'Run randrw with size=16M bs=1m'
|
||||||
|
docker compose -f ./compose/e2e-mount.yml exec mount timeout -k5 60 fio --name=fiotest --filename=/mnt/seaweedfs/fiotest --size=16M --rw=randrw --bs=1m --direct=1 --numjobs=8 --ioengine=libaio --iodepth=32 --group_reporting --runtime=30 --time_based=1
|
||||||
|
|
||||||
|
echo "Verify FIO at: $(date)"
|
||||||
|
# Verified write
|
||||||
echo 'Run randwrite with size=16M bs=1m'
|
echo 'Run randwrite with size=16M bs=1m'
|
||||||
docker compose -f ./compose/e2e-mount.yml exec mount timeout -k5 40 fio --name=fiotest --filename=/mnt/seaweedfs/fiotest --size=16M --rw=randwrite --bs=1m --direct=1 --numjobs=8 --ioengine=libaio --iodepth=32 --group_reporting --runtime=30 --time_based=1 --do_verify=0 --verify=crc32c --verify_backlog=1
|
docker compose -f ./compose/e2e-mount.yml exec mount timeout -k5 60 fio --name=fiotest --filename=/mnt/seaweedfs/fiotest --size=16M --rw=randwrite --bs=1m --direct=1 --numjobs=8 --ioengine=libaio --iodepth=32 --group_reporting --runtime=30 --time_based=1 --do_verify=0 --verify=crc32c --verify_backlog=1
|
||||||
|
|
||||||
- name: Save logs
|
- name: Save logs
|
||||||
if: always()
|
if: always()
|
||||||
|
|||||||
@@ -21,13 +21,13 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Set up Go 1.x
|
- name: Set up Go 1.x
|
||||||
uses: actions/setup-go@d0a58c1c4d2b25278816e339b944508c875f3613 # v2
|
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # 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@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v2
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v2
|
||||||
|
|
||||||
- name: Get dependencies
|
- name: Get dependencies
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
name: "helm: publish charts"
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pages: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Publish Helm charts
|
||||||
|
uses: stefanprodan/helm-gh-pages@master
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
charts_dir: k8s/charts
|
||||||
|
target_dir: helm
|
||||||
|
branch: gh-pages
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
name: "helm: lint and test charts"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
paths: ['k8s/**']
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
paths: ['k8s/**']
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint-test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Set up Helm
|
||||||
|
uses: azure/setup-helm@v3
|
||||||
|
with:
|
||||||
|
version: v3.10.0
|
||||||
|
|
||||||
|
- uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: '3.9'
|
||||||
|
check-latest: true
|
||||||
|
|
||||||
|
- name: Set up chart-testing
|
||||||
|
uses: helm/chart-testing-action@v2.4.0
|
||||||
|
|
||||||
|
- name: Run chart-testing (list-changed)
|
||||||
|
id: list-changed
|
||||||
|
run: |
|
||||||
|
changed=$(ct list-changed --chart-dirs k8s/charts)
|
||||||
|
if [[ -n "$changed" ]]; then
|
||||||
|
echo "::set-output name=changed::true"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Run chart-testing (lint)
|
||||||
|
run: ct lint --all --validate-maintainers=false --chart-dirs k8s/charts
|
||||||
|
|
||||||
|
- name: Create kind cluster
|
||||||
|
uses: helm/kind-action@v1.7.0
|
||||||
|
|
||||||
|
- name: Run chart-testing (install)
|
||||||
|
run: ct install --all --chart-dirs k8s/charts
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
# Contributor Covenant Code of Conduct
|
||||||
|
|
||||||
|
## Our Pledge
|
||||||
|
|
||||||
|
In the interest of fostering an open and welcoming environment, we as
|
||||||
|
contributors and maintainers pledge to make participation in our project and
|
||||||
|
our community a harassment-free experience for everyone, regardless of age, body
|
||||||
|
size, disability, ethnicity, gender identity and expression, level of experience,
|
||||||
|
nationality, personal appearance, race, religion, or sexual identity and
|
||||||
|
orientation.
|
||||||
|
|
||||||
|
## Our Standards
|
||||||
|
|
||||||
|
Examples of behavior that contributes to creating a positive environment
|
||||||
|
include:
|
||||||
|
|
||||||
|
- Using welcoming and inclusive language
|
||||||
|
- Being respectful of differing viewpoints and experiences
|
||||||
|
- Gracefully accepting constructive criticism
|
||||||
|
- Focusing on what is best for the community
|
||||||
|
- Showing empathy towards other community members
|
||||||
|
|
||||||
|
Examples of unacceptable behavior by participants include:
|
||||||
|
|
||||||
|
- The use of sexualized language or imagery and unwelcome sexual attention or
|
||||||
|
advances
|
||||||
|
- Trolling, insulting/derogatory comments, and personal or political attacks
|
||||||
|
- Public or private harassment
|
||||||
|
- Publishing others' private information, such as a physical or electronic
|
||||||
|
address, without explicit permission
|
||||||
|
- Other conduct which could reasonably be considered inappropriate in a
|
||||||
|
professional setting
|
||||||
|
|
||||||
|
## Our Responsibilities
|
||||||
|
|
||||||
|
Project maintainers are responsible for clarifying the standards of acceptable
|
||||||
|
behavior and are expected to take appropriate and fair corrective action in
|
||||||
|
response to any instances of unacceptable behavior.
|
||||||
|
|
||||||
|
Project maintainers have the right and responsibility to remove, edit, or
|
||||||
|
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||||
|
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||||
|
permanently any contributor for other behaviors that they deem inappropriate,
|
||||||
|
threatening, offensive, or harmful.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
This Code of Conduct applies both within project spaces and in public spaces
|
||||||
|
when an individual is representing the project or its community. Examples of
|
||||||
|
representing a project or community include using an official project e-mail
|
||||||
|
address, posting via an official social media account, or acting as an appointed
|
||||||
|
representative at an online or offline event. Representation of a project may be
|
||||||
|
further defined and clarified by project maintainers.
|
||||||
|
|
||||||
|
## Enforcement
|
||||||
|
|
||||||
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||||
|
reported by contacting the project team at <enteremailhere>. All
|
||||||
|
complaints will be reviewed and investigated and will result in a response that
|
||||||
|
is deemed necessary and appropriate to the circumstances. The project team is
|
||||||
|
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||||
|
Further details of specific enforcement policies may be posted separately.
|
||||||
|
|
||||||
|
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||||
|
faith may face temporary or permanent repercussions as determined by other
|
||||||
|
members of the project's leadership.
|
||||||
|
|
||||||
|
## Attribution
|
||||||
|
|
||||||
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||||
|
available at [http://contributor-covenant.org/version/1/4][version]
|
||||||
|
|
||||||
|
[homepage]: http://contributor-covenant.org
|
||||||
|
[version]: http://contributor-covenant.org/version/1/4/
|
||||||
@@ -3,12 +3,12 @@
|
|||||||
|
|
||||||
[](https://join.slack.com/t/seaweedfs/shared_invite/enQtMzI4MTMwMjU2MzA3LTEyYzZmZWYzOGQ3MDJlZWMzYmI0OTE4OTJiZjJjODBmMzUxNmYwODg0YjY3MTNlMjBmZDQ1NzQ5NDJhZWI2ZmY)
|
[](https://join.slack.com/t/seaweedfs/shared_invite/enQtMzI4MTMwMjU2MzA3LTEyYzZmZWYzOGQ3MDJlZWMzYmI0OTE4OTJiZjJjODBmMzUxNmYwODg0YjY3MTNlMjBmZDQ1NzQ5NDJhZWI2ZmY)
|
||||||
[](https://twitter.com/intent/follow?screen_name=seaweedfs)
|
[](https://twitter.com/intent/follow?screen_name=seaweedfs)
|
||||||
[](https://github.com/seaweedfs/seaweedfs/actions/workflows/go.yml)
|
[](https://github.com/seaweedfs/seaweedfs/actions/workflows/go.yml)
|
||||||
[](https://godoc.org/github.com/seaweedfs/seaweedfs/weed)
|
[](https://godoc.org/github.com/seaweedfs/seaweedfs/weed)
|
||||||
[](https://github.com/seaweedfs/seaweedfs/wiki)
|
[](https://github.com/seaweedfs/seaweedfs/wiki)
|
||||||
[](https://hub.docker.com/r/chrislusf/seaweedfs/)
|
[](https://hub.docker.com/r/chrislusf/seaweedfs/)
|
||||||
[](https://search.maven.org/search?q=g:com.github.chrislusf)
|
[](https://search.maven.org/search?q=g:com.github.chrislusf)
|
||||||
|
[](https://artifacthub.io/packages/search?repo=seaweedfs)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ Your support will be really appreciated by me and other supporters!
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
### Gold Sponsors
|
### Gold Sponsors
|
||||||
[](https://www.nodion.com)
|
[](https://www.nodion.com)
|
||||||
[](https://www.piknik.com)
|
[](https://www.piknik.com)
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -66,6 +66,7 @@ Table of Contents
|
|||||||
* [Compared to GlusterFS, Ceph](#compared-to-glusterfs-ceph)
|
* [Compared to GlusterFS, Ceph](#compared-to-glusterfs-ceph)
|
||||||
* [Compared to GlusterFS](#compared-to-glusterfs)
|
* [Compared to GlusterFS](#compared-to-glusterfs)
|
||||||
* [Compared to Ceph](#compared-to-ceph)
|
* [Compared to Ceph](#compared-to-ceph)
|
||||||
|
* [Compared to Minio](#compared-to-minio)
|
||||||
* [Dev Plan](#dev-plan)
|
* [Dev Plan](#dev-plan)
|
||||||
* [Installation Guide](#installation-guide)
|
* [Installation Guide](#installation-guide)
|
||||||
* [Disk Related Topics](#disk-related-topics)
|
* [Disk Related Topics](#disk-related-topics)
|
||||||
@@ -79,7 +80,7 @@ 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/seaweedfs/seaweedfs/releases and unzip a single binary file `weed` or `weed.exe`
|
* Download the latest binary from https://github.com/seaweedfs/seaweedfs/releases and unzip a single binary file `weed` or `weed.exe`. Or run `go install github.com/seaweedfs/seaweedfs/weed@latest`.
|
||||||
* 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!
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
- [Evercam Camera Management Software](https://evercam.io/)
|
- [Evercam Camera Management Software](https://evercam.io/)
|
||||||
- [Spherical Elephant GmbH](https://www.sphericalelephant.com)
|
- [Spherical Elephant GmbH](https://www.sphericalelephant.com)
|
||||||
|
- [WizardTales GmbH](https://www.wizardtales.com)
|
||||||
|
|
||||||
- <h2 align="center">Backers</h2>
|
- <h2 align="center">Backers</h2>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM golang:1.19-alpine as builder
|
FROM golang:1.20-alpine as builder
|
||||||
RUN apk add git g++ fuse
|
RUN apk add git g++ fuse
|
||||||
RUN mkdir -p /go/src/github.com/seaweedfs/
|
RUN mkdir -p /go/src/github.com/seaweedfs/
|
||||||
RUN git clone https://github.com/seaweedfs/seaweedfs /go/src/github.com/seaweedfs/seaweedfs
|
RUN git clone https://github.com/seaweedfs/seaweedfs /go/src/github.com/seaweedfs/seaweedfs
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
FROM golang:1.19-buster as builder
|
FROM golang:1.20-buster as builder
|
||||||
|
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get install -y build-essential libsnappy-dev zlib1g-dev libbz2-dev libgflags-dev liblz4-dev libzstd-dev
|
RUN apt-get install -y build-essential libsnappy-dev zlib1g-dev libbz2-dev libgflags-dev liblz4-dev libzstd-dev
|
||||||
|
|
||||||
ENV ROCKSDB_VERSION v7.5.3
|
ENV ROCKSDB_VERSION v8.1.1
|
||||||
|
|
||||||
# build RocksDB
|
# build RocksDB
|
||||||
RUN cd /tmp && \
|
RUN cd /tmp && \
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
FROM golang:1.19-buster as builder
|
FROM golang:1.20-buster as builder
|
||||||
|
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get install -y build-essential libsnappy-dev zlib1g-dev libbz2-dev libgflags-dev liblz4-dev libzstd-dev
|
RUN apt-get install -y build-essential libsnappy-dev zlib1g-dev libbz2-dev libgflags-dev liblz4-dev libzstd-dev
|
||||||
|
|
||||||
ENV ROCKSDB_VERSION v7.5.3
|
ENV ROCKSDB_VERSION v8.1.1
|
||||||
|
|
||||||
# build RocksDB
|
# build RocksDB
|
||||||
RUN cd /tmp && \
|
RUN cd /tmp && \
|
||||||
|
|||||||
+3
-2
@@ -29,7 +29,7 @@ go_build_large_disk:
|
|||||||
build_rocksdb_dev_env:
|
build_rocksdb_dev_env:
|
||||||
docker build --no-cache -t chrislusf/rocksdb_dev_env -f Dockerfile.rocksdb_dev_env .
|
docker build --no-cache -t chrislusf/rocksdb_dev_env -f Dockerfile.rocksdb_dev_env .
|
||||||
|
|
||||||
build_rocksdb_local:
|
build_rocksdb_local: build_rocksdb_dev_env
|
||||||
cd .. ; docker build --no-cache -t chrislusf/seaweedfs:rocksdb_local -f docker/Dockerfile.rocksdb_large_local .
|
cd .. ; docker build --no-cache -t chrislusf/seaweedfs:rocksdb_local -f docker/Dockerfile.rocksdb_large_local .
|
||||||
|
|
||||||
build_rocksdb:
|
build_rocksdb:
|
||||||
@@ -62,7 +62,8 @@ k8s: build
|
|||||||
dev_registry: build
|
dev_registry: build
|
||||||
docker compose -f compose/local-registry-compose.yml -p seaweedfs up
|
docker compose -f compose/local-registry-compose.yml -p seaweedfs up
|
||||||
|
|
||||||
dev_replicate: build
|
dev_replicate:
|
||||||
|
docker build --build-arg TAGS=gocdk --no-cache -t chrislusf/seaweedfs:local -f Dockerfile.go_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
|
dev_auditlog: build
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ CREATE USER IF NOT EXISTS 'seaweedfs'@'%' IDENTIFIED BY 'secret';
|
|||||||
GRANT ALL PRIVILEGES ON seaweedfs.* TO 'seaweedfs'@'%';
|
GRANT ALL PRIVILEGES ON seaweedfs.* TO 'seaweedfs'@'%';
|
||||||
FLUSH PRIVILEGES;
|
FLUSH PRIVILEGES;
|
||||||
USE seaweedfs;
|
USE seaweedfs;
|
||||||
CREATE TABLE IF NOT EXISTS filemeta (
|
CREATE TABLE IF NOT EXISTS `filemeta` (
|
||||||
dirhash BIGINT COMMENT 'first 64 bits of MD5 hash value of directory field',
|
`dirhash` BIGINT NOT NULL COMMENT 'first 64 bits of MD5 hash value of directory field',
|
||||||
name VARCHAR(1000) COMMENT 'directory or file name',
|
`name` VARCHAR(766) NOT NULL COMMENT 'directory or file name',
|
||||||
directory TEXT COMMENT 'full path to parent directory',
|
`directory` TEXT NOT NULL COMMENT 'full path to parent directory',
|
||||||
meta LONGBLOB,
|
`meta` LONGBLOB,
|
||||||
PRIMARY KEY (dirhash, name)
|
PRIMARY KEY (`dirhash`, `name`)
|
||||||
) DEFAULT CHARSET=utf8;
|
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
|
||||||
@@ -1,49 +1,50 @@
|
|||||||
module github.com/seaweedfs/seaweedfs
|
module github.com/seaweedfs/seaweedfs
|
||||||
|
|
||||||
go 1.19
|
go 1.20
|
||||||
|
|
||||||
require (
|
require (
|
||||||
cloud.google.com/go v0.105.0 // indirect
|
cloud.google.com/go v0.110.2 // indirect
|
||||||
cloud.google.com/go/pubsub v1.27.1
|
cloud.google.com/go/pubsub v1.31.0
|
||||||
cloud.google.com/go/storage v1.28.1
|
cloud.google.com/go/storage v1.30.1
|
||||||
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.15.0
|
github.com/Azure/azure-storage-blob-go v0.15.0
|
||||||
github.com/Shopify/sarama v1.37.2
|
github.com/Shopify/sarama v1.38.1
|
||||||
github.com/aws/aws-sdk-go v1.44.146
|
github.com/aws/aws-sdk-go v1.44.280
|
||||||
github.com/beorn7/perks v1.0.1 // indirect
|
github.com/beorn7/perks v1.0.1 // indirect
|
||||||
github.com/bwmarrin/snowflake v0.3.0
|
github.com/bwmarrin/snowflake v0.3.0
|
||||||
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
github.com/cenkalti/backoff/v4 v4.2.1
|
||||||
github.com/coreos/go-semver v0.3.0 // indirect
|
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
||||||
github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534 // indirect
|
github.com/coreos/go-semver v0.3.1 // indirect
|
||||||
|
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
||||||
github.com/disintegration/imaging v1.6.2
|
github.com/disintegration/imaging v1.6.2
|
||||||
github.com/dustin/go-humanize v1.0.0
|
github.com/dustin/go-humanize v1.0.1
|
||||||
github.com/eapache/go-resiliency v1.3.0 // indirect
|
github.com/eapache/go-resiliency v1.3.0 // indirect
|
||||||
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect
|
github.com/eapache/go-xerial-snappy v0.0.0-20230111030713-bf00bc1b83b6 // indirect
|
||||||
github.com/eapache/queue v1.1.0 // indirect
|
github.com/eapache/queue v1.1.0 // indirect
|
||||||
github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a
|
github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a
|
||||||
github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c // indirect
|
github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c // indirect
|
||||||
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.20.0
|
github.com/fclairamb/ftpserverlib v0.21.0
|
||||||
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
||||||
github.com/go-errors/errors v1.1.1 // indirect
|
github.com/go-errors/errors v1.1.1 // indirect
|
||||||
github.com/go-redis/redis/v8 v8.11.5
|
github.com/go-redis/redis/v8 v8.11.5
|
||||||
github.com/go-redsync/redsync/v4 v4.6.0
|
github.com/go-redsync/redsync/v4 v4.8.1
|
||||||
github.com/go-sql-driver/mysql v1.7.0
|
github.com/go-sql-driver/mysql v1.7.1
|
||||||
github.com/go-zookeeper/zk v1.0.2 // indirect
|
github.com/go-zookeeper/zk v1.0.3 // indirect
|
||||||
github.com/gocql/gocql v0.0.0-20210707082121-9a3953d1826d
|
github.com/gocql/gocql v1.5.2
|
||||||
github.com/golang-jwt/jwt v3.2.2+incompatible
|
github.com/golang-jwt/jwt v3.2.2+incompatible
|
||||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||||
github.com/golang/protobuf v1.5.2
|
github.com/golang/protobuf v1.5.3
|
||||||
github.com/golang/snappy v0.0.4 // indirect
|
github.com/golang/snappy v0.0.4 // indirect
|
||||||
github.com/google/btree v1.1.2
|
github.com/google/btree v1.1.2
|
||||||
github.com/google/go-cmp v0.5.9 // indirect
|
github.com/google/go-cmp v0.5.9 // indirect
|
||||||
github.com/google/uuid v1.3.0
|
github.com/google/uuid v1.3.0
|
||||||
github.com/google/wire v0.5.0 // indirect
|
github.com/google/wire v0.5.0 // indirect
|
||||||
github.com/googleapis/gax-go/v2 v2.7.0 // indirect
|
github.com/googleapis/gax-go/v2 v2.10.0 // indirect
|
||||||
github.com/gorilla/mux v1.8.0
|
github.com/gorilla/mux v1.8.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.1.0 // indirect
|
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||||
@@ -51,46 +52,45 @@ require (
|
|||||||
github.com/hashicorp/go-uuid v1.0.3 // indirect
|
github.com/hashicorp/go-uuid v1.0.3 // indirect
|
||||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||||
github.com/jcmturner/gofork v1.7.6 // indirect
|
github.com/jcmturner/gofork v1.7.6 // indirect
|
||||||
github.com/jcmturner/gokrb5/v8 v8.4.3 // indirect
|
github.com/jcmturner/gokrb5/v8 v8.4.4 // indirect
|
||||||
github.com/jinzhu/copier v0.3.5
|
github.com/jinzhu/copier v0.3.5
|
||||||
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
||||||
github.com/json-iterator/go v1.1.12
|
github.com/json-iterator/go v1.1.12
|
||||||
github.com/karlseguin/ccache/v2 v2.0.8
|
github.com/karlseguin/ccache/v2 v2.0.8
|
||||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
|
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
|
||||||
github.com/klauspost/compress v1.15.11 // indirect
|
github.com/klauspost/compress v1.16.0 // indirect
|
||||||
github.com/klauspost/reedsolomon v1.11.3
|
github.com/klauspost/reedsolomon v1.11.7
|
||||||
github.com/kurin/blazer v0.5.3
|
github.com/kurin/blazer v0.5.3
|
||||||
github.com/lib/pq v1.10.7
|
github.com/lib/pq v1.10.9
|
||||||
github.com/linxGnu/grocksdb v1.7.10
|
github.com/linxGnu/grocksdb v1.8.0
|
||||||
github.com/magiconair/properties v1.8.6 // indirect
|
github.com/magiconair/properties v1.8.7 // indirect
|
||||||
github.com/mailru/easyjson v0.7.7 // indirect
|
github.com/mailru/easyjson v0.7.7 // indirect
|
||||||
github.com/mattn/go-ieproxy v0.0.9 // indirect
|
github.com/mattn/go-ieproxy v0.0.11 // indirect
|
||||||
github.com/mattn/go-isatty v0.0.16 // indirect
|
github.com/mattn/go-isatty v0.0.17 // indirect
|
||||||
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
|
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
|
||||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||||
github.com/olivere/elastic/v7 v7.0.32
|
github.com/olivere/elastic/v7 v7.0.32
|
||||||
github.com/pelletier/go-toml v1.9.5 // indirect
|
|
||||||
github.com/peterh/liner v1.2.2
|
github.com/peterh/liner v1.2.2
|
||||||
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.2.0
|
||||||
github.com/prometheus/client_golang v1.14.0
|
github.com/prometheus/client_golang v1.16.0
|
||||||
github.com/prometheus/client_model v0.3.0 // indirect
|
github.com/prometheus/client_model v0.3.0 // indirect
|
||||||
github.com/prometheus/common v0.37.0 // indirect
|
github.com/prometheus/common v0.42.0 // indirect
|
||||||
github.com/prometheus/procfs v0.8.0
|
github.com/prometheus/procfs v0.11.0
|
||||||
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // 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-20230129092748-24d4a6f8daec // indirect
|
||||||
github.com/seaweedfs/goexif v2.0.0+incompatible
|
github.com/seaweedfs/goexif v1.0.3
|
||||||
github.com/seaweedfs/raft v1.1.0
|
github.com/seaweedfs/raft v1.1.3
|
||||||
github.com/sirupsen/logrus v1.9.0 // indirect
|
github.com/sirupsen/logrus v1.9.0 // indirect
|
||||||
github.com/spf13/afero v1.9.2 // indirect
|
github.com/spf13/afero v1.9.5 // indirect
|
||||||
github.com/spf13/cast v1.5.0 // indirect
|
github.com/spf13/cast v1.5.1 // indirect
|
||||||
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
||||||
github.com/spf13/viper v1.14.0
|
github.com/spf13/viper v1.16.0
|
||||||
github.com/stretchr/testify v1.8.1
|
github.com/stretchr/testify v1.8.4
|
||||||
github.com/stvp/tempredis v0.0.0-20181119212430-b82af8480203
|
github.com/stvp/tempredis v0.0.0-20181119212430-b82af8480203
|
||||||
github.com/syndtr/goleveldb v1.0.1-0.20190318030020-c3a204f8e965
|
github.com/syndtr/goleveldb v1.0.1-0.20190318030020-c3a204f8e965
|
||||||
github.com/tidwall/gjson v1.14.4
|
github.com/tidwall/gjson v1.14.4
|
||||||
@@ -103,136 +103,212 @@ require (
|
|||||||
github.com/viant/ptrie v0.3.0
|
github.com/viant/ptrie v0.3.0
|
||||||
github.com/viant/toolbox v0.33.2 // indirect
|
github.com/viant/toolbox v0.33.2 // indirect
|
||||||
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
|
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
|
||||||
github.com/xdg-go/scram v1.1.1 // indirect
|
github.com/xdg-go/scram v1.1.2 // indirect
|
||||||
github.com/xdg-go/stringprep v1.0.3 // indirect
|
github.com/xdg-go/stringprep v1.0.4 // indirect
|
||||||
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
|
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect
|
||||||
go.etcd.io/etcd/client/v3 v3.5.6
|
go.etcd.io/etcd/client/v3 v3.5.9
|
||||||
go.mongodb.org/mongo-driver v1.11.0
|
go.mongodb.org/mongo-driver v1.11.6
|
||||||
go.opencensus.io v0.24.0 // indirect
|
go.opencensus.io v0.24.0 // indirect
|
||||||
gocloud.dev v0.27.0
|
gocloud.dev v0.29.0
|
||||||
gocloud.dev/pubsub/natspubsub v0.27.0
|
gocloud.dev/pubsub/natspubsub v0.29.0
|
||||||
gocloud.dev/pubsub/rabbitpubsub v0.27.0
|
gocloud.dev/pubsub/rabbitpubsub v0.29.0
|
||||||
golang.org/x/crypto v0.1.0 // indirect
|
golang.org/x/crypto v0.10.0 // indirect
|
||||||
golang.org/x/exp v0.0.0-20220414153411-bcd21879b8fd
|
golang.org/x/exp v0.0.0-20230124195608-d38c7dcee874
|
||||||
golang.org/x/image v0.0.0-20200119044424-58c23975cae1
|
golang.org/x/image v0.7.0
|
||||||
golang.org/x/net v0.2.0
|
golang.org/x/net v0.11.0
|
||||||
golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 // indirect
|
golang.org/x/oauth2 v0.8.0 // indirect
|
||||||
golang.org/x/sys v0.3.0
|
golang.org/x/sys v0.9.0
|
||||||
golang.org/x/text v0.4.0 // indirect
|
golang.org/x/text v0.10.0 // indirect
|
||||||
golang.org/x/tools v0.3.0
|
golang.org/x/tools v0.10.0
|
||||||
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
|
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
|
||||||
google.golang.org/api v0.103.0
|
google.golang.org/api v0.126.0
|
||||||
google.golang.org/appengine v1.6.7 // indirect
|
google.golang.org/appengine v1.6.7 // indirect
|
||||||
google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c // indirect
|
google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc // indirect
|
||||||
google.golang.org/grpc v1.51.0
|
google.golang.org/grpc v1.55.0
|
||||||
google.golang.org/protobuf v1.28.1
|
google.golang.org/protobuf v1.30.0
|
||||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||||
modernc.org/b v1.0.0 // indirect
|
modernc.org/b v1.0.0 // indirect
|
||||||
modernc.org/cc/v3 v3.40.0 // indirect
|
modernc.org/cc/v3 v3.40.0 // indirect
|
||||||
modernc.org/ccgo/v3 v3.16.13 // indirect
|
modernc.org/ccgo/v3 v3.16.13 // indirect
|
||||||
modernc.org/libc v1.21.5 // indirect
|
modernc.org/libc v1.22.5 // indirect
|
||||||
modernc.org/mathutil v1.5.0 // indirect
|
modernc.org/mathutil v1.5.0 // indirect
|
||||||
modernc.org/memory v1.4.0 // indirect
|
modernc.org/memory v1.5.0 // indirect
|
||||||
modernc.org/opt v0.1.3 // indirect
|
modernc.org/opt v0.1.3 // indirect
|
||||||
modernc.org/sqlite v1.20.0
|
modernc.org/sqlite v1.23.1
|
||||||
modernc.org/strutil v1.1.3
|
modernc.org/strutil v1.1.3
|
||||||
modernc.org/token v1.0.1 // indirect
|
modernc.org/token v1.0.1 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/Jille/raft-grpc-transport v1.3.0
|
github.com/Jille/raft-grpc-transport v1.4.0
|
||||||
github.com/arangodb/go-driver v1.4.0
|
github.com/arangodb/go-driver v1.6.0
|
||||||
github.com/armon/go-metrics v0.4.1
|
github.com/armon/go-metrics v0.4.1
|
||||||
|
github.com/aws/aws-sdk-go-v2 v1.17.4
|
||||||
|
github.com/aws/aws-sdk-go-v2/config v1.18.12
|
||||||
|
github.com/aws/aws-sdk-go-v2/credentials v1.13.12
|
||||||
|
github.com/aws/aws-sdk-go-v2/service/s3 v1.30.2
|
||||||
github.com/fluent/fluent-logger-golang v1.9.0
|
github.com/fluent/fluent-logger-golang v1.9.0
|
||||||
github.com/google/flatbuffers v22.11.23+incompatible
|
github.com/google/flatbuffers/go v0.0.0-20230108230133-3b8644d32c50
|
||||||
github.com/hanwen/go-fuse/v2 v2.1.1-0.20220627082937-d01fda7edf17
|
github.com/hanwen/go-fuse/v2 v2.3.0
|
||||||
github.com/hashicorp/raft v1.3.11
|
github.com/hashicorp/raft v1.5.0
|
||||||
github.com/hashicorp/raft-boltdb/v2 v2.2.2
|
github.com/hashicorp/raft-boltdb/v2 v2.2.2
|
||||||
github.com/rabbitmq/amqp091-go v1.5.0
|
github.com/rabbitmq/amqp091-go v1.8.1
|
||||||
github.com/tikv/client-go/v2 v2.0.2
|
github.com/rclone/rclone v1.62.2
|
||||||
github.com/ydb-platform/ydb-go-sdk-auth-environ v0.1.2
|
github.com/schollz/progressbar/v3 v3.13.1
|
||||||
github.com/ydb-platform/ydb-go-sdk/v3 v3.40.1
|
github.com/tikv/client-go/v2 v2.0.7
|
||||||
golang.org/x/sync v0.1.0
|
github.com/ydb-platform/ydb-go-sdk-auth-environ v0.2.0
|
||||||
|
github.com/ydb-platform/ydb-go-sdk/v3 v3.47.3
|
||||||
google.golang.org/grpc/security/advancedtls v0.0.0-20220622233350-5cdb09fa29c1
|
google.golang.org/grpc/security/advancedtls v0.0.0-20220622233350-5cdb09fa29c1
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
cloud.google.com/go/compute v1.12.1 // indirect
|
cloud.google.com/go/compute v1.19.3 // indirect
|
||||||
cloud.google.com/go/compute/metadata v0.2.1 // indirect
|
cloud.google.com/go/compute/metadata v0.2.3 // indirect
|
||||||
cloud.google.com/go/iam v0.7.0 // indirect
|
cloud.google.com/go/iam v1.0.1 // indirect
|
||||||
|
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 // indirect
|
||||||
|
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 // indirect
|
||||||
|
github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect
|
||||||
|
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.0.0 // indirect
|
||||||
|
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect
|
||||||
|
github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect
|
||||||
|
github.com/Max-Sum/base32768 v0.0.0-20230304063302-18e6ce5945fd // indirect
|
||||||
|
github.com/Microsoft/go-winio v0.5.2 // indirect
|
||||||
|
github.com/Unknwon/goconfig v1.0.0 // indirect
|
||||||
|
github.com/abbot/go-http-auth v0.4.0 // indirect
|
||||||
github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e // indirect
|
github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e // indirect
|
||||||
github.com/aws/aws-sdk-go-v2 v1.16.8 // indirect
|
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 // indirect
|
||||||
github.com/aws/aws-sdk-go-v2/config v1.15.15 // indirect
|
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.22 // indirect
|
||||||
github.com/aws/aws-sdk-go-v2/credentials v1.12.10 // indirect
|
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.28 // indirect
|
||||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.9 // indirect
|
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.22 // indirect
|
||||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.15 // indirect
|
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.29 // indirect
|
||||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.9 // indirect
|
github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.19 // indirect
|
||||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.16 // indirect
|
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.11 // indirect
|
||||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.9 // indirect
|
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.23 // indirect
|
||||||
github.com/aws/aws-sdk-go-v2/service/sns v1.17.10 // indirect
|
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.22 // indirect
|
||||||
github.com/aws/aws-sdk-go-v2/service/sqs v1.19.1 // indirect
|
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.22 // indirect
|
||||||
github.com/aws/aws-sdk-go-v2/service/sso v1.11.13 // indirect
|
github.com/aws/aws-sdk-go-v2/service/sns v1.20.2 // indirect
|
||||||
github.com/aws/aws-sdk-go-v2/service/sts v1.16.10 // indirect
|
github.com/aws/aws-sdk-go-v2/service/sqs v1.20.2 // indirect
|
||||||
github.com/aws/smithy-go v1.12.0 // indirect
|
github.com/aws/aws-sdk-go-v2/service/sso v1.12.1 // indirect
|
||||||
github.com/benbjohnson/clock v1.1.0 // indirect
|
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.1 // indirect
|
||||||
|
github.com/aws/aws-sdk-go-v2/service/sts v1.18.3 // indirect
|
||||||
|
github.com/aws/smithy-go v1.13.5 // indirect
|
||||||
|
github.com/benbjohnson/clock v1.3.0 // indirect
|
||||||
github.com/boltdb/bolt v1.3.1 // indirect
|
github.com/boltdb/bolt v1.3.1 // indirect
|
||||||
|
github.com/buengese/sgzip v0.1.1 // indirect
|
||||||
|
github.com/calebcase/tmpfile v1.0.3 // indirect
|
||||||
|
github.com/colinmarc/hdfs/v2 v2.3.0 // indirect
|
||||||
github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548 // indirect
|
github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548 // indirect
|
||||||
github.com/d4l3k/messagediff v1.2.1 // indirect
|
github.com/d4l3k/messagediff v1.2.1 // indirect
|
||||||
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 // indirect
|
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 // indirect
|
||||||
|
github.com/dropbox/dropbox-sdk-go-unofficial/v6 v6.0.5 // indirect
|
||||||
|
github.com/elastic/gosigar v0.14.2 // indirect
|
||||||
github.com/fatih/color v1.13.0 // indirect
|
github.com/fatih/color v1.13.0 // indirect
|
||||||
github.com/fclairamb/go-log v0.4.1 // indirect
|
github.com/fclairamb/go-log v0.4.1 // indirect
|
||||||
|
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
|
||||||
|
github.com/geoffgarside/ber v1.1.0 // indirect
|
||||||
|
github.com/go-chi/chi/v5 v5.0.8 // indirect
|
||||||
|
github.com/go-ole/go-ole v1.2.6 // indirect
|
||||||
|
github.com/gofrs/flock v0.8.1 // indirect
|
||||||
github.com/gogo/protobuf v1.3.2 // indirect
|
github.com/gogo/protobuf v1.3.2 // indirect
|
||||||
github.com/golang-jwt/jwt/v4 v4.4.2 // indirect
|
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
|
||||||
github.com/googleapis/enterprise-certificate-proxy v0.2.0 // indirect
|
github.com/google/go-querystring v1.1.0 // indirect
|
||||||
|
github.com/google/s2a-go v0.1.4 // indirect
|
||||||
|
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
|
||||||
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
|
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
|
||||||
github.com/hashicorp/go-hclog v1.2.0 // indirect
|
github.com/hashicorp/go-hclog v1.5.0 // indirect
|
||||||
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
|
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
|
||||||
github.com/hashicorp/go-msgpack v1.1.5 // indirect
|
github.com/hashicorp/go-msgpack v1.1.5 // indirect
|
||||||
github.com/hashicorp/golang-lru v0.5.4 // indirect
|
github.com/hashicorp/golang-lru v0.6.0 // indirect
|
||||||
|
github.com/hirochachacha/go-smb2 v1.1.0 // indirect
|
||||||
|
github.com/iguanesolutions/go-systemd/v5 v5.1.1 // indirect
|
||||||
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
|
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
|
||||||
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
|
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
|
||||||
|
github.com/jcmturner/goidentity/v6 v6.0.1 // indirect
|
||||||
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
|
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
|
||||||
github.com/jonboulle/clockwork v0.2.2 // indirect
|
github.com/jlaffaye/ftp v0.1.1-0.20230214004652-d84bf4be2b6e // indirect
|
||||||
|
github.com/jonboulle/clockwork v0.3.0 // indirect
|
||||||
github.com/josharian/intern v1.0.0 // indirect
|
github.com/josharian/intern v1.0.0 // indirect
|
||||||
github.com/klauspost/cpuid/v2 v2.1.1 // indirect
|
github.com/jtolio/eventkit v0.0.0-20221004135224-074cf276595b // indirect
|
||||||
|
github.com/jzelinskie/whirlpool v0.0.0-20201016144138-0675e54bb004 // indirect
|
||||||
|
github.com/klauspost/cpuid/v2 v2.2.3 // indirect
|
||||||
|
github.com/koofr/go-httpclient v0.0.0-20230225102643-5d51a2e9dea6 // indirect
|
||||||
|
github.com/koofr/go-koofrclient v0.0.0-20221207135200-cbd7fc9ad6a6 // indirect
|
||||||
|
github.com/kr/fs v0.1.0 // indirect
|
||||||
|
github.com/kylelemons/godebug v1.1.0 // indirect
|
||||||
|
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
|
||||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||||
github.com/mattn/go-runewidth v0.0.7 // indirect
|
github.com/mattn/go-runewidth v0.0.14 // indirect
|
||||||
github.com/mattn/go-sqlite3 v2.0.1+incompatible // indirect
|
github.com/mattn/go-sqlite3 v2.0.1+incompatible // indirect
|
||||||
github.com/montanaflynn/stats v0.6.6 // indirect
|
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
|
||||||
github.com/nats-io/nats.go v1.16.0 // indirect
|
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||||
|
github.com/montanaflynn/stats v0.7.0 // indirect
|
||||||
|
github.com/nats-io/nats.go v1.23.0 // indirect
|
||||||
github.com/nats-io/nkeys v0.3.0 // indirect
|
github.com/nats-io/nkeys v0.3.0 // indirect
|
||||||
github.com/nats-io/nuid v1.0.1 // indirect
|
github.com/nats-io/nuid v1.0.1 // indirect
|
||||||
|
github.com/ncw/go-acd v0.0.0-20201019170801-fe55f33415b1 // indirect
|
||||||
|
github.com/ncw/swift/v2 v2.0.1 // indirect
|
||||||
github.com/opentracing/opentracing-go v1.2.0 // indirect
|
github.com/opentracing/opentracing-go v1.2.0 // indirect
|
||||||
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
|
github.com/oracle/oci-go-sdk/v65 v65.32.0 // indirect
|
||||||
|
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
|
||||||
|
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
|
||||||
|
github.com/pengsrc/go-shared v0.2.1-0.20190131101655-1999055a4a14 // indirect
|
||||||
github.com/philhofer/fwd v1.1.1 // indirect
|
github.com/philhofer/fwd v1.1.1 // indirect
|
||||||
github.com/pierrec/lz4/v4 v4.1.17 // indirect
|
github.com/pierrec/lz4/v4 v4.1.17 // indirect
|
||||||
github.com/pingcap/errors v0.11.5-0.20211224045212-9687c2b0f87c // indirect
|
github.com/pingcap/errors v0.11.5-0.20211224045212-9687c2b0f87c // indirect
|
||||||
github.com/pingcap/failpoint v0.0.0-20210918120811-547c13e3eb00 // indirect
|
github.com/pingcap/failpoint v0.0.0-20220801062533-2eaa32854a6c // indirect
|
||||||
github.com/pingcap/kvproto v0.0.0-20221026112947-f8d61344b172 // indirect
|
github.com/pingcap/kvproto v0.0.0-20230403051650-e166ae588106 // indirect
|
||||||
github.com/pingcap/log v1.1.1-0.20221015072633-39906604fb81 // indirect
|
github.com/pingcap/log v1.1.1-0.20221110025148-ca232912c9f3 // indirect
|
||||||
github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd // indirect
|
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
|
||||||
|
github.com/pkg/sftp v1.13.6-0.20230213180117-971c283182b6 // indirect
|
||||||
|
github.com/pkg/xattr v0.4.9 // indirect
|
||||||
|
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
|
||||||
|
github.com/putdotio/go-putio/putio v0.0.0-20200123120452-16d982cac2b8 // indirect
|
||||||
|
github.com/puzpuzpuz/xsync/v2 v2.4.1 // indirect
|
||||||
|
github.com/rfjakob/eme v1.1.2 // indirect
|
||||||
|
github.com/rivo/uniseg v0.4.4 // indirect
|
||||||
|
github.com/shirou/gopsutil/v3 v3.23.2 // indirect
|
||||||
|
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 // indirect
|
||||||
|
github.com/sony/gobreaker v0.5.0 // indirect
|
||||||
|
github.com/spacemonkeygo/monkit/v3 v3.0.19 // indirect
|
||||||
github.com/spf13/pflag v1.0.5 // indirect
|
github.com/spf13/pflag v1.0.5 // indirect
|
||||||
github.com/stathat/consistent v1.0.0 // indirect
|
github.com/subosito/gotenv v1.4.2 // indirect
|
||||||
github.com/subosito/gotenv v1.4.1 // indirect
|
github.com/t3rm1n4l/go-mega v0.0.0-20230228171823-a01a2cda13ca // indirect
|
||||||
github.com/tikv/pd/client v0.0.0-20221031025758-80f0d8ca4d07 // indirect
|
github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a // indirect
|
||||||
|
github.com/tikv/pd/client v0.0.0-20230329114254-1948c247c2b1 // indirect
|
||||||
github.com/tinylib/msgp v1.1.6 // indirect
|
github.com/tinylib/msgp v1.1.6 // indirect
|
||||||
|
github.com/tklauser/go-sysconf v0.3.11 // indirect
|
||||||
|
github.com/tklauser/numcpus v0.6.0 // indirect
|
||||||
github.com/twmb/murmur3 v1.1.3 // indirect
|
github.com/twmb/murmur3 v1.1.3 // indirect
|
||||||
|
github.com/vivint/infectious v0.0.0-20200605153912-25a574ae18a3 // indirect
|
||||||
|
github.com/xanzy/ssh-agent v0.3.3 // indirect
|
||||||
github.com/yandex-cloud/go-genproto v0.0.0-20211115083454-9ca41db5ed9e // indirect
|
github.com/yandex-cloud/go-genproto v0.0.0-20211115083454-9ca41db5ed9e // indirect
|
||||||
github.com/ydb-platform/ydb-go-genproto v0.0.0-20220922065549-66df47a830ba // indirect
|
github.com/ydb-platform/ydb-go-genproto v0.0.0-20230528143953-42c825ace222 // indirect
|
||||||
github.com/ydb-platform/ydb-go-yc v0.8.3 // indirect
|
github.com/ydb-platform/ydb-go-yc v0.10.2 // indirect
|
||||||
github.com/ydb-platform/ydb-go-yc-metadata v0.5.2 // indirect
|
github.com/ydb-platform/ydb-go-yc-metadata v0.5.2 // indirect
|
||||||
go.etcd.io/bbolt v1.3.6 // indirect
|
github.com/yunify/qingstor-sdk-go/v3 v3.2.0 // indirect
|
||||||
go.etcd.io/etcd/api/v3 v3.5.6 // indirect
|
github.com/yusufpapurcu/wmi v1.2.2 // indirect
|
||||||
go.etcd.io/etcd/client/pkg/v3 v3.5.6 // indirect
|
github.com/zeebo/blake3 v0.2.3 // indirect
|
||||||
go.uber.org/atomic v1.9.0 // indirect
|
github.com/zeebo/errs v1.3.0 // indirect
|
||||||
go.uber.org/multierr v1.8.0 // indirect
|
go.etcd.io/bbolt v1.3.7 // indirect
|
||||||
go.uber.org/zap v1.22.0 // indirect
|
go.etcd.io/etcd/api/v3 v3.5.9 // indirect
|
||||||
golang.org/x/mod v0.7.0 // indirect
|
go.etcd.io/etcd/client/pkg/v3 v3.5.9 // indirect
|
||||||
|
go.uber.org/atomic v1.10.0 // indirect
|
||||||
|
go.uber.org/multierr v1.9.0 // indirect
|
||||||
|
go.uber.org/zap v1.24.0 // indirect
|
||||||
|
golang.org/x/mod v0.11.0 // indirect
|
||||||
|
golang.org/x/sync v0.3.0 // indirect
|
||||||
|
golang.org/x/term v0.9.0 // indirect
|
||||||
|
golang.org/x/time v0.3.0 // indirect
|
||||||
|
google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc // indirect
|
||||||
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect
|
||||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||||
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
|
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
|
||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
lukechampine.com/uint128 v1.2.0 // indirect
|
lukechampine.com/uint128 v1.2.0 // indirect
|
||||||
|
storj.io/common v0.0.0-20221123115229-fed3e6651b63 // indirect
|
||||||
|
storj.io/drpc v0.0.32 // indirect
|
||||||
|
storj.io/uplink v1.10.0 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
// replace github.com/seaweedfs/raft => /Users/chrislu/go/src/github.com/seaweedfs/raft
|
// replace github.com/seaweedfs/raft => /Users/chrislu/go/src/github.com/seaweedfs/raft
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
# Artifact Hub repository metadata file
|
||||||
|
#
|
||||||
|
# Some settings like the verified publisher flag or the ignored packages won't
|
||||||
|
# be applied until the next time the repository is processed. Please keep in
|
||||||
|
# mind that the repository won't be processed if it has not changed since the
|
||||||
|
# last time it was processed. Depending on the repository kind, this is checked
|
||||||
|
# in a different way. For Helm http based repositories, we consider it has
|
||||||
|
# changed if the `index.yaml` file changes. For git based repositories, it does
|
||||||
|
# when the hash of the last commit in the branch you set up changes. This does
|
||||||
|
# NOT apply to ownership claim operations, which are processed immediately.
|
||||||
|
#
|
||||||
|
|
||||||
|
repositoryID: 5b2f1fe2-20e5-486e-9746-183484642aa2
|
||||||
|
# owners: # (optional, used to claim repository ownership)
|
||||||
|
# - name: username
|
||||||
|
# email: email
|
||||||
File renamed without changes.
@@ -1,5 +1,5 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
description: SeaweedFS
|
description: SeaweedFS
|
||||||
name: seaweedfs
|
name: seaweedfs
|
||||||
appVersion: "3.36"
|
appVersion: "3.53"
|
||||||
version: "3.36"
|
version: "3.53"
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
# SEAWEEDFS - helm chart (2.x+)
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
### Add the helm repo
|
||||||
|
|
||||||
|
`helm repo add seaweedfs https://seaweedfs.github.io/seaweedfs/helm`
|
||||||
|
|
||||||
|
### Install the helm chart
|
||||||
|
|
||||||
|
`helm install seaweedfs seaweedfs/seaweedfs`
|
||||||
|
|
||||||
|
### (Recommended) Provide `values.yaml`
|
||||||
|
|
||||||
|
`helm install --values=values.yaml seaweedfs seaweedfs/seaweedfs`
|
||||||
|
|
||||||
|
## Info:
|
||||||
|
* master/filer/volume are stateful sets with anti-affinity on the hostname,
|
||||||
|
so your deployment will be spread/HA.
|
||||||
|
* chart is using memsql(mysql) as the filer backend to enable HA (multiple filer instances) and backup/HA memsql can provide.
|
||||||
|
* mysql user/password are created in a k8s secret (secret-seaweedfs-db.yaml) and injected to the filer with ENV.
|
||||||
|
* cert config exists and can be enabled, but not been tested, requires cert-manager to be installed.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
### Database
|
||||||
|
|
||||||
|
leveldb is the default database this only supports one filer replica.
|
||||||
|
|
||||||
|
To have multiple filers a external datastore is recommened.
|
||||||
|
|
||||||
|
Such as MySQL-compatible database, as specified in the `values.yaml` at `filer.extraEnvironmentVars`.
|
||||||
|
This database should be pre-configured and initialized by running:
|
||||||
|
```sql
|
||||||
|
CREATE TABLE IF NOT EXISTS `filemeta` (
|
||||||
|
`dirhash` BIGINT NOT NULL COMMENT 'first 64 bits of MD5 hash value of directory field',
|
||||||
|
`name` VARCHAR(766) NOT NULL COMMENT 'directory or file name',
|
||||||
|
`directory` TEXT NOT NULL COMMENT 'full path to parent directory',
|
||||||
|
`meta` LONGBLOB,
|
||||||
|
PRIMARY KEY (`dirhash`, `name`)
|
||||||
|
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternative database can also be configured (e.g. leveldb, postgres) following the instructions at `filer.extraEnvironmentVars`.
|
||||||
|
|
||||||
|
### Node Labels
|
||||||
|
Kubernetes nodes can have labels which help to define which node(Host) will run which pod:
|
||||||
|
|
||||||
|
Here is an example:
|
||||||
|
* s3/filer/master needs the label **sw-backend=true**
|
||||||
|
* volume need the label **sw-volume=true**
|
||||||
|
|
||||||
|
to label a node to be able to run all pod types in k8s:
|
||||||
|
```
|
||||||
|
kubectl label node YOUR_NODE_NAME sw-volume=true,sw-backend=true
|
||||||
|
```
|
||||||
|
|
||||||
|
on production k8s deployment you will want each pod to have a different host,
|
||||||
|
especially the volume server and the masters, all pods (master/volume/filer)
|
||||||
|
should have anti-affinity rules to disallow running multiple component pods on the same host.
|
||||||
|
|
||||||
|
If you still want to run multiple pods of the same component (master/volume/filer) on the same host please set/update the corresponding affinity rule in values.yaml to an empty one:
|
||||||
|
|
||||||
|
```affinity: ""```
|
||||||
|
|
||||||
|
## PVC - storage class ###
|
||||||
|
|
||||||
|
On the volume stateful set added support for k8s PVC, currently example
|
||||||
|
with the simple local-path-provisioner from Rancher (comes included with k3d / k3s)
|
||||||
|
https://github.com/rancher/local-path-provisioner
|
||||||
|
|
||||||
|
you can use ANY storage class you like, just update the correct storage-class
|
||||||
|
for your deployment.
|
||||||
|
|
||||||
|
## current instances config (AIO):
|
||||||
|
|
||||||
|
1 instance for each type (master/filer+s3/volume)
|
||||||
|
|
||||||
|
You can update the replicas count for each node type in values.yaml,
|
||||||
|
need to add more nodes with the corresponding labels if applicable.
|
||||||
|
|
||||||
|
Most of the configuration are available through values.yaml any pull requests to expand functionality or usability are greatly appreciated. Any pull request must pass [chart-testing](https://github.com/helm/chart-testing).
|
||||||
File renamed without changes.
File renamed without changes.
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
{{- if .Values.global.enableSecurity }}
|
{{- if .Values.global.enableSecurity }}
|
||||||
apiVersion: certmanager.k8s.io/v1alpha1
|
apiVersion: cert-manager.io/v1{{ if .Values.global.certificates.alphacrds }}alpha1{{ end }}
|
||||||
kind: Certificate
|
kind: Certificate
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "seaweedfs.name" . }}-ca-cert
|
name: {{ template "seaweedfs.name" . }}-ca-cert
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{{- if .Values.global.enableSecurity }}
|
||||||
|
apiVersion: cert-manager.io/v1{{ if .Values.global.certificates.alphacrds }}alpha1{{ end }}
|
||||||
|
kind: Issuer
|
||||||
|
metadata:
|
||||||
|
name: {{ template "seaweedfs.name" . }}-ca-issuer
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
spec:
|
||||||
|
ca:
|
||||||
|
secretName: {{ template "seaweedfs.name" . }}-ca-cert
|
||||||
|
{{- end }}
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
{{- if .Values.global.enableSecurity }}
|
{{- if .Values.global.enableSecurity }}
|
||||||
apiVersion: certmanager.k8s.io/v1alpha1
|
apiVersion: cert-manager.io/v1{{ if .Values.global.certificates.alphacrds }}alpha1{{ end }}
|
||||||
kind: ClusterIssuer
|
kind: ClusterIssuer
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "seaweedfs.name" . }}-clusterissuer
|
name: {{ template "seaweedfs.name" . }}-clusterissuer
|
||||||
+8
-6
@@ -1,5 +1,5 @@
|
|||||||
{{- if .Values.global.enableSecurity }}
|
{{- if .Values.global.enableSecurity }}
|
||||||
apiVersion: certmanager.k8s.io/v1alpha1
|
apiVersion: cert-manager.io/v1{{ if .Values.global.certificates.alphacrds }}alpha1{{ end }}
|
||||||
kind: Certificate
|
kind: Certificate
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "seaweedfs.name" . }}-client-cert
|
name: {{ template "seaweedfs.name" . }}-client-cert
|
||||||
@@ -7,10 +7,11 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
secretName: {{ template "seaweedfs.name" . }}-client-cert
|
secretName: {{ template "seaweedfs.name" . }}-client-cert
|
||||||
issuerRef:
|
issuerRef:
|
||||||
name: {{ template "seaweedfs.name" . }}-clusterissuer
|
name: {{ template "seaweedfs.name" . }}-ca-issuer
|
||||||
kind: ClusterIssuer
|
kind: Issuer
|
||||||
commonName: {{ .Values.certificates.commonName }}
|
commonName: {{ .Values.certificates.commonName }}
|
||||||
organization:
|
subject:
|
||||||
|
organizations:
|
||||||
- "SeaweedFS CA"
|
- "SeaweedFS CA"
|
||||||
dnsNames:
|
dnsNames:
|
||||||
- '*.{{ .Release.Namespace }}'
|
- '*.{{ .Release.Namespace }}'
|
||||||
@@ -26,8 +27,9 @@ spec:
|
|||||||
- {{ . }}
|
- {{ . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
keyAlgorithm: {{ .Values.certificates.keyAlgorithm }}
|
privateKey:
|
||||||
keySize: {{ .Values.certificates.keySize }}
|
algorithm: {{ .Values.certificates.keyAlgorithm }}
|
||||||
|
size: {{ .Values.certificates.keySize }}
|
||||||
duration: {{ .Values.certificates.duration }}
|
duration: {{ .Values.certificates.duration }}
|
||||||
renewBefore: {{ .Values.certificates.renewBefore }}
|
renewBefore: {{ .Values.certificates.renewBefore }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
+8
-6
@@ -1,5 +1,5 @@
|
|||||||
{{- if .Values.global.enableSecurity }}
|
{{- if .Values.global.enableSecurity }}
|
||||||
apiVersion: certmanager.k8s.io/v1alpha1
|
apiVersion: cert-manager.io/v1{{ if .Values.global.certificates.alphacrds }}alpha1{{ end }}
|
||||||
kind: Certificate
|
kind: Certificate
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "seaweedfs.name" . }}-filer-cert
|
name: {{ template "seaweedfs.name" . }}-filer-cert
|
||||||
@@ -7,10 +7,11 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
secretName: {{ template "seaweedfs.name" . }}-filer-cert
|
secretName: {{ template "seaweedfs.name" . }}-filer-cert
|
||||||
issuerRef:
|
issuerRef:
|
||||||
name: {{ template "seaweedfs.name" . }}-clusterissuer
|
name: {{ template "seaweedfs.name" . }}-ca-issuer
|
||||||
kind: ClusterIssuer
|
kind: Issuer
|
||||||
commonName: {{ .Values.certificates.commonName }}
|
commonName: {{ .Values.certificates.commonName }}
|
||||||
organization:
|
subject:
|
||||||
|
organizations:
|
||||||
- "SeaweedFS CA"
|
- "SeaweedFS CA"
|
||||||
dnsNames:
|
dnsNames:
|
||||||
- '*.{{ .Release.Namespace }}'
|
- '*.{{ .Release.Namespace }}'
|
||||||
@@ -26,8 +27,9 @@ spec:
|
|||||||
- {{ . }}
|
- {{ . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
keyAlgorithm: {{ .Values.certificates.keyAlgorithm }}
|
privateKey:
|
||||||
keySize: {{ .Values.certificates.keySize }}
|
algorithm: {{ .Values.certificates.keyAlgorithm }}
|
||||||
|
size: {{ .Values.certificates.keySize }}
|
||||||
duration: {{ .Values.certificates.duration }}
|
duration: {{ .Values.certificates.duration }}
|
||||||
renewBefore: {{ .Values.certificates.renewBefore }}
|
renewBefore: {{ .Values.certificates.renewBefore }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
File renamed without changes.
+12
@@ -20,6 +20,18 @@ spec:
|
|||||||
port: {{ .Values.filer.grpcPort }}
|
port: {{ .Values.filer.grpcPort }}
|
||||||
targetPort: {{ .Values.filer.grpcPort }}
|
targetPort: {{ .Values.filer.grpcPort }}
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
|
{{- if .Values.filer.s3.enabled }}
|
||||||
|
- name: "swfs-s3"
|
||||||
|
port: {{ .Values.filer.s3.port }}
|
||||||
|
targetPort: {{ .Values.filer.s3.port }}
|
||||||
|
protocol: TCP
|
||||||
|
{{- if .Values.filer.s3.httpsPort }}
|
||||||
|
- name: "swfs-s3-tls"
|
||||||
|
port: {{ .Values.filer.s3.httpsPort }}
|
||||||
|
targetPort: {{ .Values.filer.s3.httpsPort }}
|
||||||
|
protocol: TCP
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
{{- if .Values.filer.metricsPort }}
|
{{- if .Values.filer.metricsPort }}
|
||||||
- name: "metrics"
|
- name: "metrics"
|
||||||
port: {{ .Values.filer.metricsPort }}
|
port: {{ .Values.filer.metricsPort }}
|
||||||
File renamed without changes.
+27
-5
@@ -88,7 +88,12 @@ spec:
|
|||||||
{{- if .Values.filer.extraEnvironmentVars }}
|
{{- if .Values.filer.extraEnvironmentVars }}
|
||||||
{{- range $key, $value := .Values.filer.extraEnvironmentVars }}
|
{{- range $key, $value := .Values.filer.extraEnvironmentVars }}
|
||||||
- name: {{ $key }}
|
- name: {{ $key }}
|
||||||
|
{{- if kindIs "string" $value }}
|
||||||
value: {{ $value | quote }}
|
value: {{ $value | quote }}
|
||||||
|
{{- else }}
|
||||||
|
valueFrom:
|
||||||
|
{{ toYaml $value | nindent 16 | trim }}
|
||||||
|
{{- end -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.global.extraEnvironmentVars }}
|
{{- if .Values.global.extraEnvironmentVars }}
|
||||||
@@ -97,11 +102,22 @@ spec:
|
|||||||
value: {{ $value | quote }}
|
value: {{ $value | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if .Values.filer.secretExtraEnvironmentVars }}
|
||||||
|
{{- range $key, $value := .Values.filer.secretExtraEnvironmentVars }}
|
||||||
|
- name: {{ $key }}
|
||||||
|
valueFrom: {{ toYaml $value | nindent 16 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
command:
|
command:
|
||||||
- "/bin/sh"
|
- "/bin/sh"
|
||||||
- "-ec"
|
- "-ec"
|
||||||
- |
|
- |
|
||||||
exec /usr/bin/weed -logdir=/logs \
|
exec /usr/bin/weed \
|
||||||
|
{{- if eq .Values.filer.logs.type "hostPath" }}
|
||||||
|
-logdir=/logs \
|
||||||
|
{{- else }}
|
||||||
|
-logtostderr=true \
|
||||||
|
{{- end }}
|
||||||
{{- if .Values.filer.loggingOverrideLevel }}
|
{{- if .Values.filer.loggingOverrideLevel }}
|
||||||
-v={{ .Values.filer.loggingOverrideLevel }} \
|
-v={{ .Values.filer.loggingOverrideLevel }} \
|
||||||
{{- else }}
|
{{- else }}
|
||||||
@@ -137,6 +153,9 @@ spec:
|
|||||||
-encryptVolumeData \
|
-encryptVolumeData \
|
||||||
{{- end }}
|
{{- end }}
|
||||||
-ip=${POD_IP} \
|
-ip=${POD_IP} \
|
||||||
|
{{- if .Values.filer.filerGroup}}
|
||||||
|
-filerGroup={{ .Values.filer.filerGroup}} \
|
||||||
|
{{- end }}
|
||||||
{{- if .Values.filer.s3.enabled }}
|
{{- if .Values.filer.s3.enabled }}
|
||||||
-s3 \
|
-s3 \
|
||||||
-s3.port={{ .Values.filer.s3.port }} \
|
-s3.port={{ .Values.filer.s3.port }} \
|
||||||
@@ -144,6 +163,9 @@ spec:
|
|||||||
-s3.domainName={{ .Values.filer.s3.domainName }} \
|
-s3.domainName={{ .Values.filer.s3.domainName }} \
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.global.enableSecurity }}
|
{{- if .Values.global.enableSecurity }}
|
||||||
|
{{- if .Values.filer.s3.httpsPort }}
|
||||||
|
-s3.port.https={{ .Values.filer.s3.httpsPort }} \
|
||||||
|
{{- end }}
|
||||||
-s3.cert.file=/usr/local/share/ca-certificates/client/tls.crt \
|
-s3.cert.file=/usr/local/share/ca-certificates/client/tls.crt \
|
||||||
-s3.key.file=/usr/local/share/ca-certificates/client/tls.key \
|
-s3.key.file=/usr/local/share/ca-certificates/client/tls.key \
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -157,14 +179,14 @@ spec:
|
|||||||
-s3.auditLogConfig=/etc/sw/filer_s3_auditLogConfig.json \
|
-s3.auditLogConfig=/etc/sw/filer_s3_auditLogConfig.json \
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
-master={{ range $index := until (.Values.master.replicas | int) }}${SEAWEEDFS_FULLNAME}-master-{{ $index }}.${SEAWEEDFS_FULLNAME}-master:{{ $.Values.master.port }}{{ if lt $index (sub ($.Values.master.replicas | int) 1) }},{{ end }}{{ end }}
|
-master={{ range $index := until (.Values.master.replicas | int) }}${SEAWEEDFS_FULLNAME}-master-{{ $index }}.${SEAWEEDFS_FULLNAME}-master.{{ $.Release.Namespace }}:{{ $.Values.master.port }}{{ if lt $index (sub ($.Values.master.replicas | int) 1) }},{{ end }}{{ end }}
|
||||||
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 }}
|
{{- if (or .Values.filer.enablePVC (or (eq .Values.filer.data.type "hostPath") (eq .Values.filer.data.type "persistentVolumeClaim"))) }}
|
||||||
- name: data-filer
|
- name: data-filer
|
||||||
mountPath: /data
|
mountPath: /data
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -225,13 +247,13 @@ spec:
|
|||||||
{{- if eq .Values.filer.logs.type "hostPath" }}
|
{{- if eq .Values.filer.logs.type "hostPath" }}
|
||||||
- name: seaweedfs-filer-log-volume
|
- name: seaweedfs-filer-log-volume
|
||||||
hostPath:
|
hostPath:
|
||||||
path: /storage/logs/seaweedfs/filer
|
path: {{ .Values.filer.logs.hostPathPrefix }}/logs/seaweedfs/filer
|
||||||
type: DirectoryOrCreate
|
type: DirectoryOrCreate
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if eq .Values.filer.data.type "hostPath" }}
|
{{- if eq .Values.filer.data.type "hostPath" }}
|
||||||
- name: data-filer
|
- name: data-filer
|
||||||
hostPath:
|
hostPath:
|
||||||
path: /storage/filer_store
|
path: {{ .Values.filer.data.hostPathPrefix }}/filer_store
|
||||||
type: DirectoryOrCreate
|
type: DirectoryOrCreate
|
||||||
{{- end }}
|
{{- end }}
|
||||||
- name: db-schema-config-volume
|
- name: db-schema-config-volume
|
||||||
+4
-1
@@ -14,8 +14,11 @@ metadata:
|
|||||||
{{ omit .Values.filer.ingress.annotations "kubernetes.io/ingress.class" | toYaml | nindent 4 }}
|
{{ omit .Values.filer.ingress.annotations "kubernetes.io/ingress.class" | toYaml | nindent 4 }}
|
||||||
spec:
|
spec:
|
||||||
ingressClassName: {{ .Values.filer.ingress.className | quote }}
|
ingressClassName: {{ .Values.filer.ingress.className | quote }}
|
||||||
|
tls:
|
||||||
|
{{ .Values.filer.ingress.tls | default list | toYaml | nindent 6}}
|
||||||
rules:
|
rules:
|
||||||
- http:
|
- host: {{ .Values.filer.ingress.host }}
|
||||||
|
http:
|
||||||
paths:
|
paths:
|
||||||
- path: /sw-filer/?(.*)
|
- path: /sw-filer/?(.*)
|
||||||
pathType: ImplementationSpecific
|
pathType: ImplementationSpecific
|
||||||
+8
-6
@@ -1,5 +1,5 @@
|
|||||||
{{- if .Values.global.enableSecurity }}
|
{{- if .Values.global.enableSecurity }}
|
||||||
apiVersion: certmanager.k8s.io/v1alpha1
|
apiVersion: cert-manager.io/v1{{ if .Values.global.certificates.alphacrds }}alpha1{{ end }}
|
||||||
kind: Certificate
|
kind: Certificate
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "seaweedfs.name" . }}-master-cert
|
name: {{ template "seaweedfs.name" . }}-master-cert
|
||||||
@@ -7,10 +7,11 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
secretName: {{ template "seaweedfs.name" . }}-master-cert
|
secretName: {{ template "seaweedfs.name" . }}-master-cert
|
||||||
issuerRef:
|
issuerRef:
|
||||||
name: {{ template "seaweedfs.name" . }}-clusterissuer
|
name: {{ template "seaweedfs.name" . }}-ca-issuer
|
||||||
kind: ClusterIssuer
|
kind: Issuer
|
||||||
commonName: {{ .Values.certificates.commonName }}
|
commonName: {{ .Values.certificates.commonName }}
|
||||||
organization:
|
subject:
|
||||||
|
organizations:
|
||||||
- "SeaweedFS CA"
|
- "SeaweedFS CA"
|
||||||
dnsNames:
|
dnsNames:
|
||||||
- '*.{{ .Release.Namespace }}'
|
- '*.{{ .Release.Namespace }}'
|
||||||
@@ -26,8 +27,9 @@ spec:
|
|||||||
- {{ . }}
|
- {{ . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
keyAlgorithm: {{ .Values.certificates.keyAlgorithm }}
|
privateKey:
|
||||||
keySize: {{ .Values.certificates.keySize }}
|
algorithm: {{ .Values.certificates.keyAlgorithm }}
|
||||||
|
size: {{ .Values.certificates.keySize }}
|
||||||
duration: {{ .Values.certificates.duration }}
|
duration: {{ .Values.certificates.duration }}
|
||||||
renewBefore: {{ .Values.certificates.renewBefore }}
|
renewBefore: {{ .Values.certificates.renewBefore }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
File renamed without changes.
File renamed without changes.
+10
-5
@@ -90,7 +90,12 @@ spec:
|
|||||||
- "/bin/sh"
|
- "/bin/sh"
|
||||||
- "-ec"
|
- "-ec"
|
||||||
- |
|
- |
|
||||||
exec /usr/bin/weed -logdir=/logs \
|
exec /usr/bin/weed \
|
||||||
|
{{- if eq .Values.master.logs.type "hostPath" }}
|
||||||
|
-logdir=/logs \
|
||||||
|
{{- else }}
|
||||||
|
-logtostderr=true \
|
||||||
|
{{- end }}
|
||||||
{{- if .Values.master.loggingOverrideLevel }}
|
{{- if .Values.master.loggingOverrideLevel }}
|
||||||
-v={{ .Values.master.loggingOverrideLevel }} \
|
-v={{ .Values.master.loggingOverrideLevel }} \
|
||||||
{{- else }}
|
{{- else }}
|
||||||
@@ -128,8 +133,8 @@ spec:
|
|||||||
{{- if .Values.master.garbageThreshold }}
|
{{- if .Values.master.garbageThreshold }}
|
||||||
-garbageThreshold={{ .Values.master.garbageThreshold }} \
|
-garbageThreshold={{ .Values.master.garbageThreshold }} \
|
||||||
{{- end }}
|
{{- end }}
|
||||||
-ip=${POD_NAME}.${SEAWEEDFS_FULLNAME}-master \
|
-ip=${POD_NAME}.${SEAWEEDFS_FULLNAME}-master.{{ .Release.Namespace }} \
|
||||||
-peers={{ 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 }}
|
-peers={{ range $index := until (.Values.master.replicas | int) }}${SEAWEEDFS_FULLNAME}-master-{{ $index }}.${SEAWEEDFS_FULLNAME}-master.{{ $.Release.Namespace }}:{{ $.Values.master.port }}{{ if lt $index (sub ($.Values.master.replicas | int) 1) }},{{ end }}{{ end }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name : data-{{ .Release.Namespace }}
|
- name : data-{{ .Release.Namespace }}
|
||||||
mountPath: /data
|
mountPath: /data
|
||||||
@@ -196,13 +201,13 @@ spec:
|
|||||||
{{- if eq .Values.master.logs.type "hostPath" }}
|
{{- if eq .Values.master.logs.type "hostPath" }}
|
||||||
- name: seaweedfs-master-log-volume
|
- name: seaweedfs-master-log-volume
|
||||||
hostPath:
|
hostPath:
|
||||||
path: /storage/logs/seaweedfs/master
|
path: {{ .Values.master.logs.hostPathPrefix }}/logs/seaweedfs/master
|
||||||
type: DirectoryOrCreate
|
type: DirectoryOrCreate
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if eq .Values.master.data.type "hostPath" }}
|
{{- if eq .Values.master.data.type "hostPath" }}
|
||||||
- name: data-{{ .Release.Namespace }}
|
- name: data-{{ .Release.Namespace }}
|
||||||
hostPath:
|
hostPath:
|
||||||
path: /ssd/seaweed-master/
|
path: {{ .Values.master.data.hostPathPrefix }}/seaweed-master/
|
||||||
type: DirectoryOrCreate
|
type: DirectoryOrCreate
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.global.enableSecurity }}
|
{{- if .Values.global.enableSecurity }}
|
||||||
+12
-3
@@ -72,18 +72,27 @@ spec:
|
|||||||
- "/bin/sh"
|
- "/bin/sh"
|
||||||
- "-ec"
|
- "-ec"
|
||||||
- |
|
- |
|
||||||
exec /usr/bin/weed -logdir=/logs \
|
exec /usr/bin/weed \
|
||||||
|
{{- if eq .Values.s3.logs.type "hostPath" }}
|
||||||
|
-logdir=/logs \
|
||||||
|
{{- else }}
|
||||||
|
-logtostderr=true \
|
||||||
|
{{- end }}
|
||||||
{{- if .Values.s3.loggingOverrideLevel }}
|
{{- if .Values.s3.loggingOverrideLevel }}
|
||||||
-v={{ .Values.s3.loggingOverrideLevel }} \
|
-v={{ .Values.s3.loggingOverrideLevel }} \
|
||||||
{{- else }}
|
{{- else }}
|
||||||
-v={{ .Values.global.loggingLevel }} \
|
-v={{ .Values.global.loggingLevel }} \
|
||||||
{{- end }}
|
{{- end }}
|
||||||
s3 \
|
s3 \
|
||||||
|
-ip.bind={{ .Values.s3.bindAddress }} \
|
||||||
-port={{ .Values.s3.port }} \
|
-port={{ .Values.s3.port }} \
|
||||||
{{- if .Values.s3.metricsPort }}
|
{{- if .Values.s3.metricsPort }}
|
||||||
-metricsPort {{ .Values.s3.metricsPort }} \
|
-metricsPort {{ .Values.s3.metricsPort }} \
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.global.enableSecurity }}
|
{{- if .Values.global.enableSecurity }}
|
||||||
|
{{- if .Values.s3.httpsPort }}
|
||||||
|
-port.https={{ .Values.s3.httpsPort }} \
|
||||||
|
{{- end }}
|
||||||
-cert.file=/usr/local/share/ca-certificates/client/tls.crt \
|
-cert.file=/usr/local/share/ca-certificates/client/tls.crt \
|
||||||
-key.file=/usr/local/share/ca-certificates/client/tls.key \
|
-key.file=/usr/local/share/ca-certificates/client/tls.key \
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -99,7 +108,7 @@ spec:
|
|||||||
{{- if .Values.s3.auditLogConfig }}
|
{{- if .Values.s3.auditLogConfig }}
|
||||||
-auditLogConfig=/etc/sw/s3_auditLogConfig.json \
|
-auditLogConfig=/etc/sw/s3_auditLogConfig.json \
|
||||||
{{- end }}
|
{{- end }}
|
||||||
-filer={{ template "seaweedfs.name" . }}-filer-client:{{ .Values.filer.port }}
|
-filer={{ template "seaweedfs.name" . }}-filer-client.{{ .Release.Namespace }}:{{ .Values.filer.port }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: logs
|
- name: logs
|
||||||
mountPath: "/logs/"
|
mountPath: "/logs/"
|
||||||
@@ -167,7 +176,7 @@ spec:
|
|||||||
{{- if eq .Values.s3.logs.type "hostPath" }}
|
{{- if eq .Values.s3.logs.type "hostPath" }}
|
||||||
- name: logs
|
- name: logs
|
||||||
hostPath:
|
hostPath:
|
||||||
path: /storage/logs/seaweedfs/s3
|
path: {{ .Values.s3.logs.hostPathPrefix }}/logs/seaweedfs/s3
|
||||||
type: DirectoryOrCreate
|
type: DirectoryOrCreate
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.global.enableSecurity }}
|
{{- if .Values.global.enableSecurity }}
|
||||||
+6
@@ -12,6 +12,12 @@ spec:
|
|||||||
port: {{ if .Values.s3.enabled }}{{ .Values.s3.port }}{{ else }}{{ .Values.filer.s3.port }}{{ end }}
|
port: {{ if .Values.s3.enabled }}{{ .Values.s3.port }}{{ else }}{{ .Values.filer.s3.port }}{{ end }}
|
||||||
targetPort: {{ if .Values.s3.enabled }}{{ .Values.s3.port }}{{ else }}{{ .Values.filer.s3.port }}{{ end }}
|
targetPort: {{ if .Values.s3.enabled }}{{ .Values.s3.port }}{{ else }}{{ .Values.filer.s3.port }}{{ end }}
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
|
{{- if and .Values.s3.enabled .Values.s3.httpsPort }}
|
||||||
|
- name: "swfs-s3-tls"
|
||||||
|
port: {{ .Values.s3.httpsPort }}
|
||||||
|
targetPort: {{ .Values.s3.httpsPort }}
|
||||||
|
protocol: TCP
|
||||||
|
{{- end }}
|
||||||
{{- if and .Values.s3.enabled .Values.s3.metricsPort }}
|
{{- if and .Values.s3.enabled .Values.s3.metricsPort }}
|
||||||
- name: "metrics"
|
- name: "metrics"
|
||||||
port: {{ .Values.s3.metricsPort }}
|
port: {{ .Values.s3.metricsPort }}
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+8
-6
@@ -1,5 +1,5 @@
|
|||||||
{{- if .Values.global.enableSecurity }}
|
{{- if .Values.global.enableSecurity }}
|
||||||
apiVersion: certmanager.k8s.io/v1alpha1
|
apiVersion: cert-manager.io/v1{{ if .Values.global.certificates.alphacrds }}alpha1{{ end }}
|
||||||
kind: Certificate
|
kind: Certificate
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "seaweedfs.name" . }}-volume-cert
|
name: {{ template "seaweedfs.name" . }}-volume-cert
|
||||||
@@ -7,10 +7,11 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
secretName: {{ template "seaweedfs.name" . }}-volume-cert
|
secretName: {{ template "seaweedfs.name" . }}-volume-cert
|
||||||
issuerRef:
|
issuerRef:
|
||||||
name: {{ template "seaweedfs.name" . }}-clusterissuer
|
name: {{ template "seaweedfs.name" . }}-ca-issuer
|
||||||
kind: ClusterIssuer
|
kind: Issuer
|
||||||
commonName: {{ .Values.certificates.commonName }}
|
commonName: {{ .Values.certificates.commonName }}
|
||||||
organization:
|
subject:
|
||||||
|
organizations:
|
||||||
- "SeaweedFS CA"
|
- "SeaweedFS CA"
|
||||||
dnsNames:
|
dnsNames:
|
||||||
- '*.{{ .Release.Namespace }}'
|
- '*.{{ .Release.Namespace }}'
|
||||||
@@ -26,8 +27,9 @@ spec:
|
|||||||
- {{ . }}
|
- {{ . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
keyAlgorithm: {{ .Values.certificates.keyAlgorithm }}
|
privateKey:
|
||||||
keySize: {{ .Values.certificates.keySize }}
|
algorithm: {{ .Values.certificates.keyAlgorithm }}
|
||||||
|
size: {{ .Values.certificates.keySize }}
|
||||||
duration: {{ .Values.certificates.duration }}
|
duration: {{ .Values.certificates.duration }}
|
||||||
renewBefore: {{ .Values.certificates.renewBefore }}
|
renewBefore: {{ .Values.certificates.renewBefore }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
File renamed without changes.
File renamed without changes.
+12
-7
@@ -93,7 +93,12 @@ spec:
|
|||||||
- "/bin/sh"
|
- "/bin/sh"
|
||||||
- "-ec"
|
- "-ec"
|
||||||
- |
|
- |
|
||||||
exec /usr/bin/weed -logdir=/logs \
|
exec /usr/bin/weed \
|
||||||
|
{{- if eq .Values.volume.logs.type "hostPath" }}
|
||||||
|
-logdir=/logs \
|
||||||
|
{{- else }}
|
||||||
|
-logtostderr=true \
|
||||||
|
{{- end }}
|
||||||
{{- if .Values.volume.loggingOverrideLevel }}
|
{{- if .Values.volume.loggingOverrideLevel }}
|
||||||
-v={{ .Values.volume.loggingOverrideLevel }} \
|
-v={{ .Values.volume.loggingOverrideLevel }} \
|
||||||
{{- else }}
|
{{- else }}
|
||||||
@@ -133,9 +138,9 @@ spec:
|
|||||||
-fileSizeLimitMB={{ .Values.volume.fileSizeLimitMB }} \
|
-fileSizeLimitMB={{ .Values.volume.fileSizeLimitMB }} \
|
||||||
{{- end }}
|
{{- end }}
|
||||||
-minFreeSpacePercent={{ .Values.volume.minFreeSpacePercent }} \
|
-minFreeSpacePercent={{ .Values.volume.minFreeSpacePercent }} \
|
||||||
-ip=${POD_NAME}.${SEAWEEDFS_FULLNAME}-volume \
|
-ip=${POD_NAME}.${SEAWEEDFS_FULLNAME}-volume.{{ .Release.Namespace }} \
|
||||||
-compactionMBps={{ .Values.volume.compactionMBps }} \
|
-compactionMBps={{ .Values.volume.compactionMBps }} \
|
||||||
-mserver={{ 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 }}
|
-mserver={{ range $index := until (.Values.master.replicas | int) }}${SEAWEEDFS_FULLNAME}-master-{{ $index }}.${SEAWEEDFS_FULLNAME}-master.{{ $.Release.Namespace }}:{{ $.Values.master.port }}{{ if lt $index (sub ($.Values.master.replicas | int) 1) }},{{ end }}{{ end }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: data
|
- name: data
|
||||||
mountPath: "{{ .Values.volume.dir }}/"
|
mountPath: "{{ .Values.volume.dir }}/"
|
||||||
@@ -182,7 +187,7 @@ spec:
|
|||||||
port: {{ .Values.volume.port }}
|
port: {{ .Values.volume.port }}
|
||||||
scheme: HTTP
|
scheme: HTTP
|
||||||
initialDelaySeconds: 15
|
initialDelaySeconds: 15
|
||||||
periodSeconds: 90
|
periodSeconds: 15
|
||||||
successThreshold: 1
|
successThreshold: 1
|
||||||
failureThreshold: 100
|
failureThreshold: 100
|
||||||
timeoutSeconds: 30
|
timeoutSeconds: 30
|
||||||
@@ -206,19 +211,19 @@ spec:
|
|||||||
{{- if eq .Values.volume.data.type "hostPath" }}
|
{{- if eq .Values.volume.data.type "hostPath" }}
|
||||||
- name: data
|
- name: data
|
||||||
hostPath:
|
hostPath:
|
||||||
path: /storage/object_store/
|
path: {{ .Values.volume.data.hostPathPrefix }}/object_store/
|
||||||
type: DirectoryOrCreate
|
type: DirectoryOrCreate
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if and (eq .Values.volume.idx.type "hostPath") .Values.volume.dir_idx }}
|
{{- if and (eq .Values.volume.idx.type "hostPath") .Values.volume.dir_idx }}
|
||||||
- name: idx
|
- name: idx
|
||||||
hostPath:
|
hostPath:
|
||||||
path: /ssd/seaweedfs-volume-idx/
|
path: {{ .Values.volume.idx.hostPathPrefix }}/seaweedfs-volume-idx/
|
||||||
type: DirectoryOrCreate
|
type: DirectoryOrCreate
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if eq .Values.volume.logs.type "hostPath" }}
|
{{- if eq .Values.volume.logs.type "hostPath" }}
|
||||||
- name: logs
|
- name: logs
|
||||||
hostPath:
|
hostPath:
|
||||||
path: /storage/logs/seaweedfs/volume
|
path: {{ .Values.volume.logs.hostPathPrefix }}/logs/seaweedfs/volume
|
||||||
type: DirectoryOrCreate
|
type: DirectoryOrCreate
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.global.enableSecurity }}
|
{{- if .Values.global.enableSecurity }}
|
||||||
@@ -5,10 +5,12 @@ global:
|
|||||||
repository: ""
|
repository: ""
|
||||||
imageName: chrislusf/seaweedfs
|
imageName: chrislusf/seaweedfs
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
imagePullSecrets: imagepullsecret
|
imagePullSecrets: ""
|
||||||
restartPolicy: Always
|
restartPolicy: Always
|
||||||
loggingLevel: 1
|
loggingLevel: 1
|
||||||
enableSecurity: false
|
enableSecurity: false
|
||||||
|
certificates:
|
||||||
|
alphacrds: false
|
||||||
monitoring:
|
monitoring:
|
||||||
enabled: false
|
enabled: false
|
||||||
gatewayHost: null
|
gatewayHost: null
|
||||||
@@ -22,8 +24,8 @@ global:
|
|||||||
replicationPlacment: "001"
|
replicationPlacment: "001"
|
||||||
extraEnvironmentVars:
|
extraEnvironmentVars:
|
||||||
WEED_CLUSTER_DEFAULT: "sw"
|
WEED_CLUSTER_DEFAULT: "sw"
|
||||||
WEED_CLUSTER_SW_MASTER: "seaweedfs-master:9333"
|
WEED_CLUSTER_SW_MASTER: "seaweedfs-master.seaweedfs:9333"
|
||||||
WEED_CLUSTER_SW_FILER: "seaweedfs-filer-client:8888"
|
WEED_CLUSTER_SW_FILER: "seaweedfs-filer-client.seaweedfs:8888"
|
||||||
|
|
||||||
image:
|
image:
|
||||||
registry: ""
|
registry: ""
|
||||||
@@ -44,11 +46,11 @@ master:
|
|||||||
volumePreallocate: false
|
volumePreallocate: false
|
||||||
volumeSizeLimitMB: 1000
|
volumeSizeLimitMB: 1000
|
||||||
loggingOverrideLevel: null
|
loggingOverrideLevel: null
|
||||||
#number of seconds between heartbeats, default 5
|
# number of seconds between heartbeats, default 5
|
||||||
pulseSeconds: null
|
pulseSeconds: null
|
||||||
#threshold to vacuum and reclaim spaces, default 0.3 (30%)
|
# threshold to vacuum and reclaim spaces, default 0.3 (30%)
|
||||||
garbageThreshold: null
|
garbageThreshold: null
|
||||||
#Prometheus push interval in seconds, default 15
|
# Prometheus push interval in seconds, default 15
|
||||||
metricsIntervalSec: 15
|
metricsIntervalSec: 15
|
||||||
# replication type is XYZ:
|
# replication type is XYZ:
|
||||||
# X number of replica in other data centers
|
# X number of replica in other data centers
|
||||||
@@ -68,11 +70,13 @@ master:
|
|||||||
type: "hostPath"
|
type: "hostPath"
|
||||||
size: ""
|
size: ""
|
||||||
storageClass: ""
|
storageClass: ""
|
||||||
|
hostPathPrefix: /ssd
|
||||||
|
|
||||||
logs:
|
logs:
|
||||||
type: "hostPath"
|
type: "hostPath"
|
||||||
size: ""
|
size: ""
|
||||||
storageClass: ""
|
storageClass: ""
|
||||||
|
hostPathPrefix: /storage
|
||||||
|
|
||||||
initContainers: ""
|
initContainers: ""
|
||||||
|
|
||||||
@@ -110,10 +114,10 @@ master:
|
|||||||
# nodeSelector labels for master pod assignment, formatted as a muli-line string.
|
# nodeSelector labels for master pod assignment, formatted as a muli-line string.
|
||||||
# ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
|
# ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
|
||||||
# Example:
|
# Example:
|
||||||
# nodeSelector: |
|
|
||||||
# beta.kubernetes.io/arch: amd64
|
|
||||||
nodeSelector: |
|
nodeSelector: |
|
||||||
sw-backend: "true"
|
beta.kubernetes.io/arch: amd64
|
||||||
|
# nodeSelector: |
|
||||||
|
# sw-backend: "true"
|
||||||
|
|
||||||
# used to assign priority to master pods
|
# used to assign priority to master pods
|
||||||
# ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
# ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
||||||
@@ -122,6 +126,7 @@ master:
|
|||||||
ingress:
|
ingress:
|
||||||
enabled: false
|
enabled: false
|
||||||
className: "nginx"
|
className: "nginx"
|
||||||
|
host: "master.seaweedfs.local"
|
||||||
annotations:
|
annotations:
|
||||||
nginx.ingress.kubernetes.io/auth-type: "basic"
|
nginx.ingress.kubernetes.io/auth-type: "basic"
|
||||||
nginx.ingress.kubernetes.io/auth-secret: "default/ingress-basic-auth-secret"
|
nginx.ingress.kubernetes.io/auth-secret: "default/ingress-basic-auth-secret"
|
||||||
@@ -176,15 +181,19 @@ volume:
|
|||||||
type: "hostPath"
|
type: "hostPath"
|
||||||
size: ""
|
size: ""
|
||||||
storageClass: ""
|
storageClass: ""
|
||||||
|
hostPathPrefix: /storage
|
||||||
|
|
||||||
idx:
|
idx:
|
||||||
type: "hostPath"
|
type: "hostPath"
|
||||||
size: ""
|
size: ""
|
||||||
storageClass: ""
|
storageClass: ""
|
||||||
|
hostPathPrefix: /ssd
|
||||||
|
|
||||||
logs:
|
logs:
|
||||||
type: "hostPath"
|
type: "hostPath"
|
||||||
size: ""
|
size: ""
|
||||||
storageClass: ""
|
storageClass: ""
|
||||||
|
hostPathPrefix: /storage
|
||||||
|
|
||||||
# limit background compaction or copying speed in mega bytes per second
|
# limit background compaction or copying speed in mega bytes per second
|
||||||
compactionMBps: "50"
|
compactionMBps: "50"
|
||||||
@@ -235,7 +244,7 @@ volume:
|
|||||||
# should map directly to the value of the resources field for a PodSpec,
|
# should map directly to the value of the resources field for a PodSpec,
|
||||||
# formatted as a multi-line string. By default no direct resource request
|
# formatted as a multi-line string. By default no direct resource request
|
||||||
# is made.
|
# is made.
|
||||||
resources: null
|
resources: {}
|
||||||
|
|
||||||
# Toleration Settings for server pods
|
# Toleration Settings for server pods
|
||||||
# This should be a multi-line string matching the Toleration array
|
# This should be a multi-line string matching the Toleration array
|
||||||
@@ -245,10 +254,10 @@ volume:
|
|||||||
# nodeSelector labels for server pod assignment, formatted as a muli-line string.
|
# nodeSelector labels for server pod assignment, formatted as a muli-line string.
|
||||||
# ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
|
# ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
|
||||||
# Example:
|
# Example:
|
||||||
# nodeSelector: |
|
|
||||||
# beta.kubernetes.io/arch: amd64
|
|
||||||
nodeSelector: |
|
nodeSelector: |
|
||||||
sw-volume: "true"
|
beta.kubernetes.io/arch: amd64
|
||||||
|
# nodeSelector: |
|
||||||
|
# sw-volume: "true"
|
||||||
|
|
||||||
# used to assign priority to server pods
|
# used to assign priority to server pods
|
||||||
# ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
# ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
||||||
@@ -267,6 +276,7 @@ filer:
|
|||||||
grpcPort: 18888
|
grpcPort: 18888
|
||||||
metricsPort: 9327
|
metricsPort: 9327
|
||||||
loggingOverrideLevel: null
|
loggingOverrideLevel: null
|
||||||
|
filerGroup: ""
|
||||||
# replication type is XYZ:
|
# replication type is XYZ:
|
||||||
# X number of replica in other data centers
|
# X number of replica in other data centers
|
||||||
# Y number of replica in other racks in the same data center
|
# Y number of replica in other racks in the same data center
|
||||||
@@ -308,11 +318,13 @@ filer:
|
|||||||
type: "hostPath"
|
type: "hostPath"
|
||||||
size: ""
|
size: ""
|
||||||
storageClass: ""
|
storageClass: ""
|
||||||
|
hostPathPrefix: /storage
|
||||||
|
|
||||||
logs:
|
logs:
|
||||||
type: "hostPath"
|
type: "hostPath"
|
||||||
size: ""
|
size: ""
|
||||||
storageClass: ""
|
storageClass: ""
|
||||||
|
hostPathPrefix: /storage
|
||||||
|
|
||||||
initContainers: ""
|
initContainers: ""
|
||||||
|
|
||||||
@@ -350,10 +362,10 @@ filer:
|
|||||||
# nodeSelector labels for server pod assignment, formatted as a muli-line string.
|
# nodeSelector labels for server pod assignment, formatted as a muli-line string.
|
||||||
# ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
|
# ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
|
||||||
# Example:
|
# Example:
|
||||||
# nodeSelector: |
|
|
||||||
# beta.kubernetes.io/arch: amd64
|
|
||||||
nodeSelector: |
|
nodeSelector: |
|
||||||
sw-backend: "true"
|
beta.kubernetes.io/arch: amd64
|
||||||
|
# nodeSelector: |
|
||||||
|
# sw-backend: "true"
|
||||||
|
|
||||||
# used to assign priority to server pods
|
# used to assign priority to server pods
|
||||||
# ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
# ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
||||||
@@ -362,7 +374,9 @@ filer:
|
|||||||
ingress:
|
ingress:
|
||||||
enabled: false
|
enabled: false
|
||||||
className: "nginx"
|
className: "nginx"
|
||||||
|
host: "seaweedfs.cluster.local"
|
||||||
annotations:
|
annotations:
|
||||||
|
nginx.ingress.kubernetes.io/backend-protocol: GRPC
|
||||||
nginx.ingress.kubernetes.io/auth-type: "basic"
|
nginx.ingress.kubernetes.io/auth-type: "basic"
|
||||||
nginx.ingress.kubernetes.io/auth-secret: "default/ingress-basic-auth-secret"
|
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/auth-realm: 'Authentication Required - SW-Filer'
|
||||||
@@ -381,7 +395,7 @@ filer:
|
|||||||
|
|
||||||
# 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: "false"
|
||||||
WEED_MYSQL_HOSTNAME: "mysql-db-host"
|
WEED_MYSQL_HOSTNAME: "mysql-db-host"
|
||||||
WEED_MYSQL_PORT: "3306"
|
WEED_MYSQL_PORT: "3306"
|
||||||
WEED_MYSQL_DATABASE: "sw_database"
|
WEED_MYSQL_DATABASE: "sw_database"
|
||||||
@@ -392,17 +406,31 @@ filer:
|
|||||||
# 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.
|
# if you want to use leveldb2, then should enable "enablePVC". or you may lose your data.
|
||||||
WEED_LEVELDB2_ENABLED: "false"
|
WEED_LEVELDB2_ENABLED: "true"
|
||||||
# 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"
|
||||||
WEED_FILER_OPTIONS_RECURSIVE_DELETE: "false"
|
WEED_FILER_OPTIONS_RECURSIVE_DELETE: "false"
|
||||||
# directories under this folder will be automatically creating a separate bucket
|
# directories under this folder will be automatically creating a separate bucket
|
||||||
WEED_FILER_BUCKETS_FOLDER: "/buckets"
|
WEED_FILER_BUCKETS_FOLDER: "/buckets"
|
||||||
|
|
||||||
|
|
||||||
|
# secret env variables
|
||||||
|
secretExtraEnvironmentVars: []
|
||||||
|
# WEED_POSTGRES_USERNAME:
|
||||||
|
# secretKeyRef:
|
||||||
|
# name: postgres-credentials
|
||||||
|
# key: username
|
||||||
|
# WEED_POSTGRES_PASSWORD:
|
||||||
|
# secretKeyRef:
|
||||||
|
# name: postgres-credentials
|
||||||
|
# key: password
|
||||||
|
|
||||||
s3:
|
s3:
|
||||||
enabled: true
|
enabled: true
|
||||||
port: 8333
|
port: 8333
|
||||||
#allow empty folders
|
# add additional https port
|
||||||
|
httpsPort: 0
|
||||||
|
# allow empty folders
|
||||||
allowEmptyFolder: false
|
allowEmptyFolder: false
|
||||||
# Suffix of the host name, {bucket}.{domainName}
|
# Suffix of the host name, {bucket}.{domainName}
|
||||||
domainName: ""
|
domainName: ""
|
||||||
@@ -418,10 +446,13 @@ s3:
|
|||||||
imageTag: null
|
imageTag: null
|
||||||
restartPolicy: null
|
restartPolicy: null
|
||||||
replicas: 1
|
replicas: 1
|
||||||
|
bindAddress: 0.0.0.0
|
||||||
port: 8333
|
port: 8333
|
||||||
|
# add additional https port
|
||||||
|
httpsPort: 0
|
||||||
metricsPort: 9327
|
metricsPort: 9327
|
||||||
loggingOverrideLevel: null
|
loggingOverrideLevel: null
|
||||||
#allow empty folders
|
# allow empty folders
|
||||||
allowEmptyFolder: true
|
allowEmptyFolder: true
|
||||||
# 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
|
||||||
@@ -440,7 +471,7 @@ s3:
|
|||||||
# should map directly to the value of the resources field for a PodSpec,
|
# should map directly to the value of the resources field for a PodSpec,
|
||||||
# formatted as a multi-line string. By default no direct resource request
|
# formatted as a multi-line string. By default no direct resource request
|
||||||
# is made.
|
# is made.
|
||||||
resources: null
|
resources: {}
|
||||||
|
|
||||||
# Toleration Settings for server pods
|
# Toleration Settings for server pods
|
||||||
# This should be a multi-line string matching the Toleration array
|
# This should be a multi-line string matching the Toleration array
|
||||||
@@ -450,10 +481,10 @@ s3:
|
|||||||
# nodeSelector labels for server pod assignment, formatted as a muli-line string.
|
# nodeSelector labels for server pod assignment, formatted as a muli-line string.
|
||||||
# ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
|
# ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
|
||||||
# Example:
|
# Example:
|
||||||
# nodeSelector: |
|
|
||||||
# beta.kubernetes.io/arch: amd64
|
|
||||||
nodeSelector: |
|
nodeSelector: |
|
||||||
sw-backend: "true"
|
beta.kubernetes.io/arch: amd64
|
||||||
|
# nodeSelector: |
|
||||||
|
# sw-backend: "true"
|
||||||
|
|
||||||
# used to assign priority to server pods
|
# used to assign priority to server pods
|
||||||
# ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
# ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
||||||
@@ -463,12 +494,12 @@ s3:
|
|||||||
type: "hostPath"
|
type: "hostPath"
|
||||||
size: ""
|
size: ""
|
||||||
storageClass: ""
|
storageClass: ""
|
||||||
|
hostPathPrefix: /storage
|
||||||
|
|
||||||
certificates:
|
certificates:
|
||||||
commonName: "SeaweedFS CA"
|
commonName: "SeaweedFS CA"
|
||||||
ipAddresses: []
|
ipAddresses: []
|
||||||
keyAlgorithm: rsa
|
keyAlgorithm: rsa
|
||||||
keySize: 2048
|
keySize: 2048
|
||||||
duration: 2160h # 90d
|
duration: 2160h # 90d
|
||||||
renewBefore: 360h # 15d
|
renewBefore: 360h # 15d
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
# SEAWEEDFS - helm chart (2.x)
|
|
||||||
|
|
||||||
## Info:
|
|
||||||
* master/filer/volume are stateful sets with anti-affinity on the hostname,
|
|
||||||
so your deployment will be spread/HA.
|
|
||||||
* chart is using memsql(mysql) as the filer backend to enable HA (multiple filer instances)
|
|
||||||
and backup/HA memsql can provide.
|
|
||||||
* mysql user/password are created in a k8s secret (secret-seaweedfs-db.yaml) and injected to the filer
|
|
||||||
with ENV.
|
|
||||||
* cert config exists and can be enabled, but not been tested.
|
|
||||||
|
|
||||||
## Prerequisites
|
|
||||||
### Database
|
|
||||||
A running MySQL-compatible database is expected by default, as specified in the `values.yaml` at `filer.extraEnvironmentVars`.
|
|
||||||
This database should be pre-configured and initialized by running:
|
|
||||||
```sql
|
|
||||||
CREATE TABLE IF NOT EXISTS filemeta (
|
|
||||||
dirhash BIGINT COMMENT 'first 64 bits of MD5 hash value of directory field',
|
|
||||||
name VARCHAR(1000) BINARY COMMENT 'directory or file name',
|
|
||||||
directory TEXT BINARY COMMENT 'full path to parent directory',
|
|
||||||
meta LONGBLOB,
|
|
||||||
PRIMARY KEY (dirhash, name)
|
|
||||||
) DEFAULT CHARSET=utf8;
|
|
||||||
```
|
|
||||||
|
|
||||||
Alternative database can also be configured (e.g. leveldb) following the instructions at `filer.extraEnvironmentVars`.
|
|
||||||
|
|
||||||
### Node Labels
|
|
||||||
Kubernetes node have labels which help to define which node(Host) will run which pod:
|
|
||||||
* s3/filer/master needs the label **sw-backend=true**
|
|
||||||
* volume need the label **sw-volume=true**
|
|
||||||
|
|
||||||
to label a node to be able to run all pod types in k8s:
|
|
||||||
```
|
|
||||||
kubectl label node YOUR_NODE_NAME sw-volume=true,sw-backend=true
|
|
||||||
```
|
|
||||||
|
|
||||||
on production k8s deployment you will want each pod to have a different host,
|
|
||||||
especially the volume server & the masters, currently all pods (master/volume/filer)
|
|
||||||
have anti-affinity rule to disallow running multiple pod type on the same host.
|
|
||||||
if you still want to run multiple pods of the same type (master/volume/filer) on the same host
|
|
||||||
please set/update the corresponding affinity rule in values.yaml to an empty one:
|
|
||||||
|
|
||||||
```affinity: ""```
|
|
||||||
|
|
||||||
## PVC - storage class ###
|
|
||||||
|
|
||||||
on the volume stateful set added support for K8S PVC, currently example
|
|
||||||
with the simple local-path-provisioner from Rancher (comes included with k3d / k3s)
|
|
||||||
https://github.com/rancher/local-path-provisioner
|
|
||||||
|
|
||||||
you can use ANY storage class you like, just update the correct storage-class
|
|
||||||
for your deployment.
|
|
||||||
|
|
||||||
## current instances config (AIO):
|
|
||||||
1 instance for each type (master/filer+s3/volume)
|
|
||||||
|
|
||||||
you can update the replicas count for each node type in values.yaml,
|
|
||||||
need to add more nodes with the corresponding labels.
|
|
||||||
|
|
||||||
most of the configuration are available through values.yaml
|
|
||||||
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
@@ -21,7 +21,7 @@ public class FilerSslContext {
|
|||||||
String home = System.getProperty("user.home");
|
String home = System.getProperty("user.home");
|
||||||
File f1 = new File("./"+securityFileName);
|
File f1 = new File("./"+securityFileName);
|
||||||
File f2 = new File(home + "/.seaweedfs/"+securityFileName);
|
File f2 = new File(home + "/.seaweedfs/"+securityFileName);
|
||||||
File f3 = new File(home + "/etc/seaweedfs/"+securityFileName);
|
File f3 = new File("/etc/seaweedfs/"+securityFileName);
|
||||||
|
|
||||||
File securityFile = f1.exists()? f1 : f2.exists() ? f2 : f3.exists()? f3 : null;
|
File securityFile = f1.exists()? f1 : f2.exists() ? f2 : f3.exists()? f3 : null;
|
||||||
|
|
||||||
|
|||||||
@@ -68,6 +68,13 @@ service SeaweedFiler {
|
|||||||
|
|
||||||
rpc CacheRemoteObjectToLocalCluster (CacheRemoteObjectToLocalClusterRequest) returns (CacheRemoteObjectToLocalClusterResponse) {
|
rpc CacheRemoteObjectToLocalCluster (CacheRemoteObjectToLocalClusterRequest) returns (CacheRemoteObjectToLocalClusterResponse) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rpc Lock(LockRequest) returns (LockResponse) {
|
||||||
|
}
|
||||||
|
rpc Unlock(UnlockRequest) returns (UnlockResponse) {
|
||||||
|
}
|
||||||
|
rpc TransferLocks(TransferLocksRequest) returns (TransferLocksResponse) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////
|
//////////////////////////////////////////////////
|
||||||
@@ -428,3 +435,37 @@ message CacheRemoteObjectToLocalClusterRequest {
|
|||||||
message CacheRemoteObjectToLocalClusterResponse {
|
message CacheRemoteObjectToLocalClusterResponse {
|
||||||
Entry entry = 1;
|
Entry entry = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/////////////////////////
|
||||||
|
// distributed lock management
|
||||||
|
/////////////////////////
|
||||||
|
message LockRequest {
|
||||||
|
string name = 1;
|
||||||
|
int64 seconds_to_lock = 2;
|
||||||
|
string renew_token = 3;
|
||||||
|
bool is_moved = 4;
|
||||||
|
}
|
||||||
|
message LockResponse {
|
||||||
|
string renew_token = 1;
|
||||||
|
string moved_to = 2;
|
||||||
|
string error = 3;
|
||||||
|
}
|
||||||
|
message UnlockRequest {
|
||||||
|
string name = 1;
|
||||||
|
string renew_token = 2;
|
||||||
|
bool is_moved = 3;
|
||||||
|
}
|
||||||
|
message UnlockResponse {
|
||||||
|
string error = 1;
|
||||||
|
string moved_to = 2;
|
||||||
|
}
|
||||||
|
message Lock {
|
||||||
|
string name = 1;
|
||||||
|
string renew_token = 2;
|
||||||
|
int64 expired_at_ns = 3;
|
||||||
|
}
|
||||||
|
message TransferLocksRequest {
|
||||||
|
repeated Lock locks = 1;
|
||||||
|
}
|
||||||
|
message TransferLocksResponse {
|
||||||
|
}
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.hadoop</groupId>
|
<groupId>org.apache.hadoop</groupId>
|
||||||
<artifactId>hadoop-common</artifactId>
|
<artifactId>hadoop-common</artifactId>
|
||||||
<version>2.10.1</version>
|
<version>2.10.2</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|||||||
@@ -5,6 +5,10 @@
|
|||||||
<artifactId>copier</artifactId>
|
<artifactId>copier</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>18</maven.compiler.source>
|
||||||
|
<maven.compiler.target>18</maven.compiler.target>
|
||||||
|
</properties>
|
||||||
<name>copier</name>
|
<name>copier</name>
|
||||||
<url>http://maven.apache.org</url>
|
<url>http://maven.apache.org</url>
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import com.amazonaws.client.builder.AwsClientBuilder;
|
|||||||
import com.amazonaws.regions.Regions;
|
import com.amazonaws.regions.Regions;
|
||||||
import com.amazonaws.services.s3.AmazonS3;
|
import com.amazonaws.services.s3.AmazonS3;
|
||||||
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
|
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
|
||||||
|
import com.amazonaws.services.s3.model.CreateBucketRequest;
|
||||||
|
import com.amazonaws.services.s3.model.GetBucketLocationRequest;
|
||||||
import com.amazonaws.services.s3.transfer.TransferManager;
|
import com.amazonaws.services.s3.transfer.TransferManager;
|
||||||
import com.amazonaws.services.s3.transfer.TransferManagerBuilder;
|
import com.amazonaws.services.s3.transfer.TransferManagerBuilder;
|
||||||
import com.amazonaws.services.s3.transfer.Upload;
|
import com.amazonaws.services.s3.transfer.Upload;
|
||||||
@@ -42,6 +44,19 @@ public class HighLevelMultipartUpload {
|
|||||||
.withS3Client(s3Client)
|
.withS3Client(s3Client)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
|
||||||
|
if (!s3Client.doesBucketExistV2(bucketName)) {
|
||||||
|
// Because the CreateBucketRequest object doesn't specify a region, the
|
||||||
|
// bucket is created in the region specified in the client.
|
||||||
|
s3Client.createBucket(new CreateBucketRequest(bucketName));
|
||||||
|
|
||||||
|
// Verify that the bucket was created by retrieving it and checking its location.
|
||||||
|
String bucketLocation = s3Client.getBucketLocation(new GetBucketLocationRequest(bucketName));
|
||||||
|
System.out.println("Bucket location: " + bucketLocation);
|
||||||
|
} else {
|
||||||
|
System.out.println("Bucket already exists");
|
||||||
|
}
|
||||||
|
|
||||||
// TransferManager processes all transfers asynchronously,
|
// TransferManager processes all transfers asynchronously,
|
||||||
// so this call returns immediately.
|
// so this call returns immediately.
|
||||||
Upload upload = tm.upload(bucketName, keyName, file);
|
Upload upload = tm.upload(bucketName, keyName, file);
|
||||||
|
|||||||
@@ -2452,7 +2452,27 @@
|
|||||||
"style": "dark",
|
"style": "dark",
|
||||||
"tags": [],
|
"tags": [],
|
||||||
"templating": {
|
"templating": {
|
||||||
"list": []
|
"list": [
|
||||||
|
{
|
||||||
|
"current": {
|
||||||
|
"selected": true,
|
||||||
|
"text": "default",
|
||||||
|
"value": "default"
|
||||||
|
},
|
||||||
|
"hide": 0,
|
||||||
|
"includeAll": false,
|
||||||
|
"label": "Datasource",
|
||||||
|
"multi": false,
|
||||||
|
"name": "DS_PROMETHEUS",
|
||||||
|
"options": [],
|
||||||
|
"query": "prometheus",
|
||||||
|
"queryValue": "",
|
||||||
|
"refresh": 1,
|
||||||
|
"regex": "",
|
||||||
|
"skipUrlSync": false,
|
||||||
|
"type": "datasource"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"time": {
|
"time": {
|
||||||
"from": "now-3h",
|
"from": "now-3h",
|
||||||
|
|||||||
@@ -1895,7 +1895,27 @@
|
|||||||
"style": "dark",
|
"style": "dark",
|
||||||
"tags": [],
|
"tags": [],
|
||||||
"templating": {
|
"templating": {
|
||||||
"list": []
|
"list": [
|
||||||
|
{
|
||||||
|
"current": {
|
||||||
|
"selected": true,
|
||||||
|
"text": "default",
|
||||||
|
"value": "default"
|
||||||
|
},
|
||||||
|
"hide": 0,
|
||||||
|
"includeAll": false,
|
||||||
|
"label": "Datasource",
|
||||||
|
"multi": false,
|
||||||
|
"name": "DS_PROMETHEUS",
|
||||||
|
"options": [],
|
||||||
|
"query": "prometheus",
|
||||||
|
"queryValue": "",
|
||||||
|
"refresh": 1,
|
||||||
|
"regex": "",
|
||||||
|
"skipUrlSync": false,
|
||||||
|
"type": "datasource"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"time": {
|
"time": {
|
||||||
"from": "now-5m",
|
"from": "now-5m",
|
||||||
|
|||||||
@@ -2179,8 +2179,8 @@
|
|||||||
{
|
{
|
||||||
"current": {
|
"current": {
|
||||||
"selected": true,
|
"selected": true,
|
||||||
"text": "clickhouse-prom",
|
"text": "default",
|
||||||
"value": "clickhouse-prom"
|
"value": "default"
|
||||||
},
|
},
|
||||||
"hide": 0,
|
"hide": 0,
|
||||||
"includeAll": false,
|
"includeAll": false,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<guava.version>30.0-jre</guava.version>
|
<guava.version>32.0.0-jre</guava.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|||||||
@@ -0,0 +1,114 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/aws/aws-sdk-go-v2/aws"
|
||||||
|
"github.com/aws/aws-sdk-go-v2/aws/retry"
|
||||||
|
"github.com/aws/aws-sdk-go-v2/config"
|
||||||
|
"github.com/aws/aws-sdk-go-v2/credentials"
|
||||||
|
"github.com/aws/aws-sdk-go-v2/service/s3"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
cfg := MyConfig{
|
||||||
|
Key: "any",
|
||||||
|
Secret: "any",
|
||||||
|
Region: "US",
|
||||||
|
Endpoint: MyEndpoint{
|
||||||
|
URL: "http://localhost:8333",
|
||||||
|
},
|
||||||
|
Bucket: MyBucketConfig{
|
||||||
|
Name: "newbucket",
|
||||||
|
Versioning: false,
|
||||||
|
},
|
||||||
|
MaxBackoffDelay: aws.Int(int(time.Second * 5)),
|
||||||
|
MaxRetryAttempts: aws.Int(1),
|
||||||
|
}
|
||||||
|
|
||||||
|
awsCfg, err := MyAwsConfig(cfg)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
svc := s3.NewFromConfig(*awsCfg, func(o *s3.Options) {
|
||||||
|
o.UsePathStyle = true
|
||||||
|
})
|
||||||
|
|
||||||
|
// Use the S3 client to interact with SeaweedFS
|
||||||
|
// ...
|
||||||
|
// Example: List all buckets
|
||||||
|
result, err := svc.ListBuckets(context.Background(), &s3.ListBucketsInput{})
|
||||||
|
// no errors - got list of buckets
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Print the list of buckets
|
||||||
|
for _, bucket := range result.Buckets {
|
||||||
|
println(*bucket.Name)
|
||||||
|
}
|
||||||
|
|
||||||
|
bucket := "bucket1"
|
||||||
|
_, err = svc.HeadBucket(context.Background(), &s3.HeadBucketInput{Bucket: &bucket})
|
||||||
|
// ERROR HERE
|
||||||
|
if err != nil {
|
||||||
|
println(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// === helpers
|
||||||
|
|
||||||
|
func MyAwsConfig(cfg MyConfig) (*aws.Config, error) {
|
||||||
|
|
||||||
|
cred := aws.NewCredentialsCache(credentials.NewStaticCredentialsProvider(cfg.Key, cfg.Secret, ""))
|
||||||
|
customResolver := aws.EndpointResolverWithOptionsFunc(
|
||||||
|
func(service, region string, options ...interface{}) (aws.Endpoint, error) {
|
||||||
|
return aws.Endpoint{
|
||||||
|
URL: cfg.Endpoint.URL,
|
||||||
|
SigningRegion: cfg.Region,
|
||||||
|
}, nil
|
||||||
|
})
|
||||||
|
|
||||||
|
awsCfg, err := config.LoadDefaultConfig(context.TODO(),
|
||||||
|
config.WithRegion(cfg.Region),
|
||||||
|
config.WithCredentialsProvider(cred),
|
||||||
|
config.WithEndpointResolverWithOptions(customResolver),
|
||||||
|
config.WithRetryer(func() aws.Retryer {
|
||||||
|
r := retry.AddWithMaxAttempts(retry.NewStandard(), *cfg.MaxRetryAttempts)
|
||||||
|
return retry.AddWithMaxBackoffDelay(r, time.Duration(*cfg.MaxBackoffDelay*1000*1000))
|
||||||
|
}))
|
||||||
|
return &awsCfg, err
|
||||||
|
}
|
||||||
|
|
||||||
|
type MyConfig struct {
|
||||||
|
// Access key of S3 AWS.
|
||||||
|
Key string
|
||||||
|
// Access secret of S3 AWS.
|
||||||
|
Secret string
|
||||||
|
// Region.
|
||||||
|
Region string
|
||||||
|
// AWS endpoint.
|
||||||
|
Endpoint MyEndpoint
|
||||||
|
// Bucket configuration.
|
||||||
|
Bucket MyBucketConfig
|
||||||
|
// File access.
|
||||||
|
FileAccess MyFileAccessType
|
||||||
|
// Maximum backoff delay (ms, default: 20 sec).
|
||||||
|
MaxBackoffDelay *int
|
||||||
|
// Maximum attempts to retry operation on error (default: 5).
|
||||||
|
MaxRetryAttempts *int
|
||||||
|
}
|
||||||
|
|
||||||
|
type MyBucketConfig struct {
|
||||||
|
// Name of bucket
|
||||||
|
Name string
|
||||||
|
// Enable or not versioning
|
||||||
|
Versioning bool
|
||||||
|
}
|
||||||
|
|
||||||
|
type MyEndpoint struct {
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
type MyFileAccessType byte
|
||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
"github.com/seaweedfs/seaweedfs/weed/glog"
|
"github.com/seaweedfs/seaweedfs/weed/glog"
|
||||||
"github.com/seaweedfs/seaweedfs/weed/pb"
|
"github.com/seaweedfs/seaweedfs/weed/pb"
|
||||||
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
|
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
|
||||||
|
"github.com/seaweedfs/seaweedfs/weed/util"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/credentials/insecure"
|
"google.golang.org/grpc/credentials/insecure"
|
||||||
"strconv"
|
"strconv"
|
||||||
@@ -52,7 +53,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func startGenerateMetadata() {
|
func startGenerateMetadata() {
|
||||||
pb.WithFilerClient(false, pb.ServerAddress(*tailFiler), grpc.WithTransportCredentials(insecure.NewCredentials()), func(client filer_pb.SeaweedFilerClient) error {
|
pb.WithFilerClient(false, util.RandomInt32(), pb.ServerAddress(*tailFiler), grpc.WithTransportCredentials(insecure.NewCredentials()), 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)
|
||||||
@@ -78,7 +79,19 @@ 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.WithTransportCredentials(insecure.NewCredentials()), "tail", 0, 0, *dir, nil, 0, 0, 0, eachEntryFunc, pb.TrivialOnError)
|
metadataFollowOption := &pb.MetadataFollowOption{
|
||||||
|
ClientName: "tail",
|
||||||
|
ClientId: 0,
|
||||||
|
ClientEpoch: 0,
|
||||||
|
SelfSignature: 0,
|
||||||
|
PathPrefix: *dir,
|
||||||
|
AdditionalPathPrefixes: nil,
|
||||||
|
DirectoriesToWatch: nil,
|
||||||
|
StartTsNs: 0,
|
||||||
|
StopTsNs: 0,
|
||||||
|
EventErrorType: pb.TrivialOnError,
|
||||||
|
}
|
||||||
|
tailErr := pb.FollowMetadata(pb.ServerAddress(*tailFiler), grpc.WithTransportCredentials(insecure.NewCredentials()), metadataFollowOption, eachEntryFunc)
|
||||||
|
|
||||||
if tailErr != nil {
|
if tailErr != nil {
|
||||||
fmt.Printf("tail %s: %v\n", *tailFiler, tailErr)
|
fmt.Printf("tail %s: %v\n", *tailFiler, tailErr)
|
||||||
|
|||||||
@@ -2,9 +2,10 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"github.com/seaweedfs/seaweedfs/weed/util"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/seaweedfs/seaweedfs/weed/util"
|
||||||
|
|
||||||
"github.com/seaweedfs/seaweedfs/weed/glog"
|
"github.com/seaweedfs/seaweedfs/weed/glog"
|
||||||
"github.com/seaweedfs/seaweedfs/weed/storage"
|
"github.com/seaweedfs/seaweedfs/weed/storage"
|
||||||
"github.com/seaweedfs/seaweedfs/weed/storage/needle"
|
"github.com/seaweedfs/seaweedfs/weed/storage/needle"
|
||||||
@@ -32,7 +33,7 @@ func (scanner *VolumeFileScanner4SeeDat) ReadNeedleBody() bool {
|
|||||||
|
|
||||||
func (scanner *VolumeFileScanner4SeeDat) VisitNeedle(n *needle.Needle, offset int64, needleHeader, needleBody []byte) error {
|
func (scanner *VolumeFileScanner4SeeDat) VisitNeedle(n *needle.Needle, offset int64, needleHeader, needleBody []byte) error {
|
||||||
t := time.Unix(int64(n.AppendAtNs)/int64(time.Second), int64(n.AppendAtNs)%int64(time.Second))
|
t := time.Unix(int64(n.AppendAtNs)/int64(time.Second), int64(n.AppendAtNs)%int64(time.Second))
|
||||||
glog.V(0).Infof("%d,%s%x offset %d size %d(%s) cookie %x appendedAt %v",
|
glog.V(0).Infof("%d,%s%08x offset %d size %d(%s) cookie %08x appendedAt %v",
|
||||||
*volumeId, n.Id, n.Cookie, offset, n.Size, util.BytesToHumanReadable(uint64(n.Size)), n.Cookie, t)
|
*volumeId, n.Id, n.Cookie, offset, n.Size, util.BytesToHumanReadable(uint64(n.Size)), n.Cookie, t)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
+15
-219
@@ -3,7 +3,6 @@ package cluster
|
|||||||
import (
|
import (
|
||||||
"github.com/seaweedfs/seaweedfs/weed/pb"
|
"github.com/seaweedfs/seaweedfs/weed/pb"
|
||||||
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
|
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
|
||||||
"math"
|
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@@ -19,9 +18,6 @@ type FilerGroupName string
|
|||||||
type DataCenter string
|
type DataCenter string
|
||||||
type Rack string
|
type Rack string
|
||||||
|
|
||||||
type Leaders struct {
|
|
||||||
leaders [3]pb.ServerAddress
|
|
||||||
}
|
|
||||||
type ClusterNode struct {
|
type ClusterNode struct {
|
||||||
Address pb.ServerAddress
|
Address pb.ServerAddress
|
||||||
Version string
|
Version string
|
||||||
@@ -30,10 +26,7 @@ type ClusterNode struct {
|
|||||||
DataCenter DataCenter
|
DataCenter DataCenter
|
||||||
Rack Rack
|
Rack Rack
|
||||||
}
|
}
|
||||||
type GroupMembers struct {
|
|
||||||
members map[pb.ServerAddress]*ClusterNode
|
|
||||||
leaders *Leaders
|
|
||||||
}
|
|
||||||
type ClusterNodeGroups struct {
|
type ClusterNodeGroups struct {
|
||||||
groupMembers map[FilerGroupName]*GroupMembers
|
groupMembers map[FilerGroupName]*GroupMembers
|
||||||
sync.RWMutex
|
sync.RWMutex
|
||||||
@@ -51,50 +44,18 @@ func newClusterNodeGroups() *ClusterNodeGroups {
|
|||||||
func (g *ClusterNodeGroups) getGroupMembers(filerGroup FilerGroupName, createIfNotFound bool) *GroupMembers {
|
func (g *ClusterNodeGroups) getGroupMembers(filerGroup FilerGroupName, createIfNotFound bool) *GroupMembers {
|
||||||
members, found := g.groupMembers[filerGroup]
|
members, found := g.groupMembers[filerGroup]
|
||||||
if !found && createIfNotFound {
|
if !found && createIfNotFound {
|
||||||
members = &GroupMembers{
|
members = newGroupMembers()
|
||||||
members: make(map[pb.ServerAddress]*ClusterNode),
|
|
||||||
leaders: &Leaders{},
|
|
||||||
}
|
|
||||||
g.groupMembers[filerGroup] = members
|
g.groupMembers[filerGroup] = members
|
||||||
}
|
}
|
||||||
return members
|
return members
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *GroupMembers) addMember(dataCenter DataCenter, rack Rack, address pb.ServerAddress, version string) *ClusterNode {
|
|
||||||
if existingNode, found := m.members[address]; found {
|
|
||||||
existingNode.counter++
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
t := &ClusterNode{
|
|
||||||
Address: address,
|
|
||||||
Version: version,
|
|
||||||
counter: 1,
|
|
||||||
CreatedTs: time.Now(),
|
|
||||||
DataCenter: dataCenter,
|
|
||||||
Rack: rack,
|
|
||||||
}
|
|
||||||
m.members[address] = t
|
|
||||||
return t
|
|
||||||
}
|
|
||||||
func (m *GroupMembers) removeMember(address pb.ServerAddress) bool {
|
|
||||||
if existingNode, found := m.members[address]; !found {
|
|
||||||
return false
|
|
||||||
} else {
|
|
||||||
existingNode.counter--
|
|
||||||
if existingNode.counter <= 0 {
|
|
||||||
delete(m.members, address)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
func (g *ClusterNodeGroups) AddClusterNode(filerGroup FilerGroupName, nodeType string, dataCenter DataCenter, rack Rack, address pb.ServerAddress, version string) []*master_pb.KeepConnectedResponse {
|
func (g *ClusterNodeGroups) AddClusterNode(filerGroup FilerGroupName, nodeType string, dataCenter DataCenter, rack Rack, address pb.ServerAddress, version string) []*master_pb.KeepConnectedResponse {
|
||||||
g.Lock()
|
g.Lock()
|
||||||
defer g.Unlock()
|
defer g.Unlock()
|
||||||
m := g.getGroupMembers(filerGroup, true)
|
m := g.getGroupMembers(filerGroup, true)
|
||||||
if t := m.addMember(dataCenter, rack, address, version); t != nil {
|
if t := m.addMember(dataCenter, rack, address, version); t != nil {
|
||||||
return ensureGroupLeaders(m, true, filerGroup, nodeType, address)
|
return buildClusterNodeUpdateMessage(true, filerGroup, nodeType, address)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -106,7 +67,7 @@ func (g *ClusterNodeGroups) RemoveClusterNode(filerGroup FilerGroupName, nodeTyp
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if m.removeMember(address) {
|
if m.removeMember(address) {
|
||||||
return ensureGroupLeaders(m, false, filerGroup, nodeType, address)
|
return buildClusterNodeUpdateMessage(false, filerGroup, nodeType, address)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -122,24 +83,6 @@ func (g *ClusterNodeGroups) ListClusterNode(filerGroup FilerGroupName) (nodes []
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
func (g *ClusterNodeGroups) IsOneLeader(filerGroup FilerGroupName, address pb.ServerAddress) bool {
|
|
||||||
g.Lock()
|
|
||||||
defer g.Unlock()
|
|
||||||
m := g.getGroupMembers(filerGroup, false)
|
|
||||||
if m == nil {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return m.leaders.isOneLeader(address)
|
|
||||||
}
|
|
||||||
func (g *ClusterNodeGroups) ListClusterNodeLeaders(filerGroup FilerGroupName) (nodes []pb.ServerAddress) {
|
|
||||||
g.Lock()
|
|
||||||
defer g.Unlock()
|
|
||||||
m := g.getGroupMembers(filerGroup, false)
|
|
||||||
if m == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
return m.leaders.GetLeaders()
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewCluster() *Cluster {
|
func NewCluster() *Cluster {
|
||||||
return &Cluster{
|
return &Cluster{
|
||||||
@@ -166,15 +109,7 @@ func (cluster *Cluster) AddClusterNode(ns, nodeType string, dataCenter DataCente
|
|||||||
case BrokerType:
|
case BrokerType:
|
||||||
return cluster.brokerGroups.AddClusterNode(filerGroup, nodeType, dataCenter, rack, address, version)
|
return cluster.brokerGroups.AddClusterNode(filerGroup, nodeType, dataCenter, rack, address, version)
|
||||||
case MasterType:
|
case MasterType:
|
||||||
return []*master_pb.KeepConnectedResponse{
|
return buildClusterNodeUpdateMessage(true, filerGroup, nodeType, address)
|
||||||
{
|
|
||||||
ClusterNodeUpdate: &master_pb.ClusterNodeUpdate{
|
|
||||||
NodeType: nodeType,
|
|
||||||
Address: string(address),
|
|
||||||
IsAdd: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -187,15 +122,7 @@ func (cluster *Cluster) RemoveClusterNode(ns string, nodeType string, address pb
|
|||||||
case BrokerType:
|
case BrokerType:
|
||||||
return cluster.brokerGroups.RemoveClusterNode(filerGroup, nodeType, address)
|
return cluster.brokerGroups.RemoveClusterNode(filerGroup, nodeType, address)
|
||||||
case MasterType:
|
case MasterType:
|
||||||
return []*master_pb.KeepConnectedResponse{
|
return buildClusterNodeUpdateMessage(false, filerGroup, nodeType, address)
|
||||||
{
|
|
||||||
ClusterNodeUpdate: &master_pb.ClusterNodeUpdate{
|
|
||||||
NodeType: nodeType,
|
|
||||||
Address: string(address),
|
|
||||||
IsAdd: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -211,145 +138,14 @@ func (cluster *Cluster) ListClusterNode(filerGroup FilerGroupName, nodeType stri
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cluster *Cluster) ListClusterNodeLeaders(filerGroup FilerGroupName, nodeType string) (nodes []pb.ServerAddress) {
|
func buildClusterNodeUpdateMessage(isAdd bool, filerGroup FilerGroupName, nodeType string, address pb.ServerAddress) (result []*master_pb.KeepConnectedResponse) {
|
||||||
switch nodeType {
|
result = append(result, &master_pb.KeepConnectedResponse{
|
||||||
case FilerType:
|
ClusterNodeUpdate: &master_pb.ClusterNodeUpdate{
|
||||||
return cluster.filerGroups.ListClusterNodeLeaders(filerGroup)
|
FilerGroup: string(filerGroup),
|
||||||
case BrokerType:
|
NodeType: nodeType,
|
||||||
return cluster.brokerGroups.ListClusterNodeLeaders(filerGroup)
|
Address: string(address),
|
||||||
case MasterType:
|
IsAdd: isAdd,
|
||||||
}
|
},
|
||||||
return
|
})
|
||||||
}
|
|
||||||
|
|
||||||
func (cluster *Cluster) IsOneLeader(filerGroup FilerGroupName, nodeType string, address pb.ServerAddress) bool {
|
|
||||||
switch nodeType {
|
|
||||||
case FilerType:
|
|
||||||
return cluster.filerGroups.IsOneLeader(filerGroup, address)
|
|
||||||
case BrokerType:
|
|
||||||
return cluster.brokerGroups.IsOneLeader(filerGroup, address)
|
|
||||||
case MasterType:
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
func ensureGroupLeaders(m *GroupMembers, isAdd bool, filerGroup FilerGroupName, nodeType string, address pb.ServerAddress) (result []*master_pb.KeepConnectedResponse) {
|
|
||||||
if isAdd {
|
|
||||||
if m.leaders.addLeaderIfVacant(address) {
|
|
||||||
// has added the address as one leader
|
|
||||||
result = append(result, &master_pb.KeepConnectedResponse{
|
|
||||||
ClusterNodeUpdate: &master_pb.ClusterNodeUpdate{
|
|
||||||
FilerGroup: string(filerGroup),
|
|
||||||
NodeType: nodeType,
|
|
||||||
Address: string(address),
|
|
||||||
IsLeader: true,
|
|
||||||
IsAdd: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
result = append(result, &master_pb.KeepConnectedResponse{
|
|
||||||
ClusterNodeUpdate: &master_pb.ClusterNodeUpdate{
|
|
||||||
FilerGroup: string(filerGroup),
|
|
||||||
NodeType: nodeType,
|
|
||||||
Address: string(address),
|
|
||||||
IsLeader: false,
|
|
||||||
IsAdd: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if m.leaders.removeLeaderIfExists(address) {
|
|
||||||
|
|
||||||
result = append(result, &master_pb.KeepConnectedResponse{
|
|
||||||
ClusterNodeUpdate: &master_pb.ClusterNodeUpdate{
|
|
||||||
FilerGroup: string(filerGroup),
|
|
||||||
NodeType: nodeType,
|
|
||||||
Address: string(address),
|
|
||||||
IsLeader: true,
|
|
||||||
IsAdd: false,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
// pick the freshest one, since it is less likely to go away
|
|
||||||
var shortestDuration int64 = math.MaxInt64
|
|
||||||
now := time.Now()
|
|
||||||
var candidateAddress pb.ServerAddress
|
|
||||||
for _, node := range m.members {
|
|
||||||
if m.leaders.isOneLeader(node.Address) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
duration := now.Sub(node.CreatedTs).Nanoseconds()
|
|
||||||
if duration < shortestDuration {
|
|
||||||
shortestDuration = duration
|
|
||||||
candidateAddress = node.Address
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if candidateAddress != "" {
|
|
||||||
m.leaders.addLeaderIfVacant(candidateAddress)
|
|
||||||
// added a new leader
|
|
||||||
result = append(result, &master_pb.KeepConnectedResponse{
|
|
||||||
ClusterNodeUpdate: &master_pb.ClusterNodeUpdate{
|
|
||||||
NodeType: nodeType,
|
|
||||||
Address: string(candidateAddress),
|
|
||||||
IsLeader: true,
|
|
||||||
IsAdd: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
result = append(result, &master_pb.KeepConnectedResponse{
|
|
||||||
ClusterNodeUpdate: &master_pb.ClusterNodeUpdate{
|
|
||||||
FilerGroup: string(filerGroup),
|
|
||||||
NodeType: nodeType,
|
|
||||||
Address: string(address),
|
|
||||||
IsLeader: false,
|
|
||||||
IsAdd: false,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (leaders *Leaders) addLeaderIfVacant(address pb.ServerAddress) (hasChanged bool) {
|
|
||||||
if leaders.isOneLeader(address) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
for i := 0; i < len(leaders.leaders); i++ {
|
|
||||||
if leaders.leaders[i] == "" {
|
|
||||||
leaders.leaders[i] = address
|
|
||||||
hasChanged = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func (leaders *Leaders) removeLeaderIfExists(address pb.ServerAddress) (hasChanged bool) {
|
|
||||||
if !leaders.isOneLeader(address) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
for i := 0; i < len(leaders.leaders); i++ {
|
|
||||||
if leaders.leaders[i] == address {
|
|
||||||
leaders.leaders[i] = ""
|
|
||||||
hasChanged = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func (leaders *Leaders) isOneLeader(address pb.ServerAddress) bool {
|
|
||||||
for i := 0; i < len(leaders.leaders); i++ {
|
|
||||||
if leaders.leaders[i] == address {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
func (leaders *Leaders) GetLeaders() (addresses []pb.ServerAddress) {
|
|
||||||
for i := 0; i < len(leaders.leaders); i++ {
|
|
||||||
if leaders.leaders[i] != "" {
|
|
||||||
addresses = append(addresses, leaders.leaders[i])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -2,52 +2,11 @@ package cluster
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/seaweedfs/seaweedfs/weed/pb"
|
"github.com/seaweedfs/seaweedfs/weed/pb"
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"sync"
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestClusterAddRemoveNodes(t *testing.T) {
|
|
||||||
c := NewCluster()
|
|
||||||
|
|
||||||
c.AddClusterNode("", "filer", "", "", pb.ServerAddress("111:1"), "23.45")
|
|
||||||
c.AddClusterNode("", "filer", "", "", pb.ServerAddress("111:2"), "23.45")
|
|
||||||
assert.Equal(t, []pb.ServerAddress{
|
|
||||||
pb.ServerAddress("111:1"),
|
|
||||||
pb.ServerAddress("111:2"),
|
|
||||||
}, c.getGroupMembers("", "filer", true).leaders.GetLeaders())
|
|
||||||
|
|
||||||
c.AddClusterNode("", "filer", "", "", pb.ServerAddress("111:3"), "23.45")
|
|
||||||
c.AddClusterNode("", "filer", "", "", pb.ServerAddress("111:4"), "23.45")
|
|
||||||
assert.Equal(t, []pb.ServerAddress{
|
|
||||||
pb.ServerAddress("111:1"),
|
|
||||||
pb.ServerAddress("111:2"),
|
|
||||||
pb.ServerAddress("111:3"),
|
|
||||||
}, c.getGroupMembers("", "filer", true).leaders.GetLeaders())
|
|
||||||
|
|
||||||
c.AddClusterNode("", "filer", "", "", pb.ServerAddress("111:5"), "23.45")
|
|
||||||
c.AddClusterNode("", "filer", "", "", pb.ServerAddress("111:6"), "23.45")
|
|
||||||
c.RemoveClusterNode("", "filer", pb.ServerAddress("111:4"))
|
|
||||||
assert.Equal(t, []pb.ServerAddress{
|
|
||||||
pb.ServerAddress("111:1"),
|
|
||||||
pb.ServerAddress("111:2"),
|
|
||||||
pb.ServerAddress("111:3"),
|
|
||||||
}, c.getGroupMembers("", "filer", true).leaders.GetLeaders())
|
|
||||||
|
|
||||||
// remove oldest
|
|
||||||
c.RemoveClusterNode("", "filer", pb.ServerAddress("111:1"))
|
|
||||||
assert.Equal(t, []pb.ServerAddress{
|
|
||||||
pb.ServerAddress("111:6"),
|
|
||||||
pb.ServerAddress("111:2"),
|
|
||||||
pb.ServerAddress("111:3"),
|
|
||||||
}, c.getGroupMembers("", "filer", true).leaders.GetLeaders())
|
|
||||||
|
|
||||||
// remove oldest
|
|
||||||
c.RemoveClusterNode("", "filer", pb.ServerAddress("111:1"))
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestConcurrentAddRemoveNodes(t *testing.T) {
|
func TestConcurrentAddRemoveNodes(t *testing.T) {
|
||||||
c := NewCluster()
|
c := NewCluster()
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package cluster
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/seaweedfs/seaweedfs/weed/pb"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
type GroupMembers struct {
|
||||||
|
members map[pb.ServerAddress]*ClusterNode
|
||||||
|
}
|
||||||
|
|
||||||
|
func newGroupMembers() *GroupMembers {
|
||||||
|
return &GroupMembers{
|
||||||
|
members: make(map[pb.ServerAddress]*ClusterNode),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *GroupMembers) addMember(dataCenter DataCenter, rack Rack, address pb.ServerAddress, version string) *ClusterNode {
|
||||||
|
if existingNode, found := m.members[address]; found {
|
||||||
|
existingNode.counter++
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
t := &ClusterNode{
|
||||||
|
Address: address,
|
||||||
|
Version: version,
|
||||||
|
counter: 1,
|
||||||
|
CreatedTs: time.Now(),
|
||||||
|
DataCenter: dataCenter,
|
||||||
|
Rack: rack,
|
||||||
|
}
|
||||||
|
m.members[address] = t
|
||||||
|
return t
|
||||||
|
}
|
||||||
|
func (m *GroupMembers) removeMember(address pb.ServerAddress) bool {
|
||||||
|
if existingNode, found := m.members[address]; !found {
|
||||||
|
return false
|
||||||
|
} else {
|
||||||
|
existingNode.counter--
|
||||||
|
if existingNode.counter <= 0 {
|
||||||
|
delete(m.members, address)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *GroupMembers) GetMembers() (addresses []pb.ServerAddress) {
|
||||||
|
for k := range m.members {
|
||||||
|
addresses = append(addresses, k)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
package cluster
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"github.com/seaweedfs/seaweedfs/weed/cluster/lock_manager"
|
||||||
|
"github.com/seaweedfs/seaweedfs/weed/glog"
|
||||||
|
"github.com/seaweedfs/seaweedfs/weed/pb"
|
||||||
|
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
|
||||||
|
"github.com/seaweedfs/seaweedfs/weed/util"
|
||||||
|
"google.golang.org/grpc"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
type LockClient struct {
|
||||||
|
grpcDialOption grpc.DialOption
|
||||||
|
maxLockDuration time.Duration
|
||||||
|
sleepDuration time.Duration
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewLockClient(grpcDialOption grpc.DialOption) *LockClient {
|
||||||
|
return &LockClient{
|
||||||
|
grpcDialOption: grpcDialOption,
|
||||||
|
maxLockDuration: 5 * time.Second,
|
||||||
|
sleepDuration: 4 * time.Millisecond,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type LiveLock struct {
|
||||||
|
key string
|
||||||
|
renewToken string
|
||||||
|
expireAtNs int64
|
||||||
|
filer pb.ServerAddress
|
||||||
|
cancelCh chan struct{}
|
||||||
|
grpcDialOption grpc.DialOption
|
||||||
|
isLocked bool
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewLockWithTimeout locks the key with the given duration
|
||||||
|
func (lc *LockClient) NewLockWithTimeout(filer pb.ServerAddress, key string, lockDuration time.Duration) (lock *LiveLock) {
|
||||||
|
return lc.doNewLock(filer, key, lockDuration)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewLock creates a lock with a very long duration
|
||||||
|
func (lc *LockClient) NewLock(filer pb.ServerAddress, key string) (lock *LiveLock) {
|
||||||
|
return lc.doNewLock(filer, key, lock_manager.MaxDuration)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (lc *LockClient) doNewLock(filer pb.ServerAddress, key string, lockDuration time.Duration) (lock *LiveLock) {
|
||||||
|
lock = &LiveLock{
|
||||||
|
key: key,
|
||||||
|
filer: filer,
|
||||||
|
cancelCh: make(chan struct{}),
|
||||||
|
expireAtNs: time.Now().Add(lockDuration).UnixNano(),
|
||||||
|
grpcDialOption: lc.grpcDialOption,
|
||||||
|
}
|
||||||
|
var needRenewal bool
|
||||||
|
if lockDuration > lc.maxLockDuration {
|
||||||
|
lockDuration = lc.maxLockDuration
|
||||||
|
needRenewal = true
|
||||||
|
}
|
||||||
|
util.RetryForever("create lock:"+key, func() error {
|
||||||
|
errorMessage, err := lock.doLock(lockDuration)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if errorMessage != "" {
|
||||||
|
return fmt.Errorf("%v", errorMessage)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}, func(err error) (shouldContinue bool) {
|
||||||
|
if err != nil {
|
||||||
|
glog.Warningf("create lock %s: %s", key, err)
|
||||||
|
}
|
||||||
|
return lock.renewToken == ""
|
||||||
|
})
|
||||||
|
|
||||||
|
lock.isLocked = true
|
||||||
|
|
||||||
|
if needRenewal {
|
||||||
|
go lc.keepLock(lock)
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (lock *LiveLock) IsLocked() bool {
|
||||||
|
return lock.isLocked
|
||||||
|
}
|
||||||
|
|
||||||
|
func (lock *LiveLock) Unlock() error {
|
||||||
|
close(lock.cancelCh)
|
||||||
|
return pb.WithFilerClient(false, 0, lock.filer, lock.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||||
|
_, err := client.Unlock(context.Background(), &filer_pb.UnlockRequest{
|
||||||
|
Name: lock.key,
|
||||||
|
RenewToken: lock.renewToken,
|
||||||
|
})
|
||||||
|
return err
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func (lc *LockClient) keepLock(lock *LiveLock) {
|
||||||
|
for {
|
||||||
|
select {
|
||||||
|
case <-time.After(lc.sleepDuration):
|
||||||
|
// renew the lock if lock.expireAtNs is still greater than now
|
||||||
|
util.RetryForever("keep lock:"+lock.key, func() error {
|
||||||
|
lockDuration := time.Duration(lock.expireAtNs-time.Now().UnixNano()) * time.Nanosecond
|
||||||
|
if lockDuration > lc.maxLockDuration {
|
||||||
|
lockDuration = lc.maxLockDuration
|
||||||
|
}
|
||||||
|
if lockDuration <= 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
errorMessage, err := lock.doLock(lockDuration)
|
||||||
|
if err != nil {
|
||||||
|
lock.isLocked = false
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if errorMessage != "" {
|
||||||
|
lock.isLocked = false
|
||||||
|
return fmt.Errorf("%v", errorMessage)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}, func(err error) (shouldContinue bool) {
|
||||||
|
if err == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
glog.Warningf("keep lock %s: %v", lock.key, err)
|
||||||
|
return true
|
||||||
|
})
|
||||||
|
if !lock.isLocked {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
case <-lock.cancelCh:
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (lock *LiveLock) doLock(lockDuration time.Duration) (errorMessage string, err error) {
|
||||||
|
err = pb.WithFilerClient(false, 0, lock.filer, lock.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||||
|
resp, err := client.Lock(context.Background(), &filer_pb.LockRequest{
|
||||||
|
Name: lock.key,
|
||||||
|
SecondsToLock: int64(lockDuration.Seconds()),
|
||||||
|
RenewToken: lock.renewToken,
|
||||||
|
IsMoved: false,
|
||||||
|
})
|
||||||
|
if err == nil {
|
||||||
|
lock.renewToken = resp.RenewToken
|
||||||
|
}
|
||||||
|
if resp != nil {
|
||||||
|
errorMessage = resp.Error
|
||||||
|
if resp.MovedTo != "" {
|
||||||
|
lock.filer = pb.ServerAddress(resp.MovedTo)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
package lock_manager
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"github.com/seaweedfs/seaweedfs/weed/pb"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
const MaxDuration = 1<<63 - 1
|
||||||
|
|
||||||
|
var NoLockServerError = fmt.Errorf("no lock server found")
|
||||||
|
|
||||||
|
type DistributedLockManager struct {
|
||||||
|
lockManager *LockManager
|
||||||
|
LockRing *LockRing
|
||||||
|
Host pb.ServerAddress
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewDistributedLockManager(host pb.ServerAddress) *DistributedLockManager {
|
||||||
|
return &DistributedLockManager{
|
||||||
|
lockManager: NewLockManager(),
|
||||||
|
LockRing: NewLockRing(time.Second * 5),
|
||||||
|
Host: host,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (dlm *DistributedLockManager) Lock(key string, token string) (renewToken string, movedTo pb.ServerAddress, err error) {
|
||||||
|
return dlm.LockWithTimeout(key, MaxDuration, token)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (dlm *DistributedLockManager) LockWithTimeout(key string, expiredAtNs int64, token string) (renewToken string, movedTo pb.ServerAddress, err error) {
|
||||||
|
servers := dlm.LockRing.GetSnapshot()
|
||||||
|
if servers == nil {
|
||||||
|
err = NoLockServerError
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
server := hashKeyToServer(key, servers)
|
||||||
|
if server != dlm.Host {
|
||||||
|
movedTo = server
|
||||||
|
return
|
||||||
|
}
|
||||||
|
renewToken, err = dlm.lockManager.Lock(key, expiredAtNs, token)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (dlm *DistributedLockManager) Unlock(key string, token string) (movedTo pb.ServerAddress, err error) {
|
||||||
|
servers := dlm.LockRing.GetSnapshot()
|
||||||
|
if servers == nil {
|
||||||
|
err = NoLockServerError
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
server := hashKeyToServer(key, servers)
|
||||||
|
if server != dlm.Host {
|
||||||
|
movedTo = server
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, err = dlm.lockManager.Unlock(key, token)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// InsertLock is used to insert a lock to a server unconditionally
|
||||||
|
// It is used when a server is down and the lock is moved to another server
|
||||||
|
func (dlm *DistributedLockManager) InsertLock(key string, expiredAtNs int64, token string) {
|
||||||
|
dlm.lockManager.InsertLock(key, expiredAtNs, token)
|
||||||
|
}
|
||||||
|
func (dlm *DistributedLockManager) SelectNotOwnedLocks(servers []pb.ServerAddress) (locks []*Lock) {
|
||||||
|
return dlm.lockManager.SelectLocks(func(key string) bool {
|
||||||
|
server := hashKeyToServer(key, servers)
|
||||||
|
return server != dlm.Host
|
||||||
|
})
|
||||||
|
}
|
||||||
|
func (dlm *DistributedLockManager) CalculateTargetServer(key string, servers []pb.ServerAddress) pb.ServerAddress {
|
||||||
|
return hashKeyToServer(key, servers)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (dlm *DistributedLockManager) IsLocal(key string) bool {
|
||||||
|
servers := dlm.LockRing.GetSnapshot()
|
||||||
|
if len(servers) <= 1 {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return hashKeyToServer(key, servers) == dlm.Host
|
||||||
|
}
|
||||||
@@ -0,0 +1,137 @@
|
|||||||
|
package lock_manager
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"github.com/google/uuid"
|
||||||
|
"github.com/puzpuzpuz/xsync/v2"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
var LockErrorNonEmptyTokenOnNewLock = fmt.Errorf("lock: non-empty token on a new lock")
|
||||||
|
var LockErrorNonEmptyTokenOnExpiredLock = fmt.Errorf("lock: non-empty token on an expired lock")
|
||||||
|
var LockErrorTokenMismatch = fmt.Errorf("lock: token mismatch")
|
||||||
|
var UnlockErrorTokenMismatch = fmt.Errorf("unlock: token mismatch")
|
||||||
|
|
||||||
|
// LockManager lock manager
|
||||||
|
type LockManager struct {
|
||||||
|
locks *xsync.MapOf[string, *Lock]
|
||||||
|
}
|
||||||
|
type Lock struct {
|
||||||
|
Token string
|
||||||
|
ExpiredAtNs int64
|
||||||
|
Key string // only used for moving locks
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewLockManager() *LockManager {
|
||||||
|
t := &LockManager{
|
||||||
|
locks: xsync.NewMapOf[*Lock](),
|
||||||
|
}
|
||||||
|
go t.CleanUp()
|
||||||
|
return t
|
||||||
|
}
|
||||||
|
|
||||||
|
func (lm *LockManager) Lock(path string, expiredAtNs int64, token string) (renewToken string, err error) {
|
||||||
|
lm.locks.Compute(path, func(oldValue *Lock, loaded bool) (newValue *Lock, delete bool) {
|
||||||
|
if oldValue != nil {
|
||||||
|
if oldValue.ExpiredAtNs > 0 && oldValue.ExpiredAtNs < time.Now().UnixNano() {
|
||||||
|
// lock is expired, set to a new lock
|
||||||
|
if token != "" {
|
||||||
|
err = LockErrorNonEmptyTokenOnExpiredLock
|
||||||
|
return nil, false
|
||||||
|
} else {
|
||||||
|
// new lock
|
||||||
|
renewToken = uuid.New().String()
|
||||||
|
return &Lock{Token: renewToken, ExpiredAtNs: expiredAtNs}, false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// not expired
|
||||||
|
if oldValue.Token == token {
|
||||||
|
// token matches, renew the lock
|
||||||
|
renewToken = uuid.New().String()
|
||||||
|
return &Lock{Token: renewToken, ExpiredAtNs: expiredAtNs}, false
|
||||||
|
} else {
|
||||||
|
err = LockErrorTokenMismatch
|
||||||
|
return oldValue, false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if token == "" {
|
||||||
|
// new lock
|
||||||
|
renewToken = uuid.New().String()
|
||||||
|
return &Lock{Token: renewToken, ExpiredAtNs: expiredAtNs}, false
|
||||||
|
} else {
|
||||||
|
err = LockErrorNonEmptyTokenOnNewLock
|
||||||
|
return nil, false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (lm *LockManager) Unlock(path string, token string) (isUnlocked bool, err error) {
|
||||||
|
lm.locks.Compute(path, func(oldValue *Lock, loaded bool) (newValue *Lock, delete bool) {
|
||||||
|
if oldValue != nil {
|
||||||
|
now := time.Now()
|
||||||
|
if oldValue.ExpiredAtNs > 0 && oldValue.ExpiredAtNs < now.UnixNano() {
|
||||||
|
// lock is expired, delete it
|
||||||
|
isUnlocked = true
|
||||||
|
return nil, true
|
||||||
|
}
|
||||||
|
if oldValue.Token == token {
|
||||||
|
if oldValue.ExpiredAtNs <= now.UnixNano() {
|
||||||
|
isUnlocked = true
|
||||||
|
return nil, true
|
||||||
|
}
|
||||||
|
return oldValue, false
|
||||||
|
} else {
|
||||||
|
isUnlocked = false
|
||||||
|
err = UnlockErrorTokenMismatch
|
||||||
|
return oldValue, false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
isUnlocked = true
|
||||||
|
return nil, true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (lm *LockManager) CleanUp() {
|
||||||
|
for {
|
||||||
|
time.Sleep(1 * time.Minute)
|
||||||
|
now := time.Now().UnixNano()
|
||||||
|
lm.locks.Range(func(key string, value *Lock) bool {
|
||||||
|
if value == nil {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if now > value.ExpiredAtNs {
|
||||||
|
lm.locks.Delete(key)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// SelectLocks takes out locks by key
|
||||||
|
// if keyFn return true, the lock will be taken out
|
||||||
|
func (lm *LockManager) SelectLocks(selectFn func(key string) bool) (locks []*Lock) {
|
||||||
|
now := time.Now().UnixNano()
|
||||||
|
lm.locks.Range(func(key string, lock *Lock) bool {
|
||||||
|
if now > lock.ExpiredAtNs {
|
||||||
|
lm.locks.Delete(key)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if selectFn(key) {
|
||||||
|
lm.locks.Delete(key)
|
||||||
|
lock.Key = key
|
||||||
|
locks = append(locks, lock)
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// InsertLock inserts a lock unconditionally
|
||||||
|
func (lm *LockManager) InsertLock(path string, expiredAtNs int64, token string) {
|
||||||
|
lm.locks.Store(path, &Lock{Token: token, ExpiredAtNs: expiredAtNs})
|
||||||
|
}
|
||||||
@@ -0,0 +1,174 @@
|
|||||||
|
package lock_manager
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/seaweedfs/seaweedfs/weed/pb"
|
||||||
|
"github.com/seaweedfs/seaweedfs/weed/util"
|
||||||
|
"sort"
|
||||||
|
"sync"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
type LockRingSnapshot struct {
|
||||||
|
servers []pb.ServerAddress
|
||||||
|
ts time.Time
|
||||||
|
}
|
||||||
|
|
||||||
|
type LockRing struct {
|
||||||
|
sync.RWMutex
|
||||||
|
snapshots []*LockRingSnapshot
|
||||||
|
candidateServers map[pb.ServerAddress]struct{}
|
||||||
|
lastUpdateTime time.Time
|
||||||
|
lastCompactTime time.Time
|
||||||
|
snapshotInterval time.Duration
|
||||||
|
onTakeSnapshot func(snapshot []pb.ServerAddress)
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewLockRing(snapshotInterval time.Duration) *LockRing {
|
||||||
|
return &LockRing{
|
||||||
|
snapshotInterval: snapshotInterval,
|
||||||
|
candidateServers: make(map[pb.ServerAddress]struct{}),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *LockRing) SetTakeSnapshotCallback(onTakeSnapshot func(snapshot []pb.ServerAddress)) {
|
||||||
|
r.Lock()
|
||||||
|
defer r.Unlock()
|
||||||
|
r.onTakeSnapshot = onTakeSnapshot
|
||||||
|
}
|
||||||
|
|
||||||
|
// AddServer adds a server to the ring
|
||||||
|
// if the previous snapshot passed the snapshot interval, create a new snapshot
|
||||||
|
func (r *LockRing) AddServer(server pb.ServerAddress) {
|
||||||
|
r.Lock()
|
||||||
|
|
||||||
|
if _, found := r.candidateServers[server]; found {
|
||||||
|
r.Unlock()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r.lastUpdateTime = time.Now()
|
||||||
|
r.candidateServers[server] = struct{}{}
|
||||||
|
r.Unlock()
|
||||||
|
|
||||||
|
r.takeSnapshotWithDelayedCompaction()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *LockRing) RemoveServer(server pb.ServerAddress) {
|
||||||
|
r.Lock()
|
||||||
|
|
||||||
|
if _, found := r.candidateServers[server]; !found {
|
||||||
|
r.Unlock()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r.lastUpdateTime = time.Now()
|
||||||
|
delete(r.candidateServers, server)
|
||||||
|
r.Unlock()
|
||||||
|
|
||||||
|
r.takeSnapshotWithDelayedCompaction()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *LockRing) SetSnapshot(servers []pb.ServerAddress) {
|
||||||
|
|
||||||
|
sort.Slice(servers, func(i, j int) bool {
|
||||||
|
return servers[i] < servers[j]
|
||||||
|
})
|
||||||
|
|
||||||
|
r.lastUpdateTime = time.Now()
|
||||||
|
|
||||||
|
r.addOneSnapshot(servers)
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
<-time.After(r.snapshotInterval)
|
||||||
|
r.compactSnapshots()
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *LockRing) takeSnapshotWithDelayedCompaction() {
|
||||||
|
r.doTakeSnapshot()
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
<-time.After(r.snapshotInterval)
|
||||||
|
r.compactSnapshots()
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *LockRing) doTakeSnapshot() {
|
||||||
|
servers := r.getSortedServers()
|
||||||
|
|
||||||
|
r.addOneSnapshot(servers)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *LockRing) addOneSnapshot(servers []pb.ServerAddress) {
|
||||||
|
r.Lock()
|
||||||
|
defer r.Unlock()
|
||||||
|
|
||||||
|
ts := time.Now()
|
||||||
|
t := &LockRingSnapshot{
|
||||||
|
servers: servers,
|
||||||
|
ts: ts,
|
||||||
|
}
|
||||||
|
r.snapshots = append(r.snapshots, t)
|
||||||
|
for i := len(r.snapshots) - 2; i >= 0; i-- {
|
||||||
|
r.snapshots[i+1] = r.snapshots[i]
|
||||||
|
}
|
||||||
|
r.snapshots[0] = t
|
||||||
|
|
||||||
|
if r.onTakeSnapshot != nil {
|
||||||
|
r.onTakeSnapshot(t.servers)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *LockRing) compactSnapshots() {
|
||||||
|
r.Lock()
|
||||||
|
defer r.Unlock()
|
||||||
|
|
||||||
|
if r.lastCompactTime.After(r.lastUpdateTime) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
ts := time.Now()
|
||||||
|
// remove old snapshots
|
||||||
|
recentSnapshotIndex := 1
|
||||||
|
for ; recentSnapshotIndex < len(r.snapshots); recentSnapshotIndex++ {
|
||||||
|
if ts.Sub(r.snapshots[recentSnapshotIndex].ts) > r.snapshotInterval {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// keep the one that has been running for a while
|
||||||
|
if recentSnapshotIndex+1 <= len(r.snapshots) {
|
||||||
|
r.snapshots = r.snapshots[:recentSnapshotIndex+1]
|
||||||
|
}
|
||||||
|
r.lastCompactTime = ts
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *LockRing) getSortedServers() []pb.ServerAddress {
|
||||||
|
sortedServers := make([]pb.ServerAddress, 0, len(r.candidateServers))
|
||||||
|
for server := range r.candidateServers {
|
||||||
|
sortedServers = append(sortedServers, server)
|
||||||
|
}
|
||||||
|
sort.Slice(sortedServers, func(i, j int) bool {
|
||||||
|
return sortedServers[i] < sortedServers[j]
|
||||||
|
})
|
||||||
|
return sortedServers
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *LockRing) GetSnapshot() (servers []pb.ServerAddress) {
|
||||||
|
r.RLock()
|
||||||
|
defer r.RUnlock()
|
||||||
|
|
||||||
|
if len(r.snapshots) == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return r.snapshots[0].servers
|
||||||
|
}
|
||||||
|
|
||||||
|
func hashKeyToServer(key string, servers []pb.ServerAddress) pb.ServerAddress {
|
||||||
|
if len(servers) == 0 {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
x := util.HashStringToLong(key)
|
||||||
|
if x < 0 {
|
||||||
|
x = -x
|
||||||
|
}
|
||||||
|
x = x % int64(len(servers))
|
||||||
|
return servers[x]
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package lock_manager
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/seaweedfs/seaweedfs/weed/pb"
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
|
"testing"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestAddServer(t *testing.T) {
|
||||||
|
r := NewLockRing(100 * time.Millisecond)
|
||||||
|
r.AddServer("localhost:8080")
|
||||||
|
assert.Equal(t, 1, len(r.snapshots))
|
||||||
|
r.AddServer("localhost:8081")
|
||||||
|
r.AddServer("localhost:8082")
|
||||||
|
r.AddServer("localhost:8083")
|
||||||
|
r.AddServer("localhost:8084")
|
||||||
|
r.RemoveServer("localhost:8084")
|
||||||
|
r.RemoveServer("localhost:8082")
|
||||||
|
r.RemoveServer("localhost:8080")
|
||||||
|
|
||||||
|
assert.Equal(t, 8, len(r.snapshots))
|
||||||
|
|
||||||
|
time.Sleep(110 * time.Millisecond)
|
||||||
|
|
||||||
|
assert.Equal(t, 2, len(r.snapshots))
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestLockRing(t *testing.T) {
|
||||||
|
r := NewLockRing(100 * time.Millisecond)
|
||||||
|
r.SetSnapshot([]pb.ServerAddress{"localhost:8080", "localhost:8081"})
|
||||||
|
assert.Equal(t, 1, len(r.snapshots))
|
||||||
|
r.SetSnapshot([]pb.ServerAddress{"localhost:8080", "localhost:8081", "localhost:8082"})
|
||||||
|
assert.Equal(t, 2, len(r.snapshots))
|
||||||
|
time.Sleep(110 * time.Millisecond)
|
||||||
|
r.SetSnapshot([]pb.ServerAddress{"localhost:8080", "localhost:8081", "localhost:8082", "localhost:8083"})
|
||||||
|
assert.Equal(t, 3, len(r.snapshots))
|
||||||
|
time.Sleep(110 * time.Millisecond)
|
||||||
|
assert.Equal(t, 2, len(r.snapshots))
|
||||||
|
r.SetSnapshot([]pb.ServerAddress{"localhost:8080", "localhost:8081", "localhost:8082", "localhost:8083", "localhost:8084"})
|
||||||
|
assert.Equal(t, 3, len(r.snapshots))
|
||||||
|
}
|
||||||
@@ -22,7 +22,6 @@ func ListExistingPeerUpdates(master pb.ServerAddress, grpcDialOption grpc.DialOp
|
|||||||
existingNodes = append(existingNodes, &master_pb.ClusterNodeUpdate{
|
existingNodes = append(existingNodes, &master_pb.ClusterNodeUpdate{
|
||||||
NodeType: FilerType,
|
NodeType: FilerType,
|
||||||
Address: node.Address,
|
Address: node.Address,
|
||||||
IsLeader: node.IsLeader,
|
|
||||||
IsAdd: true,
|
IsAdd: true,
|
||||||
CreatedAtNs: node.CreatedAtNs,
|
CreatedAtNs: node.CreatedAtNs,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ func runBackup(cmd *Command, args []string) bool {
|
|||||||
|
|
||||||
if datSize > stats.TailOffset {
|
if datSize > stats.TailOffset {
|
||||||
// remove the old data
|
// remove the old data
|
||||||
v.Destroy()
|
v.Destroy(false)
|
||||||
// recreate an empty volume
|
// recreate an empty volume
|
||||||
v, err = storage.NewVolume(util.ResolvePath(*s.dir), util.ResolvePath(*s.dir), *s.collection, vid, storage.NeedleMapInMemory, replication, ttl, 0, 0, 0)
|
v, err = storage.NewVolume(util.ResolvePath(*s.dir), util.ResolvePath(*s.dir), *s.collection, vid, storage.NeedleMapInMemory, replication, ttl, 0, 0, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ type FilerOptions struct {
|
|||||||
localSocket *string
|
localSocket *string
|
||||||
showUIDirectoryDelete *bool
|
showUIDirectoryDelete *bool
|
||||||
downloadMaxMBps *int
|
downloadMaxMBps *int
|
||||||
|
diskType *string
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -89,10 +90,12 @@ func init() {
|
|||||||
f.localSocket = cmdFiler.Flag.String("localSocket", "", "default to /tmp/seaweedfs-filer-<port>.sock")
|
f.localSocket = cmdFiler.Flag.String("localSocket", "", "default to /tmp/seaweedfs-filer-<port>.sock")
|
||||||
f.showUIDirectoryDelete = cmdFiler.Flag.Bool("ui.deleteDir", true, "enable filer UI show delete directory button")
|
f.showUIDirectoryDelete = cmdFiler.Flag.Bool("ui.deleteDir", true, "enable filer UI show delete directory button")
|
||||||
f.downloadMaxMBps = cmdFiler.Flag.Int("downloadMaxMBps", 0, "download max speed for each download request, in MB per second")
|
f.downloadMaxMBps = cmdFiler.Flag.Int("downloadMaxMBps", 0, "download max speed for each download request, in MB per second")
|
||||||
|
f.diskType = cmdFiler.Flag.String("disk", "", "[hdd|ssd|<tag>] hard drive or solid state drive or any tag")
|
||||||
|
|
||||||
// start s3 on filer
|
// start s3 on filer
|
||||||
filerStartS3 = cmdFiler.Flag.Bool("s3", false, "whether to start S3 gateway")
|
filerStartS3 = cmdFiler.Flag.Bool("s3", false, "whether to start S3 gateway")
|
||||||
filerS3Options.port = cmdFiler.Flag.Int("s3.port", 8333, "s3 server http listen port")
|
filerS3Options.port = cmdFiler.Flag.Int("s3.port", 8333, "s3 server http listen port")
|
||||||
|
filerS3Options.portHttps = cmdFiler.Flag.Int("s3.port.https", 0, "s3 server https listen port")
|
||||||
filerS3Options.portGrpc = cmdFiler.Flag.Int("s3.port.grpc", 0, "s3 server grpc listen port")
|
filerS3Options.portGrpc = cmdFiler.Flag.Int("s3.port.grpc", 0, "s3 server grpc listen port")
|
||||||
filerS3Options.domainName = cmdFiler.Flag.String("s3.domainName", "", "suffix of the host name in comma separated list, {bucket}.{domainName}")
|
filerS3Options.domainName = cmdFiler.Flag.String("s3.domainName", "", "suffix of the host name in comma separated list, {bucket}.{domainName}")
|
||||||
filerS3Options.dataCenter = cmdFiler.Flag.String("s3.dataCenter", "", "prefer to read and write to volumes in this data center")
|
filerS3Options.dataCenter = cmdFiler.Flag.String("s3.dataCenter", "", "prefer to read and write to volumes in this data center")
|
||||||
@@ -113,6 +116,7 @@ func init() {
|
|||||||
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", 0, "local cache capacity in MB")
|
filerWebDavOptions.cacheSizeMB = cmdFiler.Flag.Int64("webdav.cacheCapacityMB", 0, "local cache capacity in MB")
|
||||||
|
filerWebDavOptions.filerRootPath = cmdFiler.Flag.String("webdav.filer.path", "/", "use this remote path from filer server")
|
||||||
|
|
||||||
// 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")
|
||||||
@@ -182,6 +186,11 @@ func runFiler(cmd *Command, args []string) bool {
|
|||||||
|
|
||||||
if *filerStartWebDav {
|
if *filerStartWebDav {
|
||||||
filerWebDavOptions.filer = &filerAddress
|
filerWebDavOptions.filer = &filerAddress
|
||||||
|
|
||||||
|
if *filerWebDavOptions.disk == "" {
|
||||||
|
filerWebDavOptions.disk = f.diskType
|
||||||
|
}
|
||||||
|
|
||||||
go func(delay time.Duration) {
|
go func(delay time.Duration) {
|
||||||
time.Sleep(delay * time.Second)
|
time.Sleep(delay * time.Second)
|
||||||
filerWebDavOptions.startWebDav()
|
filerWebDavOptions.startWebDav()
|
||||||
@@ -242,6 +251,7 @@ func (fo *FilerOptions) startFiler() {
|
|||||||
ConcurrentUploadLimit: int64(*fo.concurrentUploadLimitMB) * 1024 * 1024,
|
ConcurrentUploadLimit: int64(*fo.concurrentUploadLimitMB) * 1024 * 1024,
|
||||||
ShowUIDirectoryDelete: *fo.showUIDirectoryDelete,
|
ShowUIDirectoryDelete: *fo.showUIDirectoryDelete,
|
||||||
DownloadMaxBytesPs: int64(*fo.downloadMaxMBps) * 1024 * 1024,
|
DownloadMaxBytesPs: int64(*fo.downloadMaxMBps) * 1024 * 1024,
|
||||||
|
DiskType: *fo.diskType,
|
||||||
})
|
})
|
||||||
if nfs_err != nil {
|
if nfs_err != nil {
|
||||||
glog.Fatalf("Filer startup error: %v", nfs_err)
|
glog.Fatalf("Filer startup error: %v", nfs_err)
|
||||||
|
|||||||
@@ -138,6 +138,19 @@ func doFilerBackup(grpcDialOption grpc.DialOption, backupOption *FilerBackupOpti
|
|||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
return pb.FollowMetadata(sourceFiler, grpcDialOption, "backup_"+dataSink.GetName(), clientId, clientEpoch, sourcePath, nil, startFrom.UnixNano(), 0, 0, processEventFnWithOffset, pb.TrivialOnError)
|
metadataFollowOption := &pb.MetadataFollowOption{
|
||||||
|
ClientName: "backup_" + dataSink.GetName(),
|
||||||
|
ClientId: clientId,
|
||||||
|
ClientEpoch: clientEpoch,
|
||||||
|
SelfSignature: 0,
|
||||||
|
PathPrefix: sourcePath,
|
||||||
|
AdditionalPathPrefixes: nil,
|
||||||
|
DirectoriesToWatch: nil,
|
||||||
|
StartTsNs: startFrom.UnixNano(),
|
||||||
|
StopTsNs: 0,
|
||||||
|
EventErrorType: pb.TrivialOnError,
|
||||||
|
}
|
||||||
|
|
||||||
|
return pb.FollowMetadata(sourceFiler, grpcDialOption, metadataFollowOption, processEventFnWithOffset)
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -96,7 +96,7 @@ func runFilerCat(cmd *Command, args []string) bool {
|
|||||||
writer = f
|
writer = f
|
||||||
}
|
}
|
||||||
|
|
||||||
pb.WithFilerClient(false, filerCat.filerAddress, filerCat.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
pb.WithFilerClient(false, util.RandomInt32(), filerCat.filerAddress, filerCat.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||||
|
|
||||||
request := &filer_pb.LookupDirectoryEntryRequest{
|
request := &filer_pb.LookupDirectoryEntryRequest{
|
||||||
Name: name,
|
Name: name,
|
||||||
|
|||||||
@@ -159,6 +159,7 @@ func runCopy(cmd *Command, args []string) bool {
|
|||||||
worker := FileCopyWorker{
|
worker := FileCopyWorker{
|
||||||
options: ©,
|
options: ©,
|
||||||
filerAddress: filerAddress,
|
filerAddress: filerAddress,
|
||||||
|
signature: util.RandomInt32(),
|
||||||
}
|
}
|
||||||
if err := worker.copyFiles(fileCopyTaskChan); err != nil {
|
if err := worker.copyFiles(fileCopyTaskChan); err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "copy file error: %v\n", err)
|
fmt.Fprintf(os.Stderr, "copy file error: %v\n", err)
|
||||||
@@ -172,7 +173,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(false, filerGrpcAddress, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
err = pb.WithGrpcFilerClient(false, 0, 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)
|
||||||
@@ -225,6 +226,7 @@ func genFileCopyTask(fileOrDir string, destPath string, fileCopyTaskChan chan Fi
|
|||||||
type FileCopyWorker struct {
|
type FileCopyWorker struct {
|
||||||
options *CopyOptions
|
options *CopyOptions
|
||||||
filerAddress pb.ServerAddress
|
filerAddress pb.ServerAddress
|
||||||
|
signature int32
|
||||||
}
|
}
|
||||||
|
|
||||||
func (worker *FileCopyWorker) copyFiles(fileCopyTaskChan chan FileCopyTask) error {
|
func (worker *FileCopyWorker) copyFiles(fileCopyTaskChan chan FileCopyTask) error {
|
||||||
@@ -302,7 +304,7 @@ func (worker *FileCopyWorker) checkExistingFileFirst(task FileCopyTask, f *os.Fi
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
err = pb.WithGrpcFilerClient(false, worker.filerAddress, worker.options.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
err = pb.WithGrpcFilerClient(false, worker.signature, 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,
|
||||||
@@ -365,10 +367,10 @@ func (worker *FileCopyWorker) uploadFileAsOne(task FileCopyTask, f *os.File) err
|
|||||||
if flushErr != nil {
|
if flushErr != nil {
|
||||||
return flushErr
|
return flushErr
|
||||||
}
|
}
|
||||||
chunks = append(chunks, uploadResult.ToPbFileChunk(finalFileId, 0))
|
chunks = append(chunks, uploadResult.ToPbFileChunk(finalFileId, 0, time.Now().UnixNano()))
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := pb.WithGrpcFilerClient(false, worker.filerAddress, worker.options.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
if err := pb.WithGrpcFilerClient(false, worker.signature, 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{
|
||||||
@@ -450,7 +452,7 @@ func (worker *FileCopyWorker) uploadFileInChunks(task FileCopyTask, f *os.File,
|
|||||||
uploadError = fmt.Errorf("upload %v result: %v\n", fileName, uploadResult.Error)
|
uploadError = fmt.Errorf("upload %v result: %v\n", fileName, uploadResult.Error)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
chunksChan <- uploadResult.ToPbFileChunk(fileId, i*chunkSize)
|
chunksChan <- uploadResult.ToPbFileChunk(fileId, i*chunkSize, time.Now().UnixNano())
|
||||||
|
|
||||||
fmt.Printf("uploaded %s-%d [%d,%d)\n", fileName, i+1, i*chunkSize, i*chunkSize+int64(uploadResult.Size))
|
fmt.Printf("uploaded %s-%d [%d,%d)\n", fileName, i+1, i*chunkSize, i*chunkSize+int64(uploadResult.Size))
|
||||||
}(i)
|
}(i)
|
||||||
@@ -479,7 +481,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(false, worker.filerAddress, worker.options.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
if err := pb.WithGrpcFilerClient(false, worker.signature, 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{
|
||||||
@@ -530,7 +532,7 @@ func detectMimeType(f *os.File) string {
|
|||||||
return mimeType
|
return mimeType
|
||||||
}
|
}
|
||||||
|
|
||||||
func (worker *FileCopyWorker) saveDataAsChunk(reader io.Reader, name string, offset int64) (chunk *filer_pb.FileChunk, err error) {
|
func (worker *FileCopyWorker) saveDataAsChunk(reader io.Reader, name string, offset int64, tsNs int64) (chunk *filer_pb.FileChunk, err error) {
|
||||||
|
|
||||||
finalFileId, uploadResult, flushErr, _ := operation.UploadWithRetry(
|
finalFileId, uploadResult, flushErr, _ := operation.UploadWithRetry(
|
||||||
worker,
|
worker,
|
||||||
@@ -561,7 +563,7 @@ func (worker *FileCopyWorker) saveDataAsChunk(reader io.Reader, name string, off
|
|||||||
if uploadResult.Error != "" {
|
if uploadResult.Error != "" {
|
||||||
return nil, fmt.Errorf("upload result: %v", uploadResult.Error)
|
return nil, fmt.Errorf("upload result: %v", uploadResult.Error)
|
||||||
}
|
}
|
||||||
return uploadResult.ToPbFileChunk(finalFileId, offset), nil
|
return uploadResult.ToPbFileChunk(finalFileId, offset, tsNs), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ = filer_pb.FilerClient(&FileCopyWorker{})
|
var _ = filer_pb.FilerClient(&FileCopyWorker{})
|
||||||
@@ -569,7 +571,7 @@ var _ = filer_pb.FilerClient(&FileCopyWorker{})
|
|||||||
func (worker *FileCopyWorker) WithFilerClient(streamingMode bool, fn func(filer_pb.SeaweedFilerClient) error) (err error) {
|
func (worker *FileCopyWorker) WithFilerClient(streamingMode bool, fn func(filer_pb.SeaweedFilerClient) error) (err error) {
|
||||||
|
|
||||||
filerGrpcAddress := worker.filerAddress.ToGrpcAddress()
|
filerGrpcAddress := worker.filerAddress.ToGrpcAddress()
|
||||||
err = pb.WithGrpcClient(streamingMode, func(grpcConnection *grpc.ClientConn) error {
|
err = pb.WithGrpcClient(streamingMode, worker.signature, func(grpcConnection *grpc.ClientConn) error {
|
||||||
client := filer_pb.NewSeaweedFilerClient(grpcConnection)
|
client := filer_pb.NewSeaweedFilerClient(grpcConnection)
|
||||||
return fn(client)
|
return fn(client)
|
||||||
}, filerGrpcAddress, false, worker.options.grpcDialOption)
|
}, filerGrpcAddress, false, worker.options.grpcDialOption)
|
||||||
|
|||||||
@@ -196,8 +196,21 @@ func (metaBackup *FilerMetaBackupOptions) streamMetadataBackup() error {
|
|||||||
})
|
})
|
||||||
|
|
||||||
metaBackup.clientEpoch++
|
metaBackup.clientEpoch++
|
||||||
return pb.FollowMetadata(pb.ServerAddress(*metaBackup.filerAddress), metaBackup.grpcDialOption, "meta_backup", metaBackup.clientId, metaBackup.clientEpoch,
|
|
||||||
*metaBackup.filerDirectory, nil, startTime.UnixNano(), 0, 0, processEventFnWithOffset, pb.TrivialOnError)
|
metadataFollowOption := &pb.MetadataFollowOption{
|
||||||
|
ClientName: "meta_backup",
|
||||||
|
ClientId: metaBackup.clientId,
|
||||||
|
ClientEpoch: metaBackup.clientEpoch,
|
||||||
|
SelfSignature: 0,
|
||||||
|
PathPrefix: *metaBackup.filerDirectory,
|
||||||
|
AdditionalPathPrefixes: nil,
|
||||||
|
DirectoriesToWatch: nil,
|
||||||
|
StartTsNs: startTime.UnixNano(),
|
||||||
|
StopTsNs: 0,
|
||||||
|
EventErrorType: pb.TrivialOnError,
|
||||||
|
}
|
||||||
|
|
||||||
|
return pb.FollowMetadata(pb.ServerAddress(*metaBackup.filerAddress), metaBackup.grpcDialOption, metadataFollowOption, processEventFnWithOffset)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,7 +238,7 @@ var _ = filer_pb.FilerClient(&FilerMetaBackupOptions{})
|
|||||||
|
|
||||||
func (metaBackup *FilerMetaBackupOptions) WithFilerClient(streamingMode bool, fn func(filer_pb.SeaweedFilerClient) error) error {
|
func (metaBackup *FilerMetaBackupOptions) WithFilerClient(streamingMode bool, fn func(filer_pb.SeaweedFilerClient) error) error {
|
||||||
|
|
||||||
return pb.WithFilerClient(streamingMode, pb.ServerAddress(*metaBackup.filerAddress), metaBackup.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
return pb.WithFilerClient(streamingMode, metaBackup.clientId, pb.ServerAddress(*metaBackup.filerAddress), metaBackup.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||||
return fn(client)
|
return fn(client)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -107,16 +107,28 @@ func runFilerMetaTail(cmd *Command, args []string) bool {
|
|||||||
untilTsNs = time.Now().Add(-*tailStop).UnixNano()
|
untilTsNs = time.Now().Add(-*tailStop).UnixNano()
|
||||||
}
|
}
|
||||||
|
|
||||||
tailErr := pb.FollowMetadata(pb.ServerAddress(*tailFiler), grpcDialOption, "tail", clientId, 0, *tailTarget, nil,
|
metadataFollowOption := &pb.MetadataFollowOption{
|
||||||
time.Now().Add(-*tailStart).UnixNano(), untilTsNs, 0, func(resp *filer_pb.SubscribeMetadataResponse) error {
|
ClientName: "tail",
|
||||||
if !shouldPrint(resp) {
|
ClientId: clientId,
|
||||||
return nil
|
ClientEpoch: 0,
|
||||||
}
|
SelfSignature: 0,
|
||||||
if err := eachEntryFunc(resp); err != nil {
|
PathPrefix: *tailTarget,
|
||||||
return err
|
AdditionalPathPrefixes: nil,
|
||||||
}
|
DirectoriesToWatch: nil,
|
||||||
|
StartTsNs: time.Now().Add(-*tailStart).UnixNano(),
|
||||||
|
StopTsNs: untilTsNs,
|
||||||
|
EventErrorType: pb.TrivialOnError,
|
||||||
|
}
|
||||||
|
|
||||||
|
tailErr := pb.FollowMetadata(pb.ServerAddress(*tailFiler), grpcDialOption, metadataFollowOption, func(resp *filer_pb.SubscribeMetadataResponse) error {
|
||||||
|
if !shouldPrint(resp) {
|
||||||
return nil
|
return nil
|
||||||
}, pb.TrivialOnError)
|
}
|
||||||
|
if err := eachEntryFunc(resp); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
|
||||||
if tailErr != nil {
|
if tailErr != nil {
|
||||||
fmt.Printf("tail %s: %v\n", *tailFiler, tailErr)
|
fmt.Printf("tail %s: %v\n", *tailFiler, tailErr)
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ type RemoteGatewayOptions struct {
|
|||||||
var _ = filer_pb.FilerClient(&RemoteGatewayOptions{})
|
var _ = filer_pb.FilerClient(&RemoteGatewayOptions{})
|
||||||
|
|
||||||
func (option *RemoteGatewayOptions) WithFilerClient(streamingMode bool, fn func(filer_pb.SeaweedFilerClient) error) error {
|
func (option *RemoteGatewayOptions) WithFilerClient(streamingMode bool, fn func(filer_pb.SeaweedFilerClient) error) error {
|
||||||
return pb.WithFilerClient(streamingMode, pb.ServerAddress(*option.filerAddress), option.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
return pb.WithFilerClient(streamingMode, option.clientId, pb.ServerAddress(*option.filerAddress), option.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||||
return fn(client)
|
return fn(client)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,8 +39,21 @@ 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)
|
||||||
|
|
||||||
option.clientEpoch++
|
option.clientEpoch++
|
||||||
return pb.FollowMetadata(pb.ServerAddress(*option.filerAddress), option.grpcDialOption, "filer.remote.sync", option.clientId, option.clientEpoch,
|
|
||||||
option.bucketsDir, []string{filer.DirectoryEtcRemote}, lastOffsetTs.UnixNano(), 0, 0, processEventFnWithOffset, pb.TrivialOnError)
|
metadataFollowOption := &pb.MetadataFollowOption{
|
||||||
|
ClientName: "filer.remote.sync",
|
||||||
|
ClientId: option.clientId,
|
||||||
|
ClientEpoch: option.clientEpoch,
|
||||||
|
SelfSignature: 0,
|
||||||
|
PathPrefix: option.bucketsDir,
|
||||||
|
AdditionalPathPrefixes: []string{filer.DirectoryEtcRemote},
|
||||||
|
DirectoriesToWatch: nil,
|
||||||
|
StartTsNs: lastOffsetTs.UnixNano(),
|
||||||
|
StopTsNs: 0,
|
||||||
|
EventErrorType: pb.TrivialOnError,
|
||||||
|
}
|
||||||
|
|
||||||
|
return pb.FollowMetadata(pb.ServerAddress(*option.filerAddress), option.grpcDialOption, metadataFollowOption, processEventFnWithOffset)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (option *RemoteGatewayOptions) makeBucketedEventProcessor(filerSource *source.FilerSource) (pb.ProcessMetadataFunc, error) {
|
func (option *RemoteGatewayOptions) makeBucketedEventProcessor(filerSource *source.FilerSource) (pb.ProcessMetadataFunc, error) {
|
||||||
@@ -372,6 +385,9 @@ func extractBucketPath(bucketsDir, dir string) (util.FullPath, bool) {
|
|||||||
func (option *RemoteGatewayOptions) collectRemoteStorageConf() (err error) {
|
func (option *RemoteGatewayOptions) collectRemoteStorageConf() (err error) {
|
||||||
|
|
||||||
if mappings, err := filer.ReadMountMappings(option.grpcDialOption, pb.ServerAddress(*option.filerAddress)); err != nil {
|
if mappings, err := filer.ReadMountMappings(option.grpcDialOption, pb.ServerAddress(*option.filerAddress)); err != nil {
|
||||||
|
if err == filer_pb.ErrNotFound {
|
||||||
|
return fmt.Errorf("remote storage is not configured in filer server")
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
} else {
|
} else {
|
||||||
option.mappings = mappings
|
option.mappings = mappings
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ type RemoteSyncOptions struct {
|
|||||||
var _ = filer_pb.FilerClient(&RemoteSyncOptions{})
|
var _ = filer_pb.FilerClient(&RemoteSyncOptions{})
|
||||||
|
|
||||||
func (option *RemoteSyncOptions) WithFilerClient(streamingMode bool, fn func(filer_pb.SeaweedFilerClient) error) error {
|
func (option *RemoteSyncOptions) WithFilerClient(streamingMode bool, fn func(filer_pb.SeaweedFilerClient) error) error {
|
||||||
return pb.WithFilerClient(streamingMode, pb.ServerAddress(*option.filerAddress), option.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
return pb.WithFilerClient(streamingMode, option.clientId, pb.ServerAddress(*option.filerAddress), option.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||||
return fn(client)
|
return fn(client)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,8 +63,21 @@ 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)
|
||||||
|
|
||||||
option.clientEpoch++
|
option.clientEpoch++
|
||||||
return pb.FollowMetadata(pb.ServerAddress(*option.filerAddress), option.grpcDialOption, "filer.remote.sync", option.clientId, option.clientEpoch,
|
|
||||||
mountedDir, []string{filer.DirectoryEtcRemote}, lastOffsetTs.UnixNano(), 0, 0, processEventFnWithOffset, pb.TrivialOnError)
|
metadataFollowOption := &pb.MetadataFollowOption{
|
||||||
|
ClientName: "filer.remote.sync",
|
||||||
|
ClientId: option.clientId,
|
||||||
|
ClientEpoch: option.clientEpoch,
|
||||||
|
SelfSignature: 0,
|
||||||
|
PathPrefix: mountedDir,
|
||||||
|
AdditionalPathPrefixes: []string{filer.DirectoryEtcRemote},
|
||||||
|
DirectoriesToWatch: nil,
|
||||||
|
StartTsNs: lastOffsetTs.UnixNano(),
|
||||||
|
StopTsNs: 0,
|
||||||
|
EventErrorType: pb.TrivialOnError,
|
||||||
|
}
|
||||||
|
|
||||||
|
return pb.FollowMetadata(pb.ServerAddress(*option.filerAddress), option.grpcDialOption, metadataFollowOption, processEventFnWithOffset)
|
||||||
}
|
}
|
||||||
|
|
||||||
func makeEventProcessor(remoteStorage *remote_pb.RemoteConf, mountedDir string, remoteStorageMountLocation *remote_pb.RemoteStorageLocation, filerSource *source.FilerSource) (pb.ProcessMetadataFunc, error) {
|
func makeEventProcessor(remoteStorage *remote_pb.RemoteConf, mountedDir string, remoteStorageMountLocation *remote_pb.RemoteStorageLocation, filerSource *source.FilerSource) (pb.ProcessMetadataFunc, error) {
|
||||||
|
|||||||
@@ -287,8 +287,20 @@ func doSubscribeFilerMetaChanges(clientId int32, clientEpoch int32, grpcDialOpti
|
|||||||
return setOffset(grpcDialOption, targetFiler, getSignaturePrefixByPath(sourcePath), sourceFilerSignature, processor.processedTsWatermark)
|
return setOffset(grpcDialOption, targetFiler, getSignaturePrefixByPath(sourcePath), sourceFilerSignature, processor.processedTsWatermark)
|
||||||
})
|
})
|
||||||
|
|
||||||
return pb.FollowMetadata(sourceFiler, grpcDialOption, clientName, clientId, clientEpoch,
|
metadataFollowOption := &pb.MetadataFollowOption{
|
||||||
sourcePath, nil, sourceFilerOffsetTsNs, 0, targetFilerSignature, processEventFnWithOffset, pb.RetryForeverOnError)
|
ClientName: clientName,
|
||||||
|
ClientId: clientId,
|
||||||
|
ClientEpoch: clientEpoch,
|
||||||
|
SelfSignature: targetFilerSignature,
|
||||||
|
PathPrefix: sourcePath,
|
||||||
|
AdditionalPathPrefixes: nil,
|
||||||
|
DirectoriesToWatch: nil,
|
||||||
|
StartTsNs: sourceFilerOffsetTsNs,
|
||||||
|
StopTsNs: 0,
|
||||||
|
EventErrorType: pb.RetryForeverOnError,
|
||||||
|
}
|
||||||
|
|
||||||
|
return pb.FollowMetadata(sourceFiler, grpcDialOption, metadataFollowOption, processEventFnWithOffset)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -304,7 +316,7 @@ func getSignaturePrefixByPath(path string) string {
|
|||||||
|
|
||||||
func getOffset(grpcDialOption grpc.DialOption, filer pb.ServerAddress, signaturePrefix string, signature int32) (lastOffsetTsNs int64, readErr error) {
|
func getOffset(grpcDialOption grpc.DialOption, filer pb.ServerAddress, signaturePrefix string, signature int32) (lastOffsetTsNs int64, readErr error) {
|
||||||
|
|
||||||
readErr = pb.WithFilerClient(false, filer, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
readErr = pb.WithFilerClient(false, signature, 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))
|
||||||
|
|
||||||
@@ -330,7 +342,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(false, filer, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
return pb.WithFilerClient(false, signature, 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))
|
||||||
@@ -399,7 +411,11 @@ func genProcessFunction(sourcePath string, targetPath string, excludePaths []str
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
key := buildKey(dataSink, message, targetPath, sourceNewKey, sourcePath)
|
key := buildKey(dataSink, message, targetPath, sourceNewKey, sourcePath)
|
||||||
return dataSink.CreateEntry(key, message.NewEntry, message.Signatures)
|
if err := dataSink.CreateEntry(key, message.NewEntry, message.Signatures); err != nil {
|
||||||
|
return fmt.Errorf("create entry1 : %v", err)
|
||||||
|
} else {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// this is something special?
|
// this is something special?
|
||||||
@@ -427,7 +443,11 @@ func genProcessFunction(sourcePath string, targetPath string, excludePaths []str
|
|||||||
}
|
}
|
||||||
// create the new entry
|
// create the new entry
|
||||||
newKey := buildKey(dataSink, message, targetPath, sourceNewKey, sourcePath)
|
newKey := buildKey(dataSink, message, targetPath, sourceNewKey, sourcePath)
|
||||||
return dataSink.CreateEntry(newKey, message.NewEntry, message.Signatures)
|
if err := dataSink.CreateEntry(newKey, message.NewEntry, message.Signatures); err != nil {
|
||||||
|
return fmt.Errorf("create entry2 : %v", err)
|
||||||
|
} else {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// new key is outside of the watched directory
|
// new key is outside of the watched directory
|
||||||
@@ -441,7 +461,11 @@ func genProcessFunction(sourcePath string, targetPath string, excludePaths []str
|
|||||||
if strings.HasPrefix(string(sourceNewKey), sourcePath) {
|
if strings.HasPrefix(string(sourceNewKey), sourcePath) {
|
||||||
// new key is in the watched directory
|
// new key is in the watched directory
|
||||||
key := buildKey(dataSink, message, targetPath, sourceNewKey, sourcePath)
|
key := buildKey(dataSink, message, targetPath, sourceNewKey, sourcePath)
|
||||||
return dataSink.CreateEntry(key, message.NewEntry, message.Signatures)
|
if err := dataSink.CreateEntry(key, message.NewEntry, message.Signatures); err != nil {
|
||||||
|
return fmt.Errorf("create entry3 : %v", err)
|
||||||
|
} else {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// new key is also outside of the watched directory
|
// new key is also outside of the watched directory
|
||||||
// skip
|
// skip
|
||||||
|
|||||||
+1
-1
@@ -50,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(false, filerAddress, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
err := pb.WithGrpcFilerClient(false, 0, 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)
|
||||||
|
|||||||
@@ -2,13 +2,14 @@ package command
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
hashicorpRaft "github.com/hashicorp/raft"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
hashicorpRaft "github.com/hashicorp/raft"
|
||||||
|
|
||||||
"golang.org/x/exp/slices"
|
"golang.org/x/exp/slices"
|
||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
@@ -163,11 +164,11 @@ func startMaster(masterOption MasterOptions, masterWhiteList []string) {
|
|||||||
RaftResumeState: *masterOption.raftResumeState,
|
RaftResumeState: *masterOption.raftResumeState,
|
||||||
HeartbeatInterval: *masterOption.heartbeatInterval,
|
HeartbeatInterval: *masterOption.heartbeatInterval,
|
||||||
ElectionTimeout: *masterOption.electionTimeout,
|
ElectionTimeout: *masterOption.electionTimeout,
|
||||||
RaftBootstrap: *m.raftBootstrap,
|
RaftBootstrap: *masterOption.raftBootstrap,
|
||||||
}
|
}
|
||||||
var raftServer *weed_server.RaftServer
|
var raftServer *weed_server.RaftServer
|
||||||
var err error
|
var err error
|
||||||
if *m.raftHashicorp {
|
if *masterOption.raftHashicorp {
|
||||||
if raftServer, err = weed_server.NewHashicorpRaftServer(raftServerOption); err != nil {
|
if raftServer, err = weed_server.NewHashicorpRaftServer(raftServerOption); err != nil {
|
||||||
glog.Fatalf("NewHashicorpRaftServer: %s", err)
|
glog.Fatalf("NewHashicorpRaftServer: %s", err)
|
||||||
}
|
}
|
||||||
@@ -180,7 +181,7 @@ func startMaster(masterOption MasterOptions, masterWhiteList []string) {
|
|||||||
ms.SetRaftServer(raftServer)
|
ms.SetRaftServer(raftServer)
|
||||||
r.HandleFunc("/cluster/status", raftServer.StatusHandler).Methods("GET")
|
r.HandleFunc("/cluster/status", raftServer.StatusHandler).Methods("GET")
|
||||||
r.HandleFunc("/cluster/healthz", raftServer.HealthzHandler).Methods("GET", "HEAD")
|
r.HandleFunc("/cluster/healthz", raftServer.HealthzHandler).Methods("GET", "HEAD")
|
||||||
if *m.raftHashicorp {
|
if *masterOption.raftHashicorp {
|
||||||
r.HandleFunc("/raft/stats", raftServer.StatsRaftHandler).Methods("GET")
|
r.HandleFunc("/raft/stats", raftServer.StatsRaftHandler).Methods("GET")
|
||||||
}
|
}
|
||||||
// starting grpc server
|
// starting grpc server
|
||||||
@@ -191,7 +192,7 @@ func startMaster(masterOption MasterOptions, masterWhiteList []string) {
|
|||||||
}
|
}
|
||||||
grpcS := pb.NewGrpcServer(security.LoadServerTLS(util.GetViper(), "grpc.master"))
|
grpcS := pb.NewGrpcServer(security.LoadServerTLS(util.GetViper(), "grpc.master"))
|
||||||
master_pb.RegisterSeaweedServer(grpcS, ms)
|
master_pb.RegisterSeaweedServer(grpcS, ms)
|
||||||
if *m.raftHashicorp {
|
if *masterOption.raftHashicorp {
|
||||||
raftServer.TransportManager.Register(grpcS)
|
raftServer.TransportManager.Register(grpcS)
|
||||||
} else {
|
} else {
|
||||||
protobuf.RegisterRaftServer(grpcS, raftServer)
|
protobuf.RegisterRaftServer(grpcS, raftServer)
|
||||||
@@ -204,7 +205,7 @@ func startMaster(masterOption MasterOptions, masterWhiteList []string) {
|
|||||||
go grpcS.Serve(grpcL)
|
go grpcS.Serve(grpcL)
|
||||||
|
|
||||||
timeSleep := 1500 * time.Millisecond
|
timeSleep := 1500 * time.Millisecond
|
||||||
if !*m.raftHashicorp {
|
if !*masterOption.raftHashicorp {
|
||||||
go func() {
|
go func() {
|
||||||
time.Sleep(timeSleep)
|
time.Sleep(timeSleep)
|
||||||
|
|
||||||
|
|||||||
@@ -53,9 +53,9 @@ func init() {
|
|||||||
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")
|
||||||
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", 0, "local file chunk cache capacity in MB")
|
mountOptions.cacheSizeMB = cmdMount.Flag.Int64("cacheCapacityMB", 0, "file chunk read 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")
|
||||||
|
|||||||
Loaded 100 of 320 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user