3 ms·
some of us use HOSTS to write config e.g. 10.0.12.34 mysql_host This allows some degree of flexbility 1. boot up new instances quickly as long as HOSTS
by est 12y ago
some of us use HOSTS to write config
e.g.
10.0.12.34 mysql_host
This allows some degree of flexbility
1. boot up new instances quickly as long as HOSTS is correct
2. Don't have to hard-code actual mysql server IPs.
3. Make mysql master/slave failover much easier.
- ironchef 12y agoI think most folks doing devops end up using things more like zookeeper, consul, etc. instead to perform the above as opposed to hosts.
- est 12y agotiny/small sites don't require heavy lifters like zookeeper, however they do require some degree of clustering and sometimes migrating.
- ajdecon 12y agoRemember you may have to deploy third-party processes as well as apps whose code you control. Most existing software uses OS-standard APIs for doing things like resolving hosts, and you can't just point it at a path in zk. That means running a DNS server or configuring /etc/hosts.
- diggan 12y agoRegarding number two, you'll just link your containers together with docker. See https://docs.docker.com/userguide/dockerlinks/ https://docs.docker.com/userguide/dockerlinks/ It seems that most issues OP have is mostly because misunderstanding or lack of knowledge.
- Zikes 12y agoWhat if the mysql server isn't in a docker container or even on the same machine?
- sevos1987 12y agothen just use environment variables (ENV keyword in Dockerfile or --env param in docker run command)
- est 12y agoThe problem with ENV is that you can't change server IP on the fly, you have to restart the web server to apply new ENV
- eropple 12y agoThen you should be (ideally) using a service discovery solution or (less ideally) wiring up with environment variables. This is (one reason) why CoreOS uses etcd.
- vertex-four 12y agoUmm, so, how do you deal with Docker when you have more than one physical machine? It seems half the stuff it does just doesn't work then, and you have to pile on further abstractions anyway, using Docker just as a simple container management system (of which we have working ones already) and container build system (of which there are far better systems available).