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_no_ha.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-jobtracker
- hadoop-hdfs-namenode
- name: Copy the hadoop configuration files for no ha
template: src=roles/common/templates/hadoop_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 hadoop 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: 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
- name: Give permissions for mapred users
shell: creates=/usr/lib/hadoop/fs.initialized su - hdfs -c "hadoop fs -chown hdfs:hadoop /"; su - hdfs -c "hadoop fs -chmod 0774 /"; touch /usr/lib/hadoop/namenode.initialized
- name: start hadoop jobtracker services
service: name=hadoop-0.20-mapreduce-jobtracker state=started