保证当前shell的用户为hadoop(如果当前用户已经是hadoop,此步可忽略)

1、切换到root用户。 命令:

sudo /bin/bash

在这里插入图片描述

2、切换到hadoop用户下。 命令:

su - hadoop

在这里插入图片描述