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


Chronological Thread 
  • From: Joshua Timberman < >
  • To: " " < >
  • Subject: [chef] Re: why does mysql on ec2 bind to priviate i.p?
  • Date: Wed, 14 Nov 2012 14:26:31 +0000
  • Accept-language: en-US

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.

§