EMR の各Hadoopプロセスの起動停止方法

# Upstart使ってます

EMRでの各Hadoopプロセスの起動スクリプトはUpstart形式のようで /etc/init/ 配下に配置されてます。

```
[root@ip-172-31-30-132 init]# ll /etc/init/
total 156
-rw-r--r-- 1 root root  412 Apr  9  2015 control-alt-delete.conf
-rw-r--r-- 1 root root  330 Dec 19 23:22 elastic-network-interfaces.conf
-rw-r--r-- 1 root root 1677 Apr  1 04:35 ganglia-rrdcached.conf
-rw-r--r-- 1 root root 1049 Apr  1 04:35 gmetad.conf
-rw-r--r-- 1 root root  979 Apr  1 04:35 gmond.conf
-rwxr-xr-x 1 root root 2928 Feb 17 18:10 hadoop-hdfs-namenode.conf
-rwxr-xr-x 1 root root 3331 Feb 17 18:10 hadoop-httpfs.conf
-rwxr-xr-x 1 root root 2856 Feb 17 18:10 hadoop-kms.conf
-rwxr-xr-x 1 root root 2989 Feb 17 18:10 hadoop-mapreduce-historyserver.conf
-rwxr-xr-x 1 root root 2944 Feb 17 18:10 hadoop-yarn-proxyserver.conf
-rwxr-xr-x 1 root root 2964 Feb 17 18:10 hadoop-yarn-resourcemanager.conf
-rwxr-xr-x 1 root root 2959 Feb 17 18:10 hadoop-yarn-timelineserver.conf
-rwxr-xr-x 1 root root 3314 Feb 17 18:17 hbase-master.conf
-rwxr-xr-x 1 root root 3302 Feb 17 18:17 hbase-rest.conf
-rwxr-xr-x 1 root root 3314 Feb 17 18:17 hbase-thrift.conf
-rwxr-xr-x 1 root root 2920 Feb 17 18:30 hive-hcatalog-server.conf
-rwxr-xr-x 1 root root 3114 Feb 17 18:30 hive-server2.conf
-rwxr-xr-x 1 root root 2922 Feb 17 18:30 hive-webhcat-server.conf
-rwxr-xr-x 1 root root 4054 Feb 17 18:59 hue.conf
```

```
[root@ip-172-31-30-132 init]# initctl list
rc stop/waiting
tty (/dev/tty3) start/running, process 2855
tty (/dev/tty2) start/running, process 2853
tty (/dev/tty1) start/running, process 2851
tty (/dev/tty6) start/running, process 2862
tty (/dev/tty5) start/running, process 2860
tty (/dev/tty4) start/running, process 2858
hbase-thrift start/running, process 12362
gmetad start/running, process 6955
update-motd stop/waiting
hadoop-mapreduce-historyserver start/running, process 5611
hadoop-yarn-timelineserver start/running, process 4929
hive-server2 start/running, process 15435
plymouth-shutdown stop/waiting
presto-server start/running, process 15790
control-alt-delete stop/waiting
hive-hcatalog-server start/running, process 16669
hive-webhcat-server start/running, process 8223
rcS-emergency stop/waiting
zookeeper-server start/running, process 8375
```

なので停止起動などは Upstart のお作法に沿ってあげましょう

```
[root@ip-172-31-30-132 init]# initctl status hue
hue start/running, process 17451
[root@ip-172-31-30-132 init]# initctl stop hue
hue stop/waiting
[root@ip-172-31-30-132 init]# ps -ef | grep hue
root     32388 13209  0 01:24 pts/0    00:00:00 grep --color=auto hue
[root@ip-172-31-30-132 init]# initctl status hue
hue stop/waiting
[root@ip-172-31-30-132 init]# initctl start hue
hue start/running, process 32488
[root@ip-172-31-30-132 init]# initctl status hue
hue start/running, process 32488
[root@ip-172-31-30-132 init]# ps -ef | grep hue
root     32489     1  2 01:24 ?        00:00:00 python2.7 /usr/lib/hue/build/env/bin/supervisor -p /var/run/hue/supervisor.pid -l /var/log/hue -d
hue      32494 32489 56 01:24 ?        00:00:03 python2.7 /usr/lib/hue/build/env/bin/hue runcherrypyserver
root     32582 13209  0 01:24 pts/0    00:00:00 grep --color=auto hue
```

## 今回は Hue.ini とか修正

Hue 3.11 でS3ブラウジングができなくなってたので、ひとまずアクセスキー・シークレットアクセスキーをコンフィグに書いて動作確認しました。
/etc/hue/conf/hue.ini を修正し、プロセス再起動。

無事閲覧できましたー

<img width="1254" alt="スクリーンショット 0029-04-02 10.58.03.png" src="https://qiita-image-store.s3.amazonaws.com/0/27932/bdd688dd-e3b3-1b89-5247-522c7353b35e.png">