From 86c8f59deb8c5c1c2aa38fdc9c6503f97189e026 Mon Sep 17 00:00:00 2001 From: M-S-A-C Date: Fri, 4 Oct 2024 22:31:54 +0530 Subject: [PATCH 1/3] added cache setup to zs3server --- blimp.sh | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/blimp.sh b/blimp.sh index 1d61caf..1481065 100644 --- a/blimp.sh +++ b/blimp.sh @@ -18,7 +18,7 @@ WALLET_ID=0chainwalletid WALLET_PUBLIC_KEY=0chainwalletpublickey WALLET_PRIVATE_KEY=0chainwalletprivatekey WALLET_MNEMONICS=0chainmnemonics -DOCKER_IMAGE=v1.17.1 +DOCKER_IMAGE=v1.17.2 IS_ENTERPRISE=isenterprise EDOCKER_IMAGE=v1.17.1 @@ -50,6 +50,10 @@ docker-compose --version curl -L https://github.com/0chain/zboxcli/releases/download/v1.4.4/zbox-linux.tar.gz -o /tmp/zbox-linux.tar.gz sudo tar -xvf /tmp/zbox-linux.tar.gz -C /usr/local/bin +echo "download yaml query" +sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 +sudo chmod a+x /usr/local/bin/yq + # create config dir mkdir -p ${CONFIG_DIR} mkdir -p ${CONFIG_DIR_BLIMP} @@ -107,7 +111,8 @@ cat <${CONFIG_DIR_BLIMP}/zs3server.json "compress": false, "max_batch_size": 100, "batch_wait_time": 500, - "batch_workers": 5 + "batch_workers": 5, + "max_concurrent_requests": 300 } EOF @@ -236,6 +241,27 @@ volumes: EOF +sudo umount -l ${CONFIG_DIR}/mnt/mcache || true + +mkdir -p ${CONFIG_DIR}/mcache +truncate -s 1G ${CONFIG_DIR}/mcache/data +mkdir -p ${CONFIG_DIR}/mnt/mcache +rm -rf ${CONFIG_DIR}/mnt/mcache/* || true +sudo mount -o relatime ${CONFIG_DIR}/mcache/data ${CONFIG_DIR}/mnt/mcache + +yq e -i '.services.minioserver.environment.MINIO_CACHE_DRIVES = "/mcache"' ${CONFIG_DIR}/docker-compose.yml +yq e -i '.services.minioserver.environment.MINIO_CACHE_EXPIRY = 90' ${CONFIG_DIR}/docker-compose.yml +yq e -i '.services.minioserver.environment.MINIO_CACHE_COMMIT = "writeback"' ${CONFIG_DIR}/docker-compose.yml +yq e -i '.services.minioserver.environment.MINIO_CACHE_QUOTA = 99' ${CONFIG_DIR}/docker-compose.yml +yq e -i '.services.minioserver.environment.MINIO_CACHE_WATERMARK_LOW = 90' ${CONFIG_DIR}/docker-compose.yml +yq e -i '.services.minioserver.environment.MINIO_CACHE_WATERMARK_HIGH = 95' ${CONFIG_DIR}/docker-compose.yml +yq e -i '.services.minioserver.environment.MINIO_WRITE_BACK_INTERVAL = 900' ${CONFIG_DIR}/docker-compose.yml +yq e -i '.services.minioserver.environment.MINIO_MAX_CACHE_FILE_SIZE = 1073741824' ${CONFIG_DIR}/docker-compose.yml +yq e -i '.services.minioserver.environment.MINIO_WRITE_BACK_UPLOAD_WORKERS = 50' ${CONFIG_DIR}/docker-compose.yml +yq e -i '.services.minioserver.environment.MINIO_UPLOAD_QUEUE_TH = 10' ${CONFIG_DIR}/docker-compose.yml + +yq eval '.services.minioserver.volumes += ["./mnt/mcache:/mcache"]' -i ${CONFIG_DIR}/docker-compose.yml + if [ "$IS_ENTERPRISE" = true ]; then sed -i "s/blimp-logsearchapi:${DOCKER_IMAGE}/blimp-logsearchapi:${EDOCKER_IMAGE}/g" ${CONFIG_DIR}/docker-compose.yml sed -i "s/blimp-minioserver:${DOCKER_IMAGE}/blimp-minioserver:${EDOCKER_IMAGE}/g" ${CONFIG_DIR}/docker-compose.yml From 3421e37d35738e9964f717e4863a9b199bb2ec66 Mon Sep 17 00:00:00 2001 From: M-S-A-C Date: Wed, 9 Oct 2024 09:46:03 +0530 Subject: [PATCH 2/3] fixed xfs file system --- blimp.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/blimp.sh b/blimp.sh index 1481065..56d1df2 100644 --- a/blimp.sh +++ b/blimp.sh @@ -245,6 +245,7 @@ sudo umount -l ${CONFIG_DIR}/mnt/mcache || true mkdir -p ${CONFIG_DIR}/mcache truncate -s 1G ${CONFIG_DIR}/mcache/data +mkfs.xfs ${CONFIG_DIR}/mcache/data mkdir -p ${CONFIG_DIR}/mnt/mcache rm -rf ${CONFIG_DIR}/mnt/mcache/* || true sudo mount -o relatime ${CONFIG_DIR}/mcache/data ${CONFIG_DIR}/mnt/mcache @@ -279,3 +280,5 @@ while [ ! -d ${CONFIG_DIR}/${CERTIFICATES_DIR}/${BLIMP_DOMAIN} ]; do done echo "S3 Server deployment completed." + +curl -fSsL https://github.com/0chain/zcnwebappscripts/raw/refs/heads/add/cache-zs3/blimp.sh | sed 's/0chainminiousername/Shah/; s/0chainminiopassword/Passphrase@123/; s/0chainallocationid/b43cd08eee173e7c717c14d19b90956b748bdd0d03f51a7916328f79d2e267e8/; s/0chainblockworker/https:\/\/mainnet.zus.network\/dns\//; s/0chainminiotoken/12345/; s/blimpdomain/blimp5l6ir.zus.network/; s/0chainwalletid/9edca86491e8b7de97273f6fe856fce8f63870223e6fbe52d8d976d5a422d0a8/; s/0chainwalletpublickey/0900e04f9a372a55ef2e10b7d0cdd0be724d4b21cca93bb8aab1cbf49fb88405658c8909dff31e90184a3102fbd95fb44fce91b30cce5232abe7915737f9dc13/; s/0chainwalletprivatekey/d07ec9809643ea34adc05b6545948cc7584b697ef5733581d2e2bf0869d9e019/; s/0chainmnemonics/multiply icon actor evolve canyon cotton advance absorb oblige paddle bring color mystery oppose jazz pact grain elephant ceiling laugh already taste journey evoke/ '| bash From f2d684ed2bc108eefea8164e580415f9455c4efb Mon Sep 17 00:00:00 2001 From: M-S-A-C Date: Wed, 9 Oct 2024 09:47:22 +0530 Subject: [PATCH 3/3] cleaned deploy script --- blimp.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/blimp.sh b/blimp.sh index 56d1df2..1d11ef0 100644 --- a/blimp.sh +++ b/blimp.sh @@ -279,6 +279,4 @@ while [ ! -d ${CONFIG_DIR}/${CERTIFICATES_DIR}/${BLIMP_DOMAIN} ]; do sleep 2 done -echo "S3 Server deployment completed." - -curl -fSsL https://github.com/0chain/zcnwebappscripts/raw/refs/heads/add/cache-zs3/blimp.sh | sed 's/0chainminiousername/Shah/; s/0chainminiopassword/Passphrase@123/; s/0chainallocationid/b43cd08eee173e7c717c14d19b90956b748bdd0d03f51a7916328f79d2e267e8/; s/0chainblockworker/https:\/\/mainnet.zus.network\/dns\//; s/0chainminiotoken/12345/; s/blimpdomain/blimp5l6ir.zus.network/; s/0chainwalletid/9edca86491e8b7de97273f6fe856fce8f63870223e6fbe52d8d976d5a422d0a8/; s/0chainwalletpublickey/0900e04f9a372a55ef2e10b7d0cdd0be724d4b21cca93bb8aab1cbf49fb88405658c8909dff31e90184a3102fbd95fb44fce91b30cce5232abe7915737f9dc13/; s/0chainwalletprivatekey/d07ec9809643ea34adc05b6545948cc7584b697ef5733581d2e2bf0869d9e019/; s/0chainmnemonics/multiply icon actor evolve canyon cotton advance absorb oblige paddle bring color mystery oppose jazz pact grain elephant ceiling laugh already taste journey evoke/ '| bash +echo "S3 Server deployment completed." \ No newline at end of file