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


Chronological Thread 
  • From: Vladimir Girnet < >
  • To:
  • Subject: [chef] Re: why does mysql on ec2 bind to priviate i.p?
  • Date: Wed, 14 Nov 2012 17:47:50 +0200

Hi,

I have a strange situation on a Rackspace server - in some conditions IP address for MySQL is set to public IP (which is node IP address). It looks like "cloud" attribute is not yet available when mysql bind ipaddress is evaluated. 
I'm running embedded chef 10.14.4 on CentOS 6.3 on Rackspace. 

It looks like some attributes are evaluated before all plugins are executed. 

Does someone else experienced such issue? Should I upgrade to latest 10.6.2? 

Thanks,
--
Vladimir Girnet
Infrastructure Engineer
Tacit Knowledge
http://www.tacitknowledge.com


On Nov 14, 2012, at 4:26 PM, Joshua Timberman 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.

§