[chef] Re: Re: why does mysql on ec2 bind to priviate i.p?


Chronological Thread 
  • From: S Ahmed < >
  • To:
  • Subject: [chef] Re: Re: why does mysql on ec2 bind to priviate i.p?
  • Date: Wed, 14 Nov 2012 11:33:37 -0500

If I set it to 127.0.0.1, does this mean I can't access it from another ec2 server then?

The problem is during deployment, I don't know the private i.p in advance and during deployment all my database configuration information has 'localhost' in it.  I understand what you guys are saying and it does make sense, I just have to modify my deployment process to first pull in the private ip's for each service (I should be doing this anyhow as eventually not everything is going to fit on a single instance!)


On Wed, Nov 14, 2012 at 9:26 AM, Joshua Timberman < " target="_blank"> > wrote:
On 11/13/12 9:28 PM, "S Ahmed" < "> > wrote:


>I noticed when I used the mysql recipe it installs mysql and binds it to
>the private i.p on ec2, why is that?
>
>My application can't connect as it uses 'localhost' (jdbc), but for some
>reason it works fine using ruby.

The reason for not using localhost is because in the opinion of the
cookbook, it is more useful to have the server accessible on the [private]
network so that other systems like application servers can connect to it.
We use the private address on cloud providers because, as Matt pointed
out, it may cost money for external bandwidth. Also, having your database
server accessible on the external network is bad :).

You can set the attribute `node['mysql']['bind_address']` in a role or on
the node itself, to use loopback.


For example, in a role:

default_attributes(
  "mysql" => {
    "bind_address" => "127.0.0.1"
  }
)

On the node itself would be the JSON equivalent of the above.






Archive powered by MHonArc 2.6.16.

§