Skip to content

Commit

Permalink
feat: fix healthy conditions of storaged
Browse files Browse the repository at this point in the history
fix: #116
  • Loading branch information
wey-gu committed Apr 26, 2023
1 parent 0d47bbd commit a65f648
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ services:
- metad1
- metad2
healthcheck:
test: ["CMD", "curl", "-sf", "http://storaged0:19779/status"]
# Just check process level health, please do `SHOW HOSTS` from console to check the status of storaged on cluster level
test: "cat /proc/net/tcp | awk 'function hextodec(str,ret,n,i,k,c){ret = 0;n = length(str);for (i = 1; i <= n; i++) {c = tolower(substr(str, i, 1));k = index(\"123456789abcdef\", c);ret = ret * 16 + k;}return ret;}function getIP(str,ret){ret=hextodec(substr(str,index(str,\":\")-2,2));for (i=5; i>0; i-=2) {ret = ret\".\"hextodec(substr(str,i,2));}ret = ret\":\"hextodec(substr(str,index(str,\":\")+1,4));return ret;} NR > 1 {{if(NR==2)print \"Local Listening\";local=getIP(\$2);remote=getIP(\$3)}{print local}}' | grep '0.0.0.0:9779'"
interval: 30s
timeout: 10s
retries: 3
Expand Down Expand Up @@ -160,7 +161,8 @@ services:
- metad1
- metad2
healthcheck:
test: ["CMD", "curl", "-sf", "http://storaged1:19779/status"]
# Just check process level health, please do `SHOW HOSTS` from console to check the status of storaged on cluster level
test: "cat /proc/net/tcp | awk 'function hextodec(str,ret,n,i,k,c){ret = 0;n = length(str);for (i = 1; i <= n; i++) {c = tolower(substr(str, i, 1));k = index(\"123456789abcdef\", c);ret = ret * 16 + k;}return ret;}function getIP(str,ret){ret=hextodec(substr(str,index(str,\":\")-2,2));for (i=5; i>0; i-=2) {ret = ret\".\"hextodec(substr(str,i,2));}ret = ret\":\"hextodec(substr(str,index(str,\":\")+1,4));return ret;} NR > 1 {{if(NR==2)print \"Local Listening\";local=getIP(\$2);remote=getIP(\$3)}{print local}}' | grep '0.0.0.0:9779'"
interval: 30s
timeout: 10s
retries: 3
Expand Down Expand Up @@ -198,7 +200,8 @@ services:
- metad1
- metad2
healthcheck:
test: ["CMD", "curl", "-sf", "http://storaged2:19779/status"]
# Just check process level health, please do `SHOW HOSTS` from console to check the status of storaged on cluster level
test: "cat /proc/net/tcp | awk 'function hextodec(str,ret,n,i,k,c){ret = 0;n = length(str);for (i = 1; i <= n; i++) {c = tolower(substr(str, i, 1));k = index(\"123456789abcdef\", c);ret = ret * 16 + k;}return ret;}function getIP(str,ret){ret=hextodec(substr(str,index(str,\":\")-2,2));for (i=5; i>0; i-=2) {ret = ret\".\"hextodec(substr(str,i,2));}ret = ret\":\"hextodec(substr(str,index(str,\":\")+1,4));return ret;} NR > 1 {{if(NR==2)print \"Local Listening\";local=getIP(\$2);remote=getIP(\$3)}{print local}}' | grep '0.0.0.0:9779'"
interval: 30s
timeout: 10s
retries: 3
Expand Down

0 comments on commit a65f648

Please sign in to comment.