Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jul 21, 2020
1 parent c60a1ad commit 820bea1
Show file tree
Hide file tree
Showing 6 changed files with 175 additions and 114 deletions.
43 changes: 25 additions & 18 deletions docs/common.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,40 @@

Provides common utility functions

## Overview

Function to populate nodeinfo

Please call this method at start of node bootstrap

## Index

* [populate_nodeinfo()](#populatenodeinfo)
* [is_hadoop2_cluster()](#ishadoop2cluster)
* [is_hs2_enabled()](#ishs2enabled)
* [is_hs2_cluster()](#ishs2cluster)
* [is_master_node()](#ismasternode)
* [is_worker_node()](#isworkernode)


## populate_nodeinfo()
### populate_nodeinfo()

Function to populate nodeinfo

Please call this method at start of node bootstrap

### Example
#### Example

```bash
populate_nodeinfo
```

_Function has no arguments._

## is_hadoop2_cluster()
### is_hadoop2_cluster()

Function to check if the node belongs to a Hadoop2 cluster

### Example
#### Example

```bash
if is_hadoop2_cluster; then
Expand All @@ -38,16 +45,16 @@ fi

_Function has no arguments._

### Exit codes
#### Exit codes

* **0**: If the cluster runs hadoop2
* **1**: Otherwise

## is_hs2_enabled()
### is_hs2_enabled()

Function to check if a HiveServer2 is configured to run on a master node

### Example
#### Example

```bash
if is_hs2_enabled; then
Expand All @@ -57,16 +64,16 @@ fi

_Function has no arguments._

### Exit codes
#### Exit codes

* **0**: When HiveServer2 is configured on a master node
* **1**: Otherwise

## is_hs2_cluster()
### is_hs2_cluster()

Function to check if a node belongs to a HiveServer2 cluster

### Example
#### Example

```bash
if is_hs2_cluster; then
Expand All @@ -76,16 +83,16 @@ fi

_Function has no arguments._

### Exit codes
#### Exit codes

* **0**: When node belongs to a HiveServer2 cluster
* **1**: Otherwise

## is_master_node()
### is_master_node()

Function to check if a node is a cluster master node

### Example
#### Example

```bash
if is_master_node; then
Expand All @@ -95,16 +102,16 @@ fi

_Function has no arguments._

### Exit codes
#### Exit codes

* **0**: When node is a cluster master node
* **1**: Otherwise

## is_worker_node()
### is_worker_node()

Function to check if a node is a cluster worker node

### Example
#### Example

```bash
if is_worker_node; then
Expand All @@ -114,7 +121,7 @@ fi

_Function has no arguments._

### Exit codes
#### Exit codes

* **0**: When node is a cluster worker node
* **1**: Otherwise
Expand Down
32 changes: 20 additions & 12 deletions docs/hadoop.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,56 +2,64 @@

Provides Hadoop2 utility functions

## Overview

Function to restart hadoop services on the cluster master

This may be used if you're using a different version
of Java, for example

## Index

* [restart_master_services()](#restartmasterservices)
* [restart_worker_services()](#restartworkerservices)
* [restart_hadoop_services()](#restarthadoopservices)
* [use_java8()](#usejava8)
* [wait_until_namenode_running()](#waituntilnamenoderunning)


## restart_master_services()
### restart_master_services()

Function to restart hadoop services on the cluster master

This may be used if you're using a different version
of Java, for example

### Example
#### Example

```bash
restart_master_services
```

_Function has no arguments._

## restart_worker_services()
### restart_worker_services()

Function to restart hadoop services on the cluster workers

This only restarts the datanode service since the
nodemanager is started after the bootstrap is run

### Example
#### Example

```bash
restart_worker_services
```

_Function has no arguments._

## restart_hadoop_services()
### restart_hadoop_services()

Generic function to restart hadoop services

### Example
#### Example

```bash
restart_hadoop_services
```

_Function has no arguments._

## use_java8()
### use_java8()

Use Java 8 for hadoop daemons and jobs

Expand All @@ -61,25 +69,25 @@ to use Java 8. This is only required if your cluster:
1. is in AWS, and
2. is running Hive or Spark < 2.2

### Example
#### Example

```bash
use_java8
```

_Function has no arguments._

## wait_until_namenode_running()
### wait_until_namenode_running()

Wait until namenode is out of safe mode

### Example
#### Example

```bash
wait_until_namenode_running 25 5
```

### Arguments
#### Arguments

* **$1** (int): Number of attempts function will make to get namenode out of safemode. Defaults to 50
* **$2** (int): Number of seconds each attempt will sleep for, waiting for namenode to come out of sleep mode. Defaults to 5
Expand Down
Loading

0 comments on commit 820bea1

Please sign in to comment.