You need to install puppetDB on the same server which is used as puppet master.
There are 2 ways to install puppetDB. You can install it from puppet module or from packages.
Here let's see how to install puppetDB from packages.
sudo wget https://apt.puppetlabs.com/puppetlabs-release-precise.deb
sudo dpkg -i puppetlabs-release-precise.deb
sudo apt-get update
sudo puppet resource package puppetdb ensure=latest
sudo apt-get install puppetdb-terminus
The latest version of puppetDB will be installed which is compatible to your current installed puppet version.
You can install PostgresSQL DB for storing the puppetDB data. However, PuppetDB also supports an embedded HSQLDB database.
Therefore you do not need to install separate database like PostgresSQL. But this embedded HSQLDB will be deprecated in future puppet versions.
If so you need to configure separate PostgresSQL. Here I am using 3.8.7 puppet version. Therefore I am configuring embeded HSQLDB.
Add these lines to the [master]section of /etc/puppet/puppet.conf, :
storeconfigs = true
storeconfigs_backend = puppetdb
Create /etc/puppet/routes.yaml and add following content :
Create /etc/puppet/puppetdb.conf and add following content :
server = name.of.server
port = 8081
sudo puppet resource service puppetdb ensure=running enable=true
You must also configure your PuppetDB server’s firewall to accept incoming connections on port 8081 since this puppetDB runs on port 8081.
You may run following command. It will updated the jetty.ini file accordingly.
sudo /usr/sbin/puppetdb ssl-setup
for i in puppetdb puppetmaster ; do sudo service $i restart ; done
Now you have succesfully installed PuppetDB.