master.yml 1.3 KB
Newer Older
1
---
2
  - name: Copy Apache HDFS init script.
3
    template: src=hdfs-init.j2 dest=/etc/init.d/hdfs-init owner=hduser group=lambda mode=0740
4 5

  - name: Copy Apache Yarn init script.
6
    template: src=yarn-init.j2 dest=/etc/init.d/yarn-init owner=hduser group=lambda mode=0740
7

8
  - name: Format Apache HDFS.
9
    shell: su - hduser -c "yes | {{ installation_path }}/hadoop/bin/hadoop namenode -format"
10 11 12 13
    tags:
      - format-hdfs

  - name: Start Apache HDFS.
14
    shell: /etc/init.d/hdfs-init start > /dev/null &
15 16 17
    tags:
      - start-hdfs

18 19 20 21 22
  - name: Wait for Apache HDFS to become available.
    wait_for: host="{{ hostvars[inventory_hostname]["internal_ip"] }}" port=9000
    tags:
      - start-hdfs

23
  - name: Start Apache Yarn.
24
    shell: /etc/init.d/yarn-init start > /dev/null &
25 26 27
    tags:
      - start-yarn

28 29 30 31 32
  - name: Wait for Apache Yarn to become available.
    wait_for: host="{{ hostvars[inventory_hostname]["internal_ip"] }}" port=8050 # 8050 is the port of the resource manager.
    tags:
      - start-yarn

33 34 35 36 37 38 39 40 41 42
  - name: Create Apache HDFS user directory.
    command: "{{ installation_path }}/hadoop/bin/hadoop fs -mkdir /user"
    tags:
      - create-dirs

  - name: Create Apache HDFS user/root directory. 
    command: "{{ installation_path }}/hadoop/bin/hadoop fs -mkdir /user/root"
    tags:
      - create-dirs