使用sudo命令,提示“hadoop is not in the sudoers file.”时:
1.使用root用户登录:su - root
2.打开/etc目录:cd /etc
3.为root用户授权/etc/sudoers文件的写权限:chmod u+w /etc/sudoers
4.编辑sudoers文件:vim /etc/sudoers
5.通过?root命令找到root ALL=(ALL)ALL行,在下一行添加hadooptest ALL=(ALL)ALL行
6.将root用户对sudoers文件的写权限取消:chmod u-w /etc/sudoers
7.登回hadooptest用户,使用sudo命令测试是否成功。