问题
I am running geth full node https://github.com/ethereum/go-ethereum/wiki/geth on Google Cloud platform on a VM instance. Currently, I have mounted a SSD and write the chain data to it.
I want to now run it on multiple VM instances and use a load balancer for serving the requests made by Dapp. I can do this using a normal load balancer and create VMs and autoscale. However, I have the following questions:
- SSD seems to be a very important part of blockchain syncing speed. If I simply create VM images and add it for autoscaling, it won't help much because the blockchain will take time to sync.
- If I want to run these nodes on kubernetes cluster, what's the best way to use the disk?
回答1:
Take a look at this Kubernetes Engine tutorial which shows you how to run StatefulSets with automatic persistent volume provisioning: https://cloud.google.com/kubernetes-engine/docs/how-to/stateful-apps
Take a look at this Kubernetes Engine tutorial which shows you how to provision SSD disks https://cloud.google.com/kubernetes-engine/docs/concepts/persistent-volumes#ssd_persistent_disks
With these + HorizontalPodAutoscaler, you should be able to create a StatefulSet with auto-scaling and each pod will get its own SSD disk.
来源:https://stackoverflow.com/questions/51560467/running-geth-on-kubernetes