FAQ
Has anybody sucessfully used puppetlabs-mysql (or some other method) to
install MySQL-server on Linux with a my.cnf where datadir != /var/lib/mysql
?

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/004002bb-577c-4d2d-8f51-ce62486dfeb6%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Dan White at Dec 4, 2013 at 2:51 am
    One gets the impression that you have tried and have been unsuccessful.

    Details would help with troubleshooting.
    On Dec 3, 2013, at 8:39 PM, Thomas wrote:

    Has anybody sucessfully used puppetlabs-mysql (or some other method) to install MySQL-server on Linux with a my.cnf where datadir != /var/lib/mysql ?
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/88887366-7966-4C01-AE96-A329882BFD64%40comcast.net.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Thomas at Dec 4, 2013 at 3:00 pm
    No it didn't work and see other replies with additional details thanks to
    the others that have provided more details regarding the problem.

    If I'm able to figure out a fix I'll certainly submit a pull request to
    resolve the issue.

    What I had done was on RHEL 6.4 deploy an /etc/my.cnf containing datadir =
    /data/mysql but when puppet tries to start the mysql service it fails.

    I'm writing a manifest to see if I can perform an exec of mysql_install_db
    along with proper dependencies to get a fresh database configured that
    doesn't point to /var/lib/mysql for it's datadir.

    If I get that to work than I'll work on incorporating it into the
    puppetlabs-mysql forge module.

    My initial message was just to first check if somebody else had solved this
    problem already... I'll submit an issue on github later so other users of
    the module are aware of a potential solution.
    On Tuesday, December 3, 2013 9:51:27 PM UTC-5, Ygor wrote:

    One gets the impression that you have tried and have been unsuccessful.

    Details would help with troubleshooting.

    On Dec 3, 2013, at 8:39 PM, Thomas <thomas....@gmail.com <javascript:>>
    wrote:
    Has anybody sucessfully used puppetlabs-mysql (or some other method) to
    install MySQL-server on Linux with a my.cnf where datadir != /var/lib/mysql
    ?
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/082504a2-0169-4149-95fc-181e9250efcd%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Walter Heck at Dec 4, 2013 at 12:30 pm
    Tried and failed. The problem is that the mysql package automatically uses
    /var/lib/mysql, so the right sequence is:

    1) yum install mysql-server
    2) service mysqld stop
    3) adjust my.cnf
    4) make moves on filesystem if needed
    5) service mysqld start
    (steps 2 and 3 can be reversed)

    This is hard to puppetise as it is only needed the very first time when
    mysql is not yet installed. I've only ever had to do this on smaller groups
    of servers at a time, so always resorted to doing it manually.

    let me know if you figure it out, would be great to see a solution in
    puppetlabs-mysql.

    On Wednesday, 4 December 2013 02:39:50 UTC+1, Thomas wrote:

    Has anybody sucessfully used puppetlabs-mysql (or some other method) to
    install MySQL-server on Linux with a my.cnf where datadir != /var/lib/mysql
    ?
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/161ec82b-dd7a-4c71-bec3-99c40e6c62d5%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Luke Bigum at Dec 4, 2013 at 12:38 pm
    It should be theoretically possible. The mysql-server package owns
    /var/lib/mysql, but it is the mysql_install_db script that sets up an empty
    database in $datadir when the service starts if $datadir is empty. If you
    update your config file before you start the mysql server, you should be
    able to point it at any datadir you like. It will leave an empty directory
    at /var/lib/mysql, but hopefully you are ok with that as it's owned by an
    RPM.

    I had a quick look at the module, /var/lib/mysql is hard coded in a lot of
    places and you'd have to override / set most of them as well as in my.cnf:

    $ grep -R '/var/lib/mysql' *
    manifests/params.pp: $datadir = '/var/lib/mysql'
    manifests/params.pp: $socket =
    '/var/lib/mysql/mysql.sock'
    manifests/params.pp: $datadir = '/var/lib/mysql'
    manifests/params.pp: /(SLES|SLED)/ =>
    '/var/lib/mysql/mysql.sock',
    manifests/params.pp: /(SLES|SLED)/ =>
    '/var/lib/mysql/mysqld.pid',
    manifests/params.pp: $datadir = '/var/lib/mysql'
    manifests/params.pp: $datadir = '/var/lib/mysql'
    manifests/params.pp: $socket =
    '/var/lib/mysql/mysql.sock'

    On Wednesday, December 4, 2013 12:30:31 PM UTC, Walter Heck wrote:

    Tried and failed. The problem is that the mysql package automatically uses
    /var/lib/mysql, so the right sequence is:

    1) yum install mysql-server
    2) service mysqld stop
    3) adjust my.cnf
    4) make moves on filesystem if needed
    5) service mysqld start
    (steps 2 and 3 can be reversed)

    This is hard to puppetise as it is only needed the very first time when
    mysql is not yet installed. I've only ever had to do this on smaller groups
    of servers at a time, so always resorted to doing it manually.

    let me know if you figure it out, would be great to see a solution in
    puppetlabs-mysql.

    On Wednesday, 4 December 2013 02:39:50 UTC+1, Thomas wrote:

    Has anybody sucessfully used puppetlabs-mysql (or some other method) to
    install MySQL-server on Linux with a my.cnf where datadir != /var/lib/mysql
    ?
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/fa6d9246-47c6-407a-a4e5-758cf1621759%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Thomas at Dec 4, 2013 at 3:02 pm
    Yes it might be tricky to integrate it but I think this would be a useful
    enhancement.
    On Wednesday, December 4, 2013 7:38:46 AM UTC-5, Luke Bigum wrote:

    It should be theoretically possible. The mysql-server package owns
    /var/lib/mysql, but it is the mysql_install_db script that sets up an empty
    database in $datadir when the service starts if $datadir is empty. If you
    update your config file before you start the mysql server, you should be
    able to point it at any datadir you like. It will leave an empty directory
    at /var/lib/mysql, but hopefully you are ok with that as it's owned by an
    RPM.

    I had a quick look at the module, /var/lib/mysql is hard coded in a lot of
    places and you'd have to override / set most of them as well as in my.cnf:

    $ grep -R '/var/lib/mysql' *
    manifests/params.pp: $datadir = '/var/lib/mysql'
    manifests/params.pp: $socket =
    '/var/lib/mysql/mysql.sock'
    manifests/params.pp: $datadir = '/var/lib/mysql'
    manifests/params.pp: /(SLES|SLED)/ =>
    '/var/lib/mysql/mysql.sock',
    manifests/params.pp: /(SLES|SLED)/ =>
    '/var/lib/mysql/mysqld.pid',
    manifests/params.pp: $datadir = '/var/lib/mysql'
    manifests/params.pp: $datadir = '/var/lib/mysql'
    manifests/params.pp: $socket =
    '/var/lib/mysql/mysql.sock'

    On Wednesday, December 4, 2013 12:30:31 PM UTC, Walter Heck wrote:

    Tried and failed. The problem is that the mysql package automatically
    uses /var/lib/mysql, so the right sequence is:

    1) yum install mysql-server
    2) service mysqld stop
    3) adjust my.cnf
    4) make moves on filesystem if needed
    5) service mysqld start
    (steps 2 and 3 can be reversed)

    This is hard to puppetise as it is only needed the very first time when
    mysql is not yet installed. I've only ever had to do this on smaller groups
    of servers at a time, so always resorted to doing it manually.

    let me know if you figure it out, would be great to see a solution in
    puppetlabs-mysql.

    On Wednesday, 4 December 2013 02:39:50 UTC+1, Thomas wrote:

    Has anybody sucessfully used puppetlabs-mysql (or some other method) to
    install MySQL-server on Linux with a my.cnf where datadir != /var/lib/mysql
    ?
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/c274653e-dc52-4f18-8908-59024b2450dd%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Walter Heck at Dec 4, 2013 at 4:05 pm
    What you could do is let yum just start and install it's stuff in
    /var/lib/mysql. Then an exec of mysql_install_db with an onlyif attribute
    that checks for the mysql metadata in /data/mysql.

    On Wed, Dec 4, 2013 at 4:02 PM, Thomas wrote:

    Yes it might be tricky to integrate it but I think this would be a useful
    enhancement.

    On Wednesday, December 4, 2013 7:38:46 AM UTC-5, Luke Bigum wrote:

    It should be theoretically possible. The mysql-server package owns
    /var/lib/mysql, but it is the mysql_install_db script that sets up an empty
    database in $datadir when the service starts if $datadir is empty. If you
    update your config file before you start the mysql server, you should be
    able to point it at any datadir you like. It will leave an empty directory
    at /var/lib/mysql, but hopefully you are ok with that as it's owned by an
    RPM.

    I had a quick look at the module, /var/lib/mysql is hard coded in a lot
    of places and you'd have to override / set most of them as well as in
    my.cnf:

    $ grep -R '/var/lib/mysql' *
    manifests/params.pp: $datadir = '/var/lib/mysql'
    manifests/params.pp: $socket =
    '/var/lib/mysql/mysql.sock'
    manifests/params.pp: $datadir = '/var/lib/mysql'
    manifests/params.pp: /(SLES|SLED)/ =>
    '/var/lib/mysql/mysql.sock',
    manifests/params.pp: /(SLES|SLED)/ =>
    '/var/lib/mysql/mysqld.pid',
    manifests/params.pp: $datadir = '/var/lib/mysql'
    manifests/params.pp: $datadir = '/var/lib/mysql'
    manifests/params.pp: $socket =
    '/var/lib/mysql/mysql.sock'

    On Wednesday, December 4, 2013 12:30:31 PM UTC, Walter Heck wrote:

    Tried and failed. The problem is that the mysql package automatically
    uses /var/lib/mysql, so the right sequence is:

    1) yum install mysql-server
    2) service mysqld stop
    3) adjust my.cnf
    4) make moves on filesystem if needed
    5) service mysqld start
    (steps 2 and 3 can be reversed)

    This is hard to puppetise as it is only needed the very first time when
    mysql is not yet installed. I've only ever had to do this on smaller groups
    of servers at a time, so always resorted to doing it manually.

    let me know if you figure it out, would be great to see a solution in
    puppetlabs-mysql.

    On Wednesday, 4 December 2013 02:39:50 UTC+1, Thomas wrote:

    Has anybody sucessfully used puppetlabs-mysql (or some other method) to
    install MySQL-server on Linux with a my.cnf where datadir != /var/lib/mysql
    ?
    --
    You received this message because you are subscribed to a topic in the
    Google Groups "Puppet Users" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/puppet-users/mkQygmpa610/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    puppet-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/puppet-users/c274653e-dc52-4f18-8908-59024b2450dd%40googlegroups.com
    .

    For more options, visit https://groups.google.com/groups/opt_out.


    --
    Walter Heck

    --
    Check out my startup: Puppet training and consulting @
    http://www.olindata.com
    Follow @olindata on Twitter and/or 'Like' our Facebook page at
    http://www.facebook.com/olindata

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAJojfjqK4uY9ePh%3DSS7HJkfMXUHLNU2g0%2B0SXeFEMt8x5yoLQw%40mail.gmail.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Thomas at Dec 4, 2013 at 5:34 pm
    I agree and was thinking along those lines as well.

    For those interested vicinus (on github) <https://github.com/vicinus> has
    started this and has it working on Ubuntu. See
    https://github.com/puppetlabs/puppetlabs-mysql/issues/380 for details<https://github.com/puppetlabs/puppetlabs-mysql/issues/380>
    .


    On Wednesday, December 4, 2013 11:04:49 AM UTC-5, Walter Heck wrote:

    What you could do is let yum just start and install it's stuff in
    /var/lib/mysql. Then an exec of mysql_install_db with an onlyif attribute
    that checks for the mysql metadata in /data/mysql.


    On Wed, Dec 4, 2013 at 4:02 PM, Thomas <thomas....@gmail.com <javascript:>
    wrote:
    Yes it might be tricky to integrate it but I think this would be a useful
    enhancement.

    On Wednesday, December 4, 2013 7:38:46 AM UTC-5, Luke Bigum wrote:

    It should be theoretically possible. The mysql-server package owns
    /var/lib/mysql, but it is the mysql_install_db script that sets up an empty
    database in $datadir when the service starts if $datadir is empty. If you
    update your config file before you start the mysql server, you should be
    able to point it at any datadir you like. It will leave an empty directory
    at /var/lib/mysql, but hopefully you are ok with that as it's owned by an
    RPM.

    I had a quick look at the module, /var/lib/mysql is hard coded in a lot
    of places and you'd have to override / set most of them as well as in
    my.cnf:

    $ grep -R '/var/lib/mysql' *
    manifests/params.pp: $datadir = '/var/lib/mysql'
    manifests/params.pp: $socket =
    '/var/lib/mysql/mysql.sock'
    manifests/params.pp: $datadir = '/var/lib/mysql'
    manifests/params.pp: /(SLES|SLED)/ =>
    '/var/lib/mysql/mysql.sock',
    manifests/params.pp: /(SLES|SLED)/ =>
    '/var/lib/mysql/mysqld.pid',
    manifests/params.pp: $datadir = '/var/lib/mysql'
    manifests/params.pp: $datadir = '/var/lib/mysql'
    manifests/params.pp: $socket =
    '/var/lib/mysql/mysql.sock'

    On Wednesday, December 4, 2013 12:30:31 PM UTC, Walter Heck wrote:

    Tried and failed. The problem is that the mysql package automatically
    uses /var/lib/mysql, so the right sequence is:

    1) yum install mysql-server
    2) service mysqld stop
    3) adjust my.cnf
    4) make moves on filesystem if needed
    5) service mysqld start
    (steps 2 and 3 can be reversed)

    This is hard to puppetise as it is only needed the very first time when
    mysql is not yet installed. I've only ever had to do this on smaller groups
    of servers at a time, so always resorted to doing it manually.

    let me know if you figure it out, would be great to see a solution in
    puppetlabs-mysql.

    On Wednesday, 4 December 2013 02:39:50 UTC+1, Thomas wrote:

    Has anybody sucessfully used puppetlabs-mysql (or some other method)
    to install MySQL-server on Linux with a my.cnf where datadir !=
    /var/lib/mysql ?
    --
    You received this message because you are subscribed to a topic in the
    Google Groups "Puppet Users" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/puppet-users/mkQygmpa610/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    puppet-users...@googlegroups.com <javascript:>.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/puppet-users/c274653e-dc52-4f18-8908-59024b2450dd%40googlegroups.com
    .

    For more options, visit https://groups.google.com/groups/opt_out.


    --
    Walter Heck

    --
    Check out my startup: Puppet training and consulting @
    http://www.olindata.com
    Follow @olindata on Twitter and/or 'Like' our Facebook page at
    http://www.facebook.com/olindata
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/6fce8c93-b784-4cf1-85b6-ea9dffba0ae7%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Thomas at Dec 4, 2013 at 3:01 pm
    Yes that is what I was thinking as well. Unfortunately I don't believe yum
    will permit me to specify --noscripts so I can avoid mysql_install_db from
    running.
    On Wednesday, December 4, 2013 7:30:31 AM UTC-5, Walter Heck wrote:

    Tried and failed. The problem is that the mysql package automatically uses
    /var/lib/mysql, so the right sequence is:

    1) yum install mysql-server
    2) service mysqld stop
    3) adjust my.cnf
    4) make moves on filesystem if needed
    5) service mysqld start
    (steps 2 and 3 can be reversed)

    This is hard to puppetise as it is only needed the very first time when
    mysql is not yet installed. I've only ever had to do this on smaller groups
    of servers at a time, so always resorted to doing it manually.

    let me know if you figure it out, would be great to see a solution in
    puppetlabs-mysql.

    On Wednesday, 4 December 2013 02:39:50 UTC+1, Thomas wrote:

    Has anybody sucessfully used puppetlabs-mysql (or some other method) to
    install MySQL-server on Linux with a my.cnf where datadir != /var/lib/mysql
    ?
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/2dfa86e6-85df-4223-a7eb-64a61357e654%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Justin at Dec 5, 2013 at 1:27 am
    Have you tried creating a symlink (eg. /var/lib/mysql -> /mysql/data)
    before installing with yum?
    On Dec 3, 2013 8:40 PM, "Thomas" wrote:

    Has anybody sucessfully used puppetlabs-mysql (or some other method) to
    install MySQL-server on Linux with a my.cnf where datadir != /var/lib/mysql
    ?

    --
    You received this message because you are subscribed to the Google Groups
    "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to puppet-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/puppet-users/004002bb-577c-4d2d-8f51-ce62486dfeb6%40googlegroups.com
    .
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAAqoRT67a3k8U7UU0wOcAv-rPS_Vakeyjnv%2BQyN6G6W3AuTp5Q%40mail.gmail.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Chris McDermott at Dec 17, 2013 at 5:22 pm
    I'm a bit late to this thread, but I ran into the same problem with the
    puppetlabs-mysql module - it's a bug in how the module was written. There
    is a fork by the folks at MediaTemple which addressed that issue:

    https://github.com/mediatemple/puppetlabs-mysql

    I've been using that successfully for several months now to do exactly what
    you propose - specify an alternate location for the datadir and have the
    module install/configure/start mysqld with no intervention required.

    Chris

    On Wed, Dec 4, 2013 at 6:27 PM, Justin wrote:

    Have you tried creating a symlink (eg. /var/lib/mysql -> /mysql/data)
    before installing with yum?
    On Dec 3, 2013 8:40 PM, "Thomas" wrote:

    Has anybody sucessfully used puppetlabs-mysql (or some other method) to
    install MySQL-server on Linux with a my.cnf where datadir != /var/lib/mysql
    ?

    --
    You received this message because you are subscribed to the Google Groups
    "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to puppet-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/puppet-users/004002bb-577c-4d2d-8f51-ce62486dfeb6%40googlegroups.com
    .
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups
    "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to puppet-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/puppet-users/CAAqoRT67a3k8U7UU0wOcAv-rPS_Vakeyjnv%2BQyN6G6W3AuTp5Q%40mail.gmail.com
    .

    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAFnaWbsHmJHbxPv%3Dqor%3D8uG7tqb0O5JdvnCx4uz7BKca9NY9Qg%40mail.gmail.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedDec 4, '13 at 1:39a
activeDec 17, '13 at 5:22p
posts11
users6
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase