-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support migarte etcd mds and snapshot
Signed-off-by: caoxianfei1 <[email protected]>
- Loading branch information
1 parent
b1a3a4e
commit 812bc79
Showing
16 changed files
with
666 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
kind: curvefs | ||
s3.ak: curve | ||
s3.sk: Netease@2023 | ||
s3.endpoint: 10.182.26.46:19005 | ||
s3.bucket_name: curvefs | ||
container_image: quay.io/opencurve/curve/curvefs:v2.7.0-rc1_d8a1137 | ||
mdsOpt.rpcRetryOpt.addrs: 10.182.26.46:6700,10.182.26.35:6700,10.182.26.36:6700 | ||
log_dir: /home/caoxianfei/client/logs | ||
data_dir: /mnt/v27cache | ||
diskCache.fullRatio: 90 | ||
diskCache.safeRatio: 70 | ||
diskCache.trimRatio: 50 | ||
diskCache.maxUsableSpaceBytes: 10737418240 | ||
diskCache.maxFileNums: 1000000 | ||
diskCache.trimCheckIntervalSec: 5 | ||
client.loglevel: 9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Usage: | ||
# Example: | ||
# Created Date: 2023-12-15 | ||
# Author: Caoxianfei | ||
|
||
etcdctl=$1 | ||
endpoints=$2 | ||
old_name=$3 | ||
new_name=$4 | ||
new_peer_url=$5 | ||
|
||
tmplog=/tmp/_curveadm_add_etcd_ | ||
|
||
output=$(${etcdctl} --endpoints=${endpoints} member list) | ||
if [ $? -ne 0 ]; then | ||
echo "failed to list all etcd members" | ||
exit 1 | ||
fi | ||
|
||
# if member has added, then skip | ||
id=$(echo "$output" | awk -v name="$old_name" -F ', ' '$3 == name {print $1}') | ||
if [ -z "${id}" ]; then | ||
echo "EXIST" | ||
exit 0 | ||
fi | ||
|
||
${etcdctl} --endpoints=${endpoints} member add ${new_name} --peer-urls ${new_peer_url} > ${tmplog} 2>&1 | ||
if [ $? -ne 0 ]; then | ||
if cat ${tmplog} | grep -q "Peer URLs already exists"; then | ||
exit 0 | ||
else | ||
exit 1 | ||
fi | ||
fi | ||
|
||
|
||
# ${etcdctl} --endpoints=${endpoints} member remove ${id} | ||
# if [ $? -ne 0 ]; then | ||
# echo "failed to remove member ${old_name}" | ||
# exit 1 | ||
# fi | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Usage: | ||
# Example: | ||
# Created Date: 2023-12-15 | ||
# Author: Caoxianfei | ||
|
||
etcdctl=$1 | ||
endpoints=$2 | ||
old_name=$3 | ||
|
||
output=$(${etcdctl} --endpoints=${endpoints} member list) | ||
if [ $? -ne 0 ]; then | ||
echo "failed to list all etcd members" | ||
exit 1 | ||
fi | ||
|
||
id=$(echo "$output" | awk -v name="$old_name" -F ', ' '$3 == name {print $1}') | ||
# if not found the name then exit 0 | ||
if [ -z "${id}" ]; then | ||
echo "NOTEXIST" | ||
exit 0 | ||
fi | ||
|
||
${etcdctl} --endpoints=${endpoints} member remove ${id} | ||
if [ $? -ne 0 ]; then | ||
echo "failed to remove member ${old_name}" | ||
exit 1 | ||
fi | ||
|
||
|
||
|
||
|
Oops, something went wrong.