puppetdb 搭建

    xiaoxiao2021-04-13  25

    在agent端跑puppet agent -t 正常的情况下,安装puppetdb 参考文档:https://docs.puppet.com/puppetdb/4.4/install_via_module.html

    1. 部署postgresql数据库

    参考文档 :http://www.jianshu.com/p/7e95fd0bc91a

    安装软件包 postgresql94-server :postgresql数据库server postgresql94-contrib:安装管理工具 yum install -y postgresql94-server postgresql94-contrib 初始化数据库 /usr/pgsql-9.4/bin/postgresql94-setup initdb 启动服务 systemctl start postgresql-9.4.service 开机启动 systemctl enable postgresql-9.4.service 创建puppetdb数据库,授权给puppet用户,并设置密码。 $ sudo -u postgres sh $ createuser -DRSP puppetdb $ createdb -E UTF8 -O puppetdb puppetdb $ exit 安装了postgresql-contrib前提下 $ sudo -u postgres sh $ psql puppetdb -c 'create extension pg_trgm' $ exit

    vim /var/lib/pgsql/9.4/data/pg_hba.conf

    # TYPE DATABASE USER CIDR-ADDRESS METHOD local all all md5 host all all 127.0.0.1/32 md5 host all all ::1/128 md5

    重启并验证

    $ service postgresql-9.4 restart $ psql -h localhost puppetdb puppetdb

    2.部署puppetdb

    puppetdb通过插件puppetdb-termini将catalog和facter的相关信息传递给postgresql数据库。

    yum安装puppetdb puppetdb-termini yum install puppets puppetdb-termini 或者 puppet resource package puppetdb ensure=latest puppet resource package puppetdb-termini ensure=latest 更改配置文件 vim /etc/puppetlabs/puppetdb/conf.d/database.ini subname = //localhost:5432/puppetdb username = puppetdb password = puppetdb 在puppet配置文件主目录:puppet config print confdir ===> /etc/puppetlabs/puppetdb/ 生成ssl文件 puppetdb ssl-setup 更改配置文件权限 chown -R puppet:puppet `puppet config print confdir` 重启puppetserver puppetdb systemctl restart puppetdb 验证 服务验证:systemctl status puppetdb 端口验证:lsof -i:8081

    3.建立puppetserver 与puppetdb的链接

    更改puppetserver配置文件 vim puppetdb.conf (新建) [main] server_urls = https://master.puppet.io:8081/ vim puppet.conf [master] storeconfigs = true storeconfigs_backend = puppetdb reports = store,puppetdb vim routes.yaml (新建) --- master: facts: terminus: puppetdb cache: yaml 重启puppetserver puppetdb systemctl restart puppetdb systemctl restart puppetserver 验证 vim /var/log/puppetlabs/puppetdb/puppetdb.log出现如下内容,即证明puppetserver链接puppetdb成功。 2017-03-07 09:46:03,245 INFO [p.p.command] [1b426534-0455-4659-b58d-af4571a41166] [replace facts] master 2017-03-07 09:46:03,398 INFO [p.p.command] [73703af2-4f56-4529-b72a-e26c3a2b6b35] [replace catalog] master
    转载请注明原文地址: https://ju.6miu.com/read-668805.html

    最新回复(0)