This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
zhangzhihan-device-manageme…/roles/minio/files/MinioStanAlone/register_service.sh
zhangzhihan 960bdaa91f create
2020-01-17 15:35:48 +08:00

11 lines
580 B
Bash
Executable File

#!/bin/bash
local_ip=$(ifconfig eth2 | grep 'inet' |grep -v inet6 | awk '{print $2}')
data="{\"Name\":\"MinioCache\",\"ID\":\"$local_ip:9000\",\"Address\":\"$local_ip\",\"Port\":9000,\"EnableTagOverride\":true,\"Tags\":[\"group=TangoCache\",\"capacity=20\"],\"Check\":{\"id\":\"minio\",\"name\":\"Minio TCP on port 9000\",\"tcp\":\"$local_ip:9000\",\"interval\":\"10s\",\"timeout\":\"1s\"}}"
curl -s http://localhost:8500/v1/agent/service/register -X PUT -i -H "Content-Type:application/json" -d "$data"
#curl http://localhost:8500/v1/agent/service/deregister/$local_ip:9000