Mohamed Lrhazi
2011-Apr-09 18:47 UTC
[Puppet Users] How to setup database for Inventory Service
Trying to follow this document: https://github.com/puppetlabs/puppet-docs/blob/master/source/guides/inventory_service.markdown puppet does not find the tables: puppet-master[29264]: [daemon.err] Mysql::Error: Table ''puppet.inventory_nodes'' doesn''t exist: SHOW FIELDS FROM `inventory_nodes` How do I update the database with the new schema? is this right there in that document? thanks. Mohamed. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Mohamed Lrhazi
2011-Apr-09 19:12 UTC
[Puppet Users] Re: How to setup database for Inventory Service
I guess the answer is drop and recreate an empty db, then restart puppet master! On Sat, Apr 9, 2011 at 2:47 PM, Mohamed Lrhazi <lrhazi@gmail.com> wrote:> Trying to follow this document: > https://github.com/puppetlabs/puppet-docs/blob/master/source/guides/inventory_service.markdown > > puppet does not find the tables: > > puppet-master[29264]: [daemon.err] Mysql::Error: Table > ''puppet.inventory_nodes'' doesn''t exist: SHOW FIELDS FROM > `inventory_nodes` > > How do I update the database with the new schema? is this right there > in that document? > > thanks. > Mohamed. >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Alessandro Franceschi
2011-Apr-11 15:07 UTC
[Puppet Users] Re: How to setup database for Inventory Service
Actually that is the good way to do that on a fresh installation I suppose, but I wonder, and ask, if there''s a way to create the needed schema for the Inventory service without destroying the current database. My case is that I''ve a Puppet Master with storeconfigs activated and a lot of data already stored. I''ve just updated it from 0.25.x (btw, now it''s 2.6 times ... slower :-) and want to activate the inventory service and I face Mohamed''s same error. I''d prefer to avoid to drop everything and wait for convergence. While writing I just realized that I can just dump a fresh db on a test puppetmaster and import the relevant inventory tables, but, well, if there''s an official way to do that, or just a rake script or whatever, it would be better. Hints? al -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Luke Baker
2011-Apr-12 01:06 UTC
[Puppet Users] Re: How to setup database for Inventory Service
Hey there, I used the storeconfigs database. Here is a condensed version of the storeconfigs setup, http://linux-collective.blogspot.com/2011/04/puppet-storeconfigs.html. You shouldn''t need to migrate anything, the data will be populated when the clients check in. On Apr 11, 10:07 am, Alessandro Franceschi <a...@lab42.it> wrote:> Actually that is the good way to do that on a fresh installation I suppose, > but I wonder, and ask, if there''s a way to create the needed schema for the > Inventory service without destroying the current database. > > My case is that I''ve a Puppet Master with storeconfigs activated and a lot > of data already stored. > I''ve just updated it from 0.25.x (btw, now it''s 2.6 times ... slower :-) and > want to activate the inventory service and I face Mohamed''s same error. > I''d prefer to avoid to drop everything and wait for convergence. > > While writing I just realized that I can just dump a fresh db on a test > puppetmaster and import the relevant inventory tables, but, well, if there''s > an official way to do that, or just a rake script or whatever, it would be > better. > > Hints? > > al-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Alessandro Franceschi
2011-Apr-12 04:18 UTC
[Puppet Users] Re: How to setup database for Inventory Service
Hi Luke, thanks for reply. I''m already using (thin) storeconfigs, and I would prefer to avoid deleting the currently stored data just to inizialize a clean db schema (I think the inventory service uses extra tables). There are 2 reasons why I''d prefer to avoid trashing stored configs data, even if I know that everything will be recreated: - First time data is stored, afaik, it make much more sql queries and this could kill the (production) puppetmaster. - Store confis are used in monitoring systems and it would take a bit of time to reach convergence. None of them are really blocking reasons, since we can work around them, but since I suppose is just a matter of creating some empty tables to store inventory data I would prefer a less disruptive approach. Still, and I ask to Brice or other storeconfigs/inventory experts, if you think it would be better to clean up everything from scrath, I could follow that path. Regards, Al On Apr 12, 3:06 am, Luke Baker <bake...@missouri.edu> wrote:> Hey there, > > I used the storeconfigs database. Here is a condensed version of the > storeconfigs setup,http://linux-collective.blogspot.com/2011/04/puppet-storeconfigs.html. > You shouldn''t need to migrate anything, the data will be populated > when the clients check in. > > On Apr 11, 10:07 am, Alessandro Franceschi <a...@lab42.it> wrote: > > > > > > > > > Actually that is the good way to do that on a fresh installation I suppose, > > but I wonder, and ask, if there''s a way to create the needed schema for the > > Inventory service without destroying the current database. > > > My case is that I''ve a Puppet Master with storeconfigs activated and a lot > > of data already stored. > > I''ve just updated it from 0.25.x (btw, now it''s 2.6 times ... slower :-) and > > want to activate the inventory service and I face Mohamed''s same error. > > I''d prefer to avoid to drop everything and wait for convergence. > > > While writing I just realized that I can just dump a fresh db on a test > > puppetmaster and import the relevant inventory tables, but, well, if there''s > > an official way to do that, or just a rake script or whatever, it would be > > better. > > > Hints? > > > al-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Greg Sutcliffe
2011-Apr-12 11:16 UTC
[Puppet Users] Re: How to setup database for Inventory Service
Heya, I''ve merged both approaches. First, I dropped the db on my development server, and then let puppet recreate it. Since I don;t want to lose my historical data in production, I then dumped and compared the schema''s from the dev (2.6.7) and prod (2.6.2) environments. I then upgraded prod to 2.6.7 and applied the diff. For what it''s worth, here''s the SQL I had to execute. Usual disclaimers on you mileage here :) ALTER TABLE resources ADD KEY `exported_restype_title` (`exported`,`restype`,`title`(50)); CREATE TABLE `inventory_facts` ( `node_id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `value` text NOT NULL, UNIQUE KEY `index_inventory_facts_on_node_id_and_name` (`node_id`,`name`) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `inventory_nodes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `timestamp` datetime NOT NULL, `updated_at` datetime DEFAULT NULL, `created_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `index_inventory_nodes_on_name` (`name`) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; I can see data going into the DB from the latest runs, and I can curl the inventory service, so it seems ok. Setting up Dashboard 1.1.0 as we speak :) HTH, Greg -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Patrick
2011-Apr-12 15:51 UTC
Re: [Puppet Users] Re: How to setup database for Inventory Service
On Apr 12, 2011, at 4:16 AM, Greg Sutcliffe wrote:> Since I don;t want to lose my historical data in production,What''s that mean exactly? Are you saying you don''t want to drop reports while the DB is being migrated? -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Alessandro Franceschi
2011-Apr-18 17:00 UTC
[Puppet Users] Re: How to setup database for Inventory Service
Thank you for the feedback. I''ve momentarily postponed the inventory setup but, for the chronicle, just inserting the query you posted didn''t work out of the box. I''ll get back on this when sorted out other things. Al On Tuesday, April 12, 2011 1:16:07 PM UTC+2, Greg Sutcliffe wrote:> > Heya, > > I''ve merged both approaches. First, I dropped the db on my development > server, and then let puppet recreate it. Since I don;t want to lose my > historical data in production, I then dumped and compared the schema''s from > the dev (2.6.7) and prod (2.6.2) environments. I then upgraded prod to 2.6.7 > and applied the diff. > > For what it''s worth, here''s the SQL I had to execute. Usual disclaimers on > you mileage here :) > > ALTER TABLE resources ADD KEY `exported_restype_title` > (`exported`,`restype`,`title`(50)); > > CREATE TABLE `inventory_facts` ( > `node_id` int(11) NOT NULL, > `name` varchar(255) NOT NULL, > `value` text NOT NULL, > UNIQUE KEY `index_inventory_facts_on_node_id_and_name` (`node_id`,`name`) > ENGINE=InnoDB DEFAULT CHARSET=utf8; > > CREATE TABLE `inventory_nodes` ( > `id` int(11) NOT NULL AUTO_INCREMENT, > `name` varchar(255) NOT NULL, > `timestamp` datetime NOT NULL, > `updated_at` datetime DEFAULT NULL, > `created_at` datetime DEFAULT NULL, > PRIMARY KEY (`id`), > UNIQUE KEY `index_inventory_nodes_on_name` (`name`) > ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; > > I can see data going into the DB from the latest runs, and I can curl the > inventory service, so it seems ok. Setting up Dashboard 1.1.0 as we speak :) > > HTH, > Greg >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
James Turnbull
2011-May-04 23:31 UTC
Re: [Puppet Users] Re: How to setup database for Inventory Service
Alessandro Franceschi wrote:> Thank you for the feedback. > I''ve momentarily postponed the inventory setup but, for the chronicle, > just inserting the query you posted didn''t work out of the box. > I''ll get back on this when sorted out other things. > Al >Al You should also be able to do: [master] dbmigrate=true In your puppet.conf and Puppet will automatically add the tables. Regards James Turnbull -- James Turnbull Puppet Labs 1-503-734-8571 -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Alessandro Franceschi
2011-May-05 09:13 UTC
[Puppet Users] Re: How to setup database for Inventory Service
Actually I ended up creating manually the missing tables, but thanks for the info. On May 5, 1:31 am, James Turnbull <ja...@puppetlabs.com> wrote:> Alessandro Franceschi wrote: > > Thank you for the feedback. > > I''ve momentarily postponed theinventorysetupbut, for the chronicle, > > just inserting the query you posted didn''t work out of the box. > > I''ll get back on this when sorted out other things. > > Al > > Al > > You should also be able to do: > > [master] > dbmigrate=true > > In your puppet.conf and Puppet will automatically add the tables. > > Regards > > James Turnbull > > -- > James Turnbull > Puppet Labs > 1-503-734-8571-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.