Fix the hadoop/CDH role.

hadoop-CDH playbook: set the correct variables, add some needed tasks.
This commit is contained in:
Andrea Dell'Amico 2018-01-31 19:40:07 +01:00
parent dc3d36fb00
commit 0a181fe411
3 changed files with 46 additions and 23 deletions

View File

@ -1,10 +1,15 @@
---
cdh_manager_install: False
cdh_version: 5.9.3
#cdh_manager_repo: 'deb https://archive.cloudera.com/cm5/ubuntu/trusty/amd64/cm/dists/trusty-cm{{ cdh_version }}/'
cdh_packages_repo: 'deb [arch=amd64] http://archive.cloudera.com/cm5/ubuntu/trusty/amd64/cm trusty-cm5 contrib'
cdh_manager_repo_url: 'https://archive.cloudera.com/cdh5/ubuntu/trusty/amd64/cdh/cloudera.list'
#cdh_manager_download_url: 'http://archive.cloudera.com/cm5/installer/5.9.3/cloudera-manager-installer.bin'
cdh_use_separate_postgres_db: False
cdh_use_separate_postgres_db: True
cdh_postgres_db_host: localhost
cdh_postgres_db_name: cdh
cdh_postgres_db_user: cdh
cdh_postgres_db_schema: cdh
cdh_postgresql_version: 9.6
cdh_postgresql_version: 9.4
postgresql_jdbc_driver_version: 42.1.4

View File

@ -3,40 +3,31 @@
- name: apt key for the Cloudera Manager repository
apt_key: url=https://archive.cloudera.com/cm5/ubuntu/trusty/amd64/cm/archive.key state=present
- name: Install the Cloudera Manager repository
get_url: url={{ cdh_manager_repo_url }} dest=/etc/apt/sources.list.d/cloudera.list
register: cdh_repo
- name: Update the apt cache
apt: update_cache=yes
when: ( cdh_repo | changed )
- name: Install the Cloudera CDH packages repository
apt_repository: repo='{{ cdh_packages_repo }}' update_cache=yes
- name: Install the CDH Manager server
apt: pkg=cloudera-manager-server state=latest update_cache=yes cache_valid_time=1800
apt: pkg=cloudera-manager-server state=present update_cache=yes cache_valid_time=1800
- name: Install the CDH Manager daemons
apt: pkg=cloudera-manager-daemons state=latest update_cache=yes cache_valid_time=1800
apt: pkg=cloudera-manager-daemons state=present update_cache=yes cache_valid_time=1800
- name: Install the Cloudera Manager DB configuration
template: src=db.properties.j2 dest=/etc/cloudera-scm-server/db.properties mode=0640 owner=cloudera-scm group=cloudera-scm
tags: [ 'cdh', 'hadoop', 'cdh_m_conf' ]
- name: Ensure that the cloudera manager daemon is running and enabled
service: name=cloudera-scm-server state=started enabled=yes
when: cdh_manager_install
tags: [ 'cdh', 'hadoop' ]
- block:
- name: Get the signing key for the postgresql.org repository
apt_key: url=https://www.postgresql.org/media/keys/ACCC4CF8.asc state=present
when: cdh_use_separate_postgres_db
- name: Setup the postgresql.org repository
apt_repository: repo='deb http://apt.postgresql.org/pub/repos/apt/ {{ ansible_lsb.codename }}-pgdg main' update_cache=yes
when: cdh_use_separate_postgres_db
- name: Install the Postgresql client
apt: pkg=postgresql-client-{{ cdh_postgresql_version }} state=latest update_cache=yes cache_valid_time=1800
when: cdh_use_separate_postgres_db
apt: pkg=postgresql-client state=latest update_cache=yes cache_valid_time=1800
- name: Download the jdbc driver
get_url: url=https://jdbc.postgresql.org/download/postgresql-{{ postgresql_jdbc_driver_version }}.jar dest=/srv/postgresql.jar
when: cdh_use_separate_postgres_db
when: cdh_manager_install
tags: [ 'cdh', 'hadoop', 'cdh_manager', 'cdh_pg' ]

View File

@ -0,0 +1,27 @@
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
#
# This file describes the database connection.
#
# The database type
# Currently 'mysql', 'postgresql' and 'oracle' are valid databases.
com.cloudera.cmf.db.type=postgresql
# The database host
# If a non standard port is needed, use 'hostname:port'
com.cloudera.cmf.db.host={{ cdh_postgres_db_host }}
# The database name
com.cloudera.cmf.db.name={{ cdh_postgres_db_name }}
# The database user
com.cloudera.cmf.db.user={{ cdh_postgres_db_user }}
# The database user's password
com.cloudera.cmf.db.password={{ cdh_postgres_db_pwd }}
# The db setup type
# By default, it is set to INIT
# If scm-server uses Embedded DB then it is set to EMBEDDED
# If scm-server uses External DB then it is set to EXTERNAL
com.cloudera.cmf.db.setupType=EXTERNAL