devstructure / blueprint

Reverse engineer server configuration
http://devstructure.com/
Other
2.15k stars 132 forks source link

MySQL package install hangs `blueprint apply` #117

Closed abrookins closed 12 years ago

abrookins commented 12 years ago

I'm using blueprint 3.4.1-1py2.6 to apply a cookbook captured on an Ubuntu 10.04 server to another Ubuntu 10.04 server.

When usign blueprint apply {blueprint_name}, I have a problem with MySQL package installs.They appear to hang -- possibly due to a MySQL configuration error.

Here is the output of the hung session just before it hangs:

The following extra packages will be installed:
  mysql-server mysql-server-5.1 mysql-server-core-5.1
Suggested packages:
  tinyca mailx
The following NEW packages will be installed:
  mysql-server mysql-server-5.1 mysql-server-core-5.1
0 upgraded, 3 newly installed, 0 to remove and 5 not upgraded.
Need to get 11.8MB of archives.
After this operation, 27.1MB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main mysql-server-core-5.1 5.1.41-3ubuntu12.10 [4,714kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main mysql-server-5.1 5.1.41-3ubuntu12.10 [7,009kB]
Get:3 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main mysql-server 5.1.41-3ubuntu12.10 [94.8kB]
Fetched 11.8MB in 12s (960kB/s)
Preconfiguring packages ...
Selecting previously deselected package mysql-server-core-5.1.
(Reading database ... 57640 files and directories currently installed.)
Unpacking mysql-server-core-5.1 (from .../mysql-server-core-5.1_5.1.41-3ubuntu12.10_i386.deb) ...
Selecting previously deselected package mysql-server-5.1.
Unpacking mysql-server-5.1 (from .../mysql-server-5.1_5.1.41-3ubuntu12.10_i386.deb) ...
Selecting previously deselected package mysql-server.
Unpacking mysql-server (from .../mysql-server_5.1.41-3ubuntu12.10_all.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Setting up mysql-server-core-5.1 (5.1.41-3ubuntu12.10) ...
Setting up mysql-server-5.1 (5.1.41-3ubuntu12.10) ...

Configuration file `/etc/init/mysql.conf'
==> File on system created by you or by a script.
==> File also in package provided by package maintainer.
==> Using current old file as you requested.

And here's ps output for the process that remains after I control-c:

root      1194  0.0  0.1   1832   592 ?        S    13:37   0:00 sh bootstrap-name/bootstrap.sh
root     15766  0.0  3.9  24192 19996 ?        S    13:44   0:00  \_ apt-get -y -q -o DPkg::Options::=--force-confold install mysql-server=5.1.
root     15957  0.0  0.5   6036  3024 pts/1    Ss+  13:44   0:00      \_ /usr/bin/dpkg --force-confold --status-fd 22 --configure mysql-server-
root     15958  0.0  1.3   9892  6828 pts/1    S+   13:44   0:00          \_ /usr/bin/perl -w /usr/share/debconf/frontend /var/lib/dpkg/info/my
root     15964  0.0  0.2   4316  1516 pts/1    S+   13:44   0:00              \_ /bin/bash -e /var/lib/dpkg/info/mysql-server-5.1.postinst conf
root     16091  0.0  0.2   3796  1116 pts/1    S+   13:44   0:00                  \_ start mysql

So, mysql can't start.

When I check the MySQL log, I see that there is an error:

120227 14:05:32 [ERROR] Can't start server: Bind on TCP/IP port: Cannot assign requested address
120227 14:05:32 [ERROR] Do you already have another mysqld server running on port: 3306 ?

Ah, right. The my.cnf captured when I took the blueprint bound the server to an IP address that won't work with the VM on which I'm installing the blueprint.

It makes sense. But should this scenario hang the entire apply?

rcrowley commented 12 years ago

The mysql-server packages from Ubuntu are what they are. Upstart will hang like that if the server can't be started and I think Blueprint would be overstepping its bounds if it tried to fix that.

However, Blueprint can render templates of configuration files so you can use {{PRIVATE_IP}} in my.cnf to make your blueprint portable. See http://devstructure.github.com/blueprint/#templates for more info.

abrookins commented 12 years ago

Ok, that makes sense. Thanks!