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


Chronological Thread 
  • From: Matt Ray < >
  • To: " " < >
  • Subject: [chef] RE: why does mysql on ec2 bind to priviate i.p?
  • Date: Wed, 14 Nov 2012 04:55:10 +0000
  • Accept-language: en-US

Private IPs are used by default with most cookbooks because Amazon (and others) charge for bandwidth in and out of their data center. For a database, this could be a lot of traffic, and I believe they charge even if it's just going right back on the public IP to another Amazon instance.


Thanks,
Matt Ray
Senior Technical Evangelist | Opscode Inc.
| (512) 731-2218
Twitter, IRC, GitHub: mattray

From: S Ahmed
Sent: Tuesday, November 13, 2012 10:28 PM
To:
Subject: [chef] why does mysql on ec2 bind to priviate i.p?

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.

Doing:

telnet localhost 3306
it says unable to connect to remote host: connectino refused

telnet x.x.x.x 3306 (ec2 private ip) it works.

The private ip isn't even in my /etc/hosts file either which was another source of confusion for me :)

Is there a good reason for this? What is wrong with localhost?

server.rb has the following:

default['mysql']['bind_address']               = attribute?('cloud') ? cloud['local_ipv4'] : ipaddress

my.cnf gets set with this:

bind-address x.x.x.x





Archive powered by MHonArc 2.6.16.

§