You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
ansible-role-nginx/hadoop/roles/hadoop_primary/tasks/hadoop_master.yml

38 lines
1.3 KiB

---
# Playbook for Hadoop master servers
- name: Install the namenode and jobtracker packages
yum: name={{ item }} state=installed
with_items:
- hadoop-0.20-mapreduce-jobtrackerha
- hadoop-hdfs-namenode
- hadoop-hdfs-zkfc
- hadoop-0.20-mapreduce-zkfc
- name: Copy the hadoop configuration files
template: src=roles/common/templates/hadoop_ha_conf/{{ item }}.j2 dest=/etc/hadoop/conf/{{ item }}
with_items:
- core-site.xml
- hadoop-metrics.properties
- hadoop-metrics2.properties
- hdfs-site.xml
- log4j.properties
- mapred-site.xml
- slaves
- ssl-client.xml.example
- ssl-server.xml.example
notify: restart hadoopha master services
- name: Create the data directory for the namenode metadata
file: path={{ item }} owner=hdfs group=hdfs state=directory
with_items: hadoop.dfs_namenode_name_dir
- name: Create the data directory for the jobtracker ha
file: path={{ item }} owner=mapred group=mapred state=directory
with_items: hadoop.mapred_job_tracker_persist_jobstatus_dir
- name: Format the namenode
shell: creates=/usr/lib/hadoop/namenode.formatted su - hdfs -c "hadoop namenode -format"; touch /usr/lib/hadoop/namenode.formatted
- name: start hadoop namenode services
service: name=hadoop-hdfs-namenode state=started