Puppetdb安装

Puppetdb安装

系统环境:selinux and iptables disabled

Rhel              6.5

Puppet          3.7.5

Ruby              1.8.7

简介:puppetdb是puppet的数据库,能够检索到已生成的数据。提高puppet执行效率

自带的HSQLDB适用在100节点内,所以用pgsql(*递归查询*)

两种方法:第一种复杂,第二种简单,但中间也会有各种问题,必须慢慢排查

一.安装包安装:

a.  安装pgsql数据库:yum  install postgresql-server postgresql

b.  安装puppetdb:yum installpuppetdb  puppetdb-terminus

[[email protected]]# cat  /etc/yum.repos.d/yum.repo

[yum]

name=hello

baseurl=file:///var/www/html/yumsource

gpgcheck=0

[puppet]

name=puppet

baseurl=http://yum.puppetlabs.com/el/6Server/products/x86_64

gpgcheck=0

[ruby]

name=ruby

baseurl=http://yum.puppetlabs.com/el/6Server/dependencies/x86_64

gpgcheck=0

c.  初始化数据库

1)service postgresql  initdb

2)sudo -u postgres sh

createuser –DRSP puppetdb

createdb  –O puppetdb puppetdb

测试:psql -h localhost  -U puppetdb-d puppetdb –W

3)[[email protected] modules]# tail /var/lib/pgsql/data/pg_hba.conf

local   all        all                               trust

# IPv4local connections:

host    all        all         127.0.0.1/32          trust

# IPv6local connections:

host    all        all         ::1/128               trust

4)/etc/init.d/postgresqlrestart

d.配置pgsql

1)puppet  config print hostcert

cp /etc/puppet/ssl/certs/server1.example.com.pem                                         /var/lib/pgsql/data/server.crt

puppet  config print hostprivkey

cp  /etc/puppet/ssl/private_keys/server1.example.com.pem/var/lib/pgsql/data/server.key

chownpostgres.postgres /var/lib/pgsql/data/server.crt                                     chownpostgres.postgres /var/lib/pgsql/data/server.crt

chmod 644  server.crt

chmod 600 server.key

2)打开pgsql的ssl:vimpostgresql.conf

ssl = on                        # (change requiresrestart)

e.初始化puppetdb,使与pgsql连接

1)[[email protected]]# pwd

/etc/puppetdb/conf.d

[[email protected] conf.d]# cat database.ini

[database]

# For the embedded DB: org.hsqldb.jdbcDriver

# For PostgreSQL: org.postgresql.Driver

# Defaults to embedded DB

classname =org.postgresql.Driver

# For the embedded DB: hsqldb

# For PostgreSQL: postgresql

# Defaults to embedded DB

subprotocol = postgresql

# For the embedded DB:file:/path/to/database;hsqldb.tx=mvcc;sql.syntax_pgs=true

# For PostgreSQL: //host:port/databaseName

# Defaults to embedded DB located in <vardir>/db

subname = //localhost:5432/puppetdb?true

# Connect as a specific user

username = puppetdb

# Use a specific password

password = puppetdb

2)

[[email protected] conf.d]# cat jetty.ini

[jetty]

# IP address or hostname to listen for clear-text HTTP. To avoidresolution

# issues, IP addresses are recommended over hostnames.

# Default is `localhost`.

host = server1.example.com

# Port to listen on for clear-text HTTP.

port = 8080

# The following are SSL specific settings. They can be configured

# automatically with the tool `puppetdb ssl-setup`, which isnormally

# ran during package installation.

# IP address to listen on for HTTPS connections. Hostnames can alsobe used

# but are not recommended to avoid DNS resolution issues. To listenon all

# interfaces, use `0.0.0.0`.

ssl-host = 0.0.0.0

# The port to listen on for HTTPS connections

ssl-port = 8081

# Private key path

ssl-key = /etc/puppetdb/ssl/private.pem

# Public certificate path

ssl-cert = /etc/puppetdb/ssl/public.pem

# Certificate authority path

ssl-ca-cert = /etc/puppetdb/ssl/ca.pem

如果上面有关的证书文件没有,可以用此命令生成:

/usr/sbin/puppetdb  ssl-setup

F. 使puppdb结合puppetmaster

[[email protected]]# pwd

/etc/puppet

1)[[email protected] puppet]# cat puppetdb.conf

[main]

server = server1.example.com

port = 8081

2)[[email protected] puppet]# cat routes.yaml

---

master:

facts:

terminus:  puppetdb                                      #中间有个大大的空壳,不空就报错

cache:  yaml

G.启动/重启各种服务:pgsql、puppetmaster、puppetdb

H.测试在agent上运行。看日志有各种和数据库交流的信息。看8080端口:

2015-04-25 16:52:36,854 INFO  [c.p.p.command][e2d1d4aa-75ba-4158-97b4-81630384c80d] [replace facts] server2.example.com

2015-04-25 16:52:36,952 INFO  [c.p.p.command][7de76142-baf8-4bd4-bfbd-e272dce9e248] [replace catalog] server2.example.com

二.模版安装最简单

a.      下载模板:puppet module  installpuppetlabs/puppetdb

b.      Puppet apply –e ‘includepuppetdb’ #安装puppetdb 配置服务,pgsql等

c.      Puppet apply  -e ‘include puppetdb::master::config’ 是puppetmaster使用puppetdb

d.      看日志检测

时间: 2024-08-13 16:12:20

Puppetdb安装的相关文章

安装puppetdb教程

puppetserver安装: 1.所有节点时间同步 2.准备yum源(CentOS7) rpm -Uvh https://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm 3.安装puppet sever  yum install puppetserver 4.启动puppet server systemctl start puppetserver   5.分配内存:  *编辑配置文,添加:vim /etc/sysconfig/

PuppetDB安装指南

PuppetDB安装 ####################################### 2014年6月23日 10:25:36 一.安装要求: 1.JDK1.7或以上版本 2.Puppet3.5.1或更高版本 3.Puppet已配置执行Puppet agent --test没有问题 二.安装步骤 1.puppet源配置好 2.apt-get install puppetdb 3.apt-get install puppet-terminus 三.配置 1.配置/etc/puppet

【跟我学Puppet】1.3 Puppet 3.7 使用PuppetDB做数据仓库

1. 环境准备 OS:CentOS 6.4 关闭selinux和iptables 部署Puppet:1.0 Puppet 3.7部署 安装Puppet源:http://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm 完成PuppetMaster/Agent的部署,证书签署... PuppetDB是一个数据仓库,可以通过RESTful HTTP的方式查询nodes.facter.report.catalog.resources等信息..

puppet5.1 安装与配置

一.Puppet概念 简介 当服务器数量达到一定的规模时,仅依靠人为完成批量部署服务器个资源的配置,运维工作将变得繁琐且容易出错,为了解决这一问题,我们应该怎么办呢?我们可以引入一批工具,这批工具可编写相应的manifests代码,运行它便可以自动完成所有的工作,目前比较流行的运维工具主要有:puppet,ansible, slackstack等,在这我们主要以puppet来展开话题.在一些大型互联网企业中,运维自动化管理着几百甚至上千台服务器,它可以针对多台服务器进行统一操作,例如部署统一软件

安装Windows7系统时,提示:缺少所需的CD/DVD驱动器设备驱动程序

      测试机型:HP probook 430 g3       系统:Windows 7 Pro x64 现在笔记本电脑主板集成的USB口大多为3.0版本,而且一些厂商为了追求PC的轻薄,不再集成光驱,所以我们在安装系统时,一般只能通过U盘或U口外接光驱. 而当我们因为需要(安装OEM系统),在通过刻录软件(如UltraISO)将系统写入U盘或光盘的方式安装系统时,此时问题就可能悄悄出现了:因为Win7官方原版系统没有集成USB3.0驱动,所以可能的报错如下: 点击"浏览"或通过

Windows8.1-KB2999226-x64安装提示 此更新不适用你的计算机

如题 Windows8.1-KB2999226-x64.msu  双击安装 安装提示 此更新不适用你的计算机 . 解决方案: 放在D:\update\目录下 windows键+X  选择  命令提示符(管理员)  一定要是管理员 打开cmd 分别执行下面两句.红色部分就是自己的更新程序了.其他安装同理 例如Windows8.1-KB2919442-x64.msu 等 1    expand –F:* D:\update\Windows8.1-KB2999226-x64.msu D:\update

pip安装提示PermissionError: [WinError 5]错误问题解决

 问题现象 新安装python3.6版本后使用pip安装第三方模块失败,报错信息如下: C:\Users\linyfeng>pip install lxml Collecting lxml Downloading http://pypi.doubanio.com/packages/fb/41/b8d5c869d01fcb77c72d7d226a847a3946034ef19c244ac12920b71cd036/lxml-3.8.0-cp36-cp36m-win32.whl (2.9MB) 10

windows安装TortoiseGit详细使用教程【基础篇】

环境:win8.1 64bit 安装准备: 首先你得安装windows下的git msysgit1.9.5 安装版本控制器客户端tortoisegit  tortoisegit1.8.12.0 [32和64别下载错,不习惯英文的朋友,也可以下个语言包] 一.安装图解: 先安装GIT[一路默认即可] 安装好git以后,右键,会发现菜单多了几项关于GIT的选项 2.安装tortoisegit[一路默认即可] 安装好以后,右键,会发现菜单多了几项关于tortoisegit的选项 到此,安装算完成了,相

在Win10 Anaconda中安装Tensorflow

有需要的朋友可以参考一下 1.安装Anaconda 下载:https://www.continuum.io/downloads,我用的是Python 3.5 下载完以后,安装. 安装完以后,打开Anaconda Prompt,输入清华的仓库镜像,更新包更快: conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config --set show_channel_url