Advertisement
Guest User

Untitled

a guest
Apr 4th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.71 KB | None | 0 0
  1. > pwd
  2. /etc/puppetlabs/puppetdb
  3.  
  4. > netstat -tunlep | grep 5432
  5. tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 492 98017 15770/postmaster
  6.  
  7. > grep -i 5432 -r /etc/puppetlabs/*
  8. /etc/puppetlabs/console-auth/database.yml: port: 5432
  9. /etc/puppetlabs/installer/database_info.install:q_database_port=5432
  10. /etc/puppetlabs/installer/answers.install:q_database_port=5432
  11. /etc/puppetlabs/puppet-dashboard/database.yml: port: 5432
  12. /etc/puppetlabs/puppetdb/conf.d/database.ini:subname = //makeittotop-gmail-com2.mylabserver.com:5432/pe-puppetdb
  13. /etc/puppetlabs/rubycas-server/config.yml: port: 5432
  14. /etc/puppetlabs/rubycas-server/config.yml: port: 5432
  15.  
  16. > cat conf.d/database.ini
  17. [database]
  18. # For the embedded DB: org.hsqldb.jdbcDriver
  19. # For PostgreSQL: org.postgresql.Driver
  20. # Defaults to embedded DB
  21. classname = org.postgresql.Driver
  22.  
  23. # For the embedded DB: hsqldb
  24. # For PostgreSQL: postgresql
  25. # Defaults to embedded DB
  26. subprotocol = postgresql
  27.  
  28. # For the embedded DB: file:/path/to/database;hsqldb.tx=mvcc;sql.syntax_pgs=true
  29. # For PostgreSQL: //host:port/databaseName
  30. # Defaults to embedded DB located in <vardir>/db
  31. subname = //makeittotop-gmail-com2.mylabserver.com:5432/pe-puppetdb
  32.  
  33. # Connect as a specific user
  34. # username = foobar
  35. username = pe-puppetdb
  36.  
  37. # Use a specific password
  38. # password = foobar
  39. password = m38RUmh6TSewBshB30Be-Q
  40.  
  41. # How often (in minutes) to compact the database
  42. # gc-interval = 60
  43. gc-interval = 60
  44.  
  45. # Number of seconds before any SQL query is considered 'slow'; offending
  46. # queries will not be interrupted, but will be logged at the WARN log level.
  47. log-slow-statements = 10
  48. syntax_pgs = true
  49. node-ttl = 7d
  50. node-purge-ttl = 0s
  51. report-ttl = 14d
  52.  
  53. > psql -h localhost -p 5432 -U pe-puppetdb
  54. Password for user pe-puppetdb:
  55. psql (8.4.20, server 9.2.7)
  56. WARNING: psql version 8.4, server version 9.2.
  57. Some psql features might not work.
  58. Type "help" for help.
  59.  
  60. pe-puppetdb=> /l
  61. pe-puppetdb-> ;
  62. ERROR: syntax error at or near "/"
  63. LINE 1: /l
  64. ^
  65. pe-puppetdb=> \l
  66. List of databases
  67. Name | Owner | Encoding | Collation | Ctype | Access privileges
  68. --------------+--------------+----------+------------+------------+---------------------------------
  69. console | console | UTF8 | en_US.utf8 | en_US.utf8 |
  70. console_auth | console_auth | UTF8 | en_US.utf8 | en_US.utf8 |
  71. pe-postgres | pe-postgres | UTF8 | en_US.UTF8 | en_US.UTF8 |
  72. pe-puppetdb | pe-puppetdb | UTF8 | en_US.utf8 | en_US.utf8 |
  73. template0 | pe-postgres | UTF8 | en_US.UTF8 | en_US.UTF8 | =c/"pe-postgres"
  74. : "pe-postgres"=CTc/"pe-postgres"
  75. template1 | pe-postgres | UTF8 | en_US.UTF8 | en_US.UTF8 | =c/"pe-postgres"
  76. : "pe-postgres"=CTc/"pe-postgres"
  77. (6 rows)
  78.  
  79. pe-puppetdb=> \c pe-puppetdb
  80. psql (8.4.20, server 9.2.7)
  81. WARNING: psql version 8.4, server version 9.2.
  82. Some psql features might not work.
  83. You are now connected to database "pe-puppetdb".
  84. pe-puppetdb=> \dt
  85. List of relations
  86. Schema | Name | Type | Owner
  87. --------+-------------------------+-------+-------------
  88. public | catalog_resources | table | pe-puppetdb
  89. public | catalogs | table | pe-puppetdb
  90. public | certname_facts | table | pe-puppetdb
  91. public | certname_facts_metadata | table | pe-puppetdb
  92. public | certnames | table | pe-puppetdb
  93. public | edges | table | pe-puppetdb
  94. public | latest_reports | table | pe-puppetdb
  95. public | reports | table | pe-puppetdb
  96. public | resource_events | table | pe-puppetdb
  97. public | resource_params | table | pe-puppetdb
  98. public | resource_params_cache | table | pe-puppetdb
  99. public | schema_migrations | table | pe-puppetdb
  100. (12 rows)
  101.  
  102. pe-puppetdb=> \dt reports
  103. List of relations
  104. Schema | Name | Type | Owner
  105. --------+---------+-------+-------------
  106. public | reports | table | pe-puppetdb
  107. (1 row)
  108.  
  109. pe-puppetdb=> \d reports
  110. Table "public.reports"
  111. Column | Type | Modifiers
  112. -----------------------+--------------------------+---------------------------------
  113. hash | character varying(40) | not null
  114. certname | text |
  115. puppet_version | character varying(255) | not null
  116. report_format | smallint | not null
  117. configuration_version | character varying(255) | not null
  118. start_time | timestamp with time zone | not null
  119. end_time | timestamp with time zone | not null
  120. receive_time | timestamp with time zone | not null
  121. transaction_uuid | character varying(255) | default NULL::character varying
  122. Indexes:
  123. "reports_pkey" PRIMARY KEY, btree (hash)
  124. "idx_reports_certname" btree (certname)
  125. "idx_reports_end_time" btree (end_time)
  126. "idx_reports_transaction_uuid" btree (transaction_uuid)
  127. Foreign-key constraints:
  128. "reports_certname_fkey" FOREIGN KEY (certname) REFERENCES certnames(name) ON DELETE CASCADE
  129. Referenced by:
  130. TABLE "latest_reports" CONSTRAINT "latest_reports_report_fkey" FOREIGN KEY (report) REFERENCES reports(hash) ON DELETE CASCADE
  131. TABLE "resource_events" CONSTRAINT "resource_events_report_fkey" FOREIGN KEY (report) REFERENCES reports(hash) ON DELETE CASCADE
  132.  
  133. pe-puppetdb=> select * from certnames;
  134. name | deactivated
  135. ----------------------------------------+-------------
  136. makeitt-com2.labserver.com |
  137. (1 row)
  138.  
  139. pe-puppetdb=>
  140. pe-puppetdb=> \q
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement