1. 介绍
实际部署alluxio的时候,我们可能都是在非root用户下进行的。但是在其它集群的时候可能会有如下报错,导致无法启动worker.
2016-09-21 00:22:07,124
INFO MASTER Connecting to 10.81.12.166 as appadmin...
2016-09-21 00:22:07,126
INFO MASTER Connecting to 10.81.12.176 as appadmin...
Pseudo-terminal will not be allocated because stdin is not a terminal.
2016-09-21 00:22:07,129
INFO MASTER Connecting to 10.81.12.188 as appadmin...
Pseudo-terminal will not be allocated because stdin is not a terminal.
Pseudo-terminal will not be allocated because stdin is not a terminal.
welcome to best Linux Service!
welcome to best Linux Service!
welcome to best Linux Service!
sudo: no tty present and no askpass program specified
sudo: no tty present and no askpass program specified
Mount failed, not starting worker
Mount failed, not starting worker
sudo: no tty present and no askpass program specified
Mount failed, not starting worker
观察后发现主要是由于没有root权限无法正常挂起内存文件系统。
2. 解决办法
2.1 挂载自己的内存文件系统(可省略)
这部分经过测试可以省略,因为alluxio可自动挂载
我们采用手动的方式先提前挂载好内存文件系统(用sudo或者采用root用户)
在worker节点上均执行以下操作,挂载内存文件系统
mount -t ramfs -o size=100G ramfs /home/appadmin/ramdisk
chown appadmin:appadmin /home/appadmin/ramdisk
2.2 添加sudo权限
在所有节点上,我们给安装alluxio的用户先添加sudo权限。这个修改/etc/sudoers文件即可
2.3 配置root的ssh无密码登入
在master或者standby master 上利用如下操作生成秘钥,然后拷贝公钥到各个节点,注意别忘记修改/etc/ssh/sshd_config文件中的内容。不懂的话参考我hadoop安装的文档
ssh-keygen -t rsa -P ''
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
3. 运行alluxio集群
运行的时候采用SudoMount模式来启动集群
# 首先启动所有master
alluxio-start master
# 然后各个节点上分别启动worker
alluxio-start.sh worker SudoMount
PS: 这里之所以不使用NoMount来启动worker是因为NoMount默认