atomic-penguin / cookbook-gitlab-deprecated

Gitlab cookbook
128 stars 84 forks source link

Socket for mysql connection #95

Closed sebfie closed 8 years ago

sebfie commented 9 years ago

Hello,

Add the feature to define the socket for the mysql connection. Very useful with the new mysql gem which define mysql instances with a name and the socket is located to /var/run/mysql-default/mysqld.sock

chewi commented 7 years ago

I don't understand this change and it has broken Kitchen. Could you please explain it? These two lines in particular do not make sense as you're just resetting the same variable.

database_host = node['gitlab']['database']['host']
database_host = node['gitlab']['database']['socket']

It seems like you wanted to change the location of the socket that the server uses but you haven't done that. Saying that, being able to change it makes more sense than using the host attribute for the connection. The server has just been installed locally so why would you attempt to create a database and user on a remote server?

chewi commented 7 years ago

Okay, I'm going to draw my own conclusion. Without this change, it works but only if host is 127.0.0.1 and not localhost. I'm guessing @sebfie set the latter, causing MySQL to use the socket instead of TCP, and it failed because the mysql cookbook has changed the socket location to something non-default. I'm having a go at straightening this out while I bump to the latest GitLab version.

chewi commented 7 years ago

As you can see, I had a stab at fixing it and it did work but the fix requires mysql cookbook 8.x and the rest of that thing is a total wreck. I tried really hard to figure it out but I've lost my patience with it, especially as I use PostgreSQL in production. That is what GitLab recommends so should it not be the default? As for MySQL, I very highly recommend we avoid the whole mess and switch to MariaDB.