tikv / tikv/pd

AWS service discovery integration

Open
#1,497 3 comments 0 reactions 0 assignees View on GitHub
type/enhancement
Dominant language
Go
Stars
1.2k
Forks
783
Avg merge
5d 21h
Merged PRs (30d)
36

Description

Please answer these questions before submitting your issue. Thanks!

1. What did you do?

AWS is the largest public cloud, but the Kubernetes support is still immature (and costs $$$ for a small install).

It would be nice to have pd/tidb/tikv integrate with Route53's [service discovery](https://aws.amazon.com/premiumsupport/knowledge-center/service-discovery-route53-auto-naming/) out of the box. This can be done with the [AWS GO SDK](https://docs.aws.amazon.com/sdk-for-go/api/service/applicationdiscoveryservice/).

2. What did you expect to see?

It would be nice to be able to do something like this (for first run):
```
./bin/pd-server \
--name=pd1 \
--data-dir=pd \
--aws-bootstrap
Created new Route53 Service "srv-iy3d7hhlf5cjciph".
```
And then for subsequent:
```
./bin/pd-server \
--name=pd1 \
--data-dir=pd \
--aws-service-id=srv-iy3d7hhlf5cjciph
```

Then with TiDB and TiKV:
```
./bin/tidb-server \
--store=tikv \
--aws-service-id=srv-iy3d7hhlf5cjciph

./bin/tikv-server \
--aws-service-id=srv-iy3d7hhlf5cjciph \
--data-dir=tikv
```

3. What did you see instead?

Instead it requires complex shell scripting because of the multiple commands:

```
aws servicediscovery create-private-dns-namespace --vpc vpc-b9ed28c2 --name tidb.local
(capture the output of the operation id)
(check to get the namespace id from an api command using the operation-id, waiting in a loop)
aws servicediscovery create-service --name pd --namespace-id

INTERNALIP=`curl http://169.254.169.254/latest/meta-data/local-ipv4`
INSTANCEID=`curl http://169.254.169.254/latest/meta-data/instance-id`

screen -dm ./pd-master-linux-amd64/bin/pd-server \
--name=pd1 \
--data-dir=pd \
--client-urls="http://$INTERNALIP:2379" \
--peer-urls="http://$INTERNALIP:2380" \
--initial-cluster="pd1=http://$INTERNALIP:2380" \
--log-file=pd.log

aws servicediscovery register-instance --service-id srv-iy3d7hhlf5cjciph --instance-id $INSTANCEID --attributes=AWS_INSTANCE_IPV4=$INTERNALIP
```

4. What version of PD are you using (`pd-server -V`)?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.