Commit d7594306 authored by Austin Blatt's avatar Austin Blatt

Merge 6.0.x into master

parents a664281b 82fa815c
......@@ -41,7 +41,7 @@ command line by using the [PuppetDB CLI][cli_install] or using [curl][curl].
**Without SSL:**
puppet query '<PQL query>' \
--urls http://puppetdb.example.com:8080/pdb/query/v4
--urls http://puppetdb.example.com:8080
This requires that PuppetDB be
[configured to accept non-SSL connections][config_jetty]. By default, it will
......@@ -50,7 +50,7 @@ only accept unencrypted traffic from `localhost`.
**With SSL:**
puppet query '<PQL query>' \
--urls https://puppetdb.example.com:8081/pdb/query/v4 \
--urls https://puppetdb.example.com:8081 \
--cacert /etc/puppetlabs/puppet/ssl/certs/ca.pem \
--cert /etc/puppetlabs/puppet/ssl/certs/thisnode.pem \
--key /etc/puppetlabs/puppet/ssl/private_keys/thisnode.pem
......
......@@ -31,7 +31,7 @@ The following examples use the PuppetDB CLI to execute a query:
**Without SSL:**
puppet query 'nodes { certname = "macbook-pro.local" }' \
--urls http://puppetdb.example.com:8080/pdb/query/v4
--urls http://puppetdb.example.com:8080
This requires that PuppetDB be
[configured to accept non-SSL connections][config_jetty]. By default, it will
......@@ -40,7 +40,7 @@ only accept unencrypted traffic from `localhost`.
**With SSL:**
puppet query 'nodes { certname = "macbook-pro.local" }' \
--urls https://puppetdb.example.com:8081/pdb/query/v4 \
--urls https://puppetdb.example.com:8081 \
--cacert /etc/puppetlabs/puppet/ssl/certs/ca.pem \
--cert /etc/puppetlabs/puppet/ssl/certs/thisnode.pem \
--key /etc/puppetlabs/puppet/ssl/private_keys/thisnode.pem
......
......@@ -59,6 +59,25 @@ Note that if you run it from the source tree via leiningen, you should
make sure to use trampoline, i.e. `lein trampoline run benchmark ...`
so that the tool can shut down and clean up normally.
### Running on an agent other than master
Running the PuppetDB benchmark tool on the master can cause resource constraints
which may significantly skew performance on the master. If you would like to run
the benchmark tool on an agent this can be achieved following the instructions
below.
* On the master, modify `/etc/puppetlabs/puppetdb/conf.d/jetty.ini`.
In the `[jetty]` section, set either:
* `host=0.0.0.0 # http access from all agents`
* `host=<agent ip address> # access from specific agent`
* Install java on the agent
* On the agent, in the `config.ini` file set the port to the puppetdb port for
http traffic (defaults to 8080)
Once these steps have been completed you should be able to run the benchmark
tool on the agent using the `java -cp ...` command described above.
### Arguments accepted by the benchmark command
- **`--config / -c`**: path to the INI file that has the host/port configuration
......
......@@ -7,7 +7,7 @@
msgid ""
msgstr ""
"Project-Id-Version: puppetlabs.puppetdb \n"
"X-Git-Ref: 56265591fe165114839fc75ee38c14ada53ab53d\n"
"X-Git-Ref: d0c8cda74e918be186e7787baf619a78f33348af\n"
"Report-Msgid-Bugs-To: docs@puppet.com\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
......@@ -155,6 +155,10 @@ msgstr ""
msgid "Error while running package gc"
msgstr ""
#: src/puppetlabs/puppetdb/cli/services.clj
msgid "Error while sweeping resource events"
msgstr ""
#: src/puppetlabs/puppetdb/cli/services.clj
msgid "database garbage collection"
msgstr ""
......@@ -216,6 +220,10 @@ msgstr ""
msgid "[{0}-{1}] [{2} ms] ''{3}'' puppet v{4} command processed for {5}"
msgstr ""
#: src/puppetlabs/puppetdb/command.clj
msgid "[{0}-{1}] [{2} ms] ''{3}'' command ignored (obsolete) for {4}"
msgstr ""
#: src/puppetlabs/puppetdb/command.clj
msgid "[{0}-{1}] [{2} ms] ''{3}'' command processed for {4}"
msgstr ""
......@@ -733,6 +741,7 @@ msgid "{0} requires exactly two arguments, but {1} were supplied"
msgstr ""
#: src/puppetlabs/puppetdb/query.clj
#: src/puppetlabs/puppetdb/query_eng/engine.clj
msgid "''{0}'' is not a valid timestamp value"
msgstr ""
......
......@@ -177,6 +177,10 @@
(catch Exception e
(log/error e (trs "Error while running package gc")))))
(defn gc-resource-events!
[]
(trs "Error while sweeping resource events"))
(defn garbage-collect!
"Perform garbage collection on `db`, which means deleting any orphaned data.
This basically just wraps the corresponding scf.storage function with some
......
......@@ -268,10 +268,17 @@
(let [id (str id)
received-time (str (tcoerce/to-long received-time))
duration (str (in-millis (interval start-time (now))))
command-name (command-names command-kw)]
(if-let [{:keys [puppet-version]} opts]
command-name (command-names command-kw)
puppet-version (:puppet-version opts)
obsolete-cmd? (:obsolete-cmd? opts)]
(cond
puppet-version
(log/info (trs "[{0}-{1}] [{2} ms] ''{3}'' puppet v{4} command processed for {5}"
id received-time duration command-name puppet-version certname))
obsolete-cmd?
(log/info (trs "[{0}-{1}] [{2} ms] ''{3}'' command ignored (obsolete) for {4}"
id received-time duration command-name certname))
:else
(log/info (trs "[{0}-{1}] [{2} ms] ''{3}'' command processed for {4}"
id received-time duration command-name certname)))))
......@@ -485,8 +492,9 @@
"Processes a command ref marked for deletion. This is similar to
processing a non-delete cmdref except different metrics need to be
updated to indicate the difference in command"
[{:keys [command version] :as cmdref} q scf-write-db response-chan stats]
[{:keys [command version certname id received] :as cmdref} q scf-write-db response-chan stats]
(process-command-and-respond! cmdref scf-write-db response-chan stats)
(log-command-processed-messsage id received (now) :command-obsolete certname {:obsolete-cmd? true})
(queue/ack-command q {:entry (queue/cmdref->entry cmdref)})
(update-counter! :depth command version dec!)
(update-counter! :invalidated command version dec!))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment