Search code examples
debianinstallationpercona

Unattended Percona Server 5.7 install on Debian Jessie


I'm trying to do an unattended install of Percona Server 5.7 from Percona's repository on Debian Jessie. I don't really care what root password I end up with, if any. That's secondary.

So far I have been unsuccesful, ending up with three different scenarios, each failing in a different step:

1) DEBIAN_FRONTEND=noninteractive apt-get -y install percona-server-server-5.7 which hangs indefinitely: http://pastebin.com/QiYUsSJW

The server is started and I can even connect to it using mysql -S /var/run/mysqld/mysqld.sock which is strange because of the "cannot connect to socket" warning in the paste above.

There is no /etc/mysql/my.cnf file present at the time of the hang, however, the directory is there.

2) use debconf-set-selections to pre-seed debconf database with these:

percona-server-server-5.7 percona-server-server-5.7/root-pass password supersecret

percona-server-server-5.7 percona-server-server-5.7/re-root-pass password supersecret

and then proceed with apt-get install percona-server-server-5.7

In this step, apt fails because the password is still apparently blank: http://pastebin.com/hMsjn0wJ with these logs: http://pastebin.com/61KPgTth

In this case the mysql service won't even start so I can't tell whether the password was actually set or not. However, checking debconf database at /var/cache/debconf/passwords.dat I can see the Password Value field is empty. Going back through the log to the line

Apr 16 16:14:53 gtest mysql-systemd-start[2659]: /usr/share/mysql/mysql-systemd-start: line 37: [: too many arguments

and analyzing the file I get to the point where my_print_defaults binary is executed and is supposed to return mysqld configuration values. Instead it prints nothing causing the start script fail with the above error. Why is it empty? Don't know. Likely because the /etc/mysql/my.cnf is nonexistent, much like as in previous case. This is also mentioned here:

Apr 16 17:01:51 gtest mysql-systemd-start[12214]: Percona Server configuration not found at /etc/mysql/my.cnf. Please install one using update-alternatives.

But I would expect this to be populated by apt at the installation time. Looks like some kind of a chicken-and-egg loop within apt but beyond my abilities.

3) same as 2 except the password is deliberately set as empty. Results are the same as in step 1.

I'm out of ideas. Any tips?

thx.


Solution

  • Good news everyone! I figured out what the problem really was.

    All of the above was most likely caused by me repeatedly trying to succeed on an already set-up box. This caused an apt-typical split-package dependency hell problem. Going up through the dependency tree I found out that, among others, there is a dependency package mysql-common which surprisingly contains just the one file, /etc/mysql/my.cnf plus some empty directories and typical Debian docs structure.

    After taking this package into consideration the unattended installation works as expected using all three methods. The only thing that remains now is how to do the mysql_secure_installation automatically as well.