yannig rousseau
2013-Jul-25 09:21 UTC
[Puppet Users] Decomission node process (puppet / puppetdb / dashboard)
Hi all, I have a few nodes which have deen decommissioned but still appear within my dashboard within the ureported section. I probably have forgot something but what ? My puppetmaster (rhel5.9) hosts the 3 roles : puppet-server-3.2.2, puppetdb-1.1.1, puppet-dashboard-1.2.22 The process I use to decommission : - Clean the certificate on puppetmaster : *puppet cert clean "node.domain"* - Delete the node itself from puppetdb : *puppet node deactivate "node.domain"* Concerning the dashboard, I use a pruning job in my crontab : *35 6 * * * /etc/puppet/maintenance/puppet-dashboard.cleanup_reports.cron* The job itself : *set -u* *find /var/lib/puppet/reports/*/ -mtime +7 -exec rm {} \;* *PUPPET_DB_PATH=/usr/share/puppet-dashboard* *cd $PUPPET_DB_PATH* *output=`rake -s -f ${PUPPET_DB_PATH}/Rakefile RAILS_ENV=production reports:prune upto=1 unit=wk`* *if [ $? -ne 0 ]; then* * logger -i "${output}"* *fi* *echo $output* Regards Yannig -- 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 post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Klavs Klavsen
2013-Jul-25 12:17 UTC
[Puppet Users] Re: Decomission node process (puppet / puppetdb / dashboard)
> > that job just removes reports for hosts - it does''t remove the actual > hosts.You need to pick the node in puppet-dashboard webinterface - and choose delete (upper right corner) -- 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 post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
yannig rousseau
2013-Jul-25 12:54 UTC
Re: [Puppet Users] Re: Decomission node process (puppet / puppetdb / dashboard)
Do you know if it''s possible to lauch it from a script (maybe a sql request ?) On Thu, Jul 25, 2013 at 2:17 PM, Klavs Klavsen <klavs@enableit.dk> wrote:> that job just removes reports for hosts - it does''t remove the actual >> hosts. > > > You need to pick the node in puppet-dashboard webinterface - and choose > delete (upper right corner) > > -- > 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/ZsjSJJWxeHk/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > puppet-users+unsubscribe@googlegroups.com. > To post to this group, send email to puppet-users@googlegroups.com. > Visit this group at http://groups.google.com/group/puppet-users. > 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 post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
John Warburton
2013-Jul-26 00:47 UTC
Re: [Puppet Users] Re: Decomission node process (puppet / puppetdb / dashboard)
On 25 July 2013 22:54, yannig rousseau <yrousseau@keremma.net> wrote:> Do you know if it''s possible to lauch it from a script (maybe a sql > request ?)rake --silent node:del name=deleteme RAILS_ENV=production I also run a job each day to tidy up the database: # Purged nodes leave behind orphaned records: # http://docs.puppetlabs.com/pe/2.0/welcome_known_issues.html#consoles-reportsprune-task-leaves-orphaned-data # http://projects.puppetlabs.com/issues/6717 rake --silent RAILS_ENV=production reports:prune:orphaned >> $LOG 2>&1 # Recover/pack space from deletions with table optimization # http://dev.mysql.com/doc/refman/5.0/en/mysqlcheck.html DATABASE=`grep database: /local/puppet/dashboard/dashboard/config/database.yml | awk ''{print $2}''` USER=`grep username: /local/puppet/dashboard/dashboard/config/database.yml | awk ''{print $2}''` PASSWORD=`grep password: /local/puppet/dashboard/dashboard/config/database.yml | awk ''{print $2}''` mysqlcheck -u $USER --password=$PASSWORD --optimize --databases $DATABASE>> $LOG 2>&1John -- 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 post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
yannig rousseau
2013-Jul-26 08:04 UTC
Re: [Puppet Users] Re: Decomission node process (puppet / puppetdb / dashboard)
Great ! Thank you John... If I understand correctly, the "node:del" action will delete the node from dashboard database, while the "reports:prune:orphaned" will delete reports & inventory files on the server. Does anyone see other useful actions to launch while decomissioning a node ? Best regards Yannig On Fri, Jul 26, 2013 at 2:47 AM, John Warburton <jwarburton@gmail.com>wrote:> On 25 July 2013 22:54, yannig rousseau <yrousseau@keremma.net> wrote: > >> Do you know if it''s possible to lauch it from a script (maybe a sql >> request ?) > > > rake --silent node:del name=deleteme RAILS_ENV=production > > I also run a job each day to tidy up the database: > > # Purged nodes leave behind orphaned records: > # > http://docs.puppetlabs.com/pe/2.0/welcome_known_issues.html#consoles-reportsprune-task-leaves-orphaned-data > # http://projects.puppetlabs.com/issues/6717 > rake --silent RAILS_ENV=production reports:prune:orphaned >> $LOG 2>&1 > > # Recover/pack space from deletions with table optimization > # http://dev.mysql.com/doc/refman/5.0/en/mysqlcheck.html > DATABASE=`grep database: > /local/puppet/dashboard/dashboard/config/database.yml | awk ''{print $2}''` > USER=`grep username: /local/puppet/dashboard/dashboard/config/database.yml > | awk ''{print $2}''` > PASSWORD=`grep password: > /local/puppet/dashboard/dashboard/config/database.yml | awk ''{print $2}''` > mysqlcheck -u $USER --password=$PASSWORD --optimize --databases $DATABASE > >> $LOG 2>&1 > > > John > > -- > 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/ZsjSJJWxeHk/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > puppet-users+unsubscribe@googlegroups.com. > To post to this group, send email to puppet-users@googlegroups.com. > Visit this group at http://groups.google.com/group/puppet-users. > 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 post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
MasterPO
2013-Oct-03 15:12 UTC
[Puppet Users] Re: Decomission node process (puppet / puppetdb / dashboard)
Unfortunately, for me all this does is make the puppet-master host go 100% busy between the dashboard and mysqld. I am running Dashboard version 1.2.23 with puppet-server version 3.2.4 and mysql version 5.1.69 on RHEL 6.4 I get the same result running John''s cli rake command. Any ideas? Thanks Paul -- 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 post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Ramin K
2013-Oct-03 18:22 UTC
Re: [Puppet Users] Re: Decomission node process (puppet / puppetdb / dashboard)
On 10/3/2013 8:12 AM, MasterPO wrote:> > Unfortunately, for me all this does is make the puppet-master host go > 100% busy between the dashboard and mysqld. > > I am running Dashboard version 1.2.23 with puppet-server version 3.2.4 > and mysql version 5.1.69 on RHEL 6.4 > > I get the same result running John''s cli rake command. > > Any ideas?I''m guessing you have never deleted reports in Mysql and your database is now very very large. I''d start with trimming the data set down to a reasonable size and then process your deletes. I wrote up the process I use here, https://ask.puppetlabs.com/question/884/how-do-i-reduce-the-space-mysql-is-using-for-puppet-dashboard/ Ramin -- 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 post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.