Alluxio HA 安装
Alluxio is a memory speed virtual distributed storage system.Alluxio是一个开源的基于内存的分布式存储系统,现在成为开源社区中成长最快的大数据开源项目之一。
alluxio下载地址https://www.alluxio.org/download
考虑系统的可用性,对Alluxio Master做HA,具体步骤如下:
-1. 在alluxio-env.sh 中添加zookeeper的信息,并附上hdfs的路径。如果是单机的alluxio master,就不需要hdfs作为alluxio的存储。但是对于Master HA的模式,就需要共享文件路径来存放文件,就选择hdfs作为master的信息存储
cat alluxio-env.sh JAVA_HOME=/usr/local/jvm/jdk1.7.0_75ALLUXIO_HOME=/data1/alluxio-1.4.0ALLUXIO_RAM_FOLDER=/data1/alluxio-1.4.0/ramdiskALLUXIO_UNDERFS_ADDRESS=/data1/alluxio-dataALLUXIO_WORKER_MEMORY_SIZE=1000MBALLUXIO_JAVA_OPTS="-Dalluxio.zookeeper.enabled=true -Dalluxio.zookeeper.address=192.168.101.72:2181,192.168.101.73:2181,192.168.101.74:2181 -Dalluxio.master.journal.folder=hdfs://liangbeta/user/hadoop/alluxio/journal"
-2. 在alluxio-site.properties 中也添加zookeeper的信息,并附上hdfs的路径
# cat alluxio-site.properties alluxio.worker.tieredstore.levels=2alluxio.worker.tieredstore.level0.alias=MEMalluxio.worker.tieredstore.level0.dirs.path=/mnt/ramdiskalluxio.worker.tieredstore.level0.dirs.quota=1GBalluxio.worker.tieredstore.level0.watermark.high.ratio=0.9alluxio.worker.tieredstore.level0.watermark.low.ratio=0.7alluxio.worker.tieredstore.level1.alias=HDDalluxio.worker.tieredstore.level1.dirs.path=/data1/alluxio-dataalluxio.worker.tieredstore.level1.dirs.quota=500GBalluxio.worker.tieredstore.level1.watermark.high.ratio=0.9alluxio.worker.tieredstore.level1.watermark.low.ratio=0.7~HA相关设置~alluxio.zookeeper.enabled=truealluxio.zookeeper.address=192.168.101.72:2181,192.168.101.73:2181,192.168.101.74:2181alluxio.master.journal.folder=hdfs://liangbeta/user/hadoop/alluxio/journalalluxio.worker.block.heartbeat.timeout.ms=300000~~~
-3. 配置文件中,涉及到hdfs的目录,需要创建一下
su - hdfshdfs dfs -mkdir -p /user/hadoop/alluxio/journalhdfs dfs -chown alluxio:hadoop /user/hadoop/alluxiohdfs://liangbeta/user/hadoop/alluxio/journal
-4. 设置一下/etc/profile
export JAVA_HOME=/usr/local/jvm/jdk1.7.0_75export HADOOP_HOME=/usr/local/hadoop/hadoop-releaseexport HADOOP_CONF_DIR=/usr/local/hadoop/hadoop-release/etc/hadoopexport ALLUXIO_HOME=/data1/alluxio-1.4.0export PATH=$HADOOP_HOME/sbin:$HADOOP_HOME/bin:$JAVA_HOME/bin:$ALLUXIO_HOME/bin:$PATH
-5. 需要把hadoop的 core-site.xml和hdfs-site.xml需要拷贝到alluxio conf下
-# ls /data1/alluxio-1.4.0/confalluxio-env.sh alluxio-site.properties core-site.xml hdfs-site.xml log4j.properties workers
-6. 对于新搭建的集群,需要对master和worker进行format才能启动服务。
格式化master
Format Masteralluxio format
格式化worker
Format Workeralluxio formatWorker
-7. 给Worker机器加上起Worker服务的用户的免密sudo权限, 不然在启动worker的时候需要输入alluxio的密码
在/etc/sudoers中添加如下内容
ALL=(ALL) NOPASSWD: ALL实际设置如下:alluxio ALL=(ALL) NOPASSWD: ALL
-8. 这里要特别强调,由于安全需求,大数据环境,都是通过kerberos进行认证的,需要在KDC上创建alluxio用户,并生成keytab,拷贝到alluxio服务器上,创建定时任务,进行kinit
$ iduid=1100(alluxio) gid=1091(hadoop) groups=1091(hadoop)$ crontab -l0 * * * * kinit -kt /etc/security/keytab/alluxio.keytab alluxio$ klistTicket cache: FILE:/tmp/krb5cc_1100Default principal: alluxio@LIANG.COMValid starting Expires Service principal12/26/17 18:00:01 12/27/17 18:00:01 krbtgt/LIANG.COM@LIANG.COM renew until 12/26/17 18:00:01
-9. 启动Mastersh alluxio-start.sh master
-10. 启动Workersh alluxio-start.sh worker
-11. 启动关闭Proxy
Alluxio proxy进程可以向外提供REST接口,可以在master节点和worker节点上启动。
目前我们在master节点和worker节点上都启动了proxy进程。sh alluxio-start.sh proxy
-12. 启动之后,可以通过网页查询
-13. worker信息页面
-14. 创建的目录,在Browse页,可以看到
-15. 创建一个/user/test目录
$ alluxio fs mkdir /user/testSuccessfully created directory /user/test
-16. Alluxio命令汇总
启动关闭Master
sh alluxio-start.sh mastersh alluxio-stop.sh master
启动关闭Worker
sh alluxio-start.sh workersh alluxio-stop.sh worker
启动关闭Proxy
sh alluxio-start.sh proxysh alluxio-stop.sh proxy
-17. 新建目录及授权方法
检查启动alluxio的用户
ps -ef|grep alluxio
切换到用户su - alluxio
创建用户alluxio fs mkdir <path>
为用户赋权alluxio fs chown <user> <path>
Updated on 2018-4-3
需要注意的是,在worker的配置上,需要配置alluxio-site.properties文件,设置alluxio的访问层级,不然,默认只是使用memory,不会使用SSD或者磁盘
cat alluxio-site.propertiesalluxio.worker.tieredstore.levels=2alluxio.worker.tieredstore.level0.alias=MEMalluxio.worker.tieredstore.level0.dirs.path=/data1/alluxio-ramdiskalluxio.worker.tieredstore.level0.dirs.quota=20GBalluxio.worker.tieredstore.level0.watermark.high.ratio=0.9alluxio.worker.tieredstore.level0.watermark.low.ratio=0.7alluxio.worker.tieredstore.level1.alias=SSDalluxio.worker.tieredstore.level1.dirs.path=/data1/alluxio-dataalluxio.worker.tieredstore.level1.dirs.quota=450GBalluxio.worker.tieredstore.level1.watermark.high.ratio=0.9alluxio.worker.tieredstore.level1.watermark.low.ratio=0.7-# User properties-# alluxio.user.file.readtype.default=CACHE_PROMOTE-# alluxio.user.file.writetype.default=MUST_CACHE-# HAalluxio.zookeeper.enabled=truealluxio.zookeeper.address=zookeeper1:2181,zookeeper2:2181,zookeeper3:2181alluxio.master.journal.folder=hdfs://lialng/user/alluxio/journalalluxio.worker.block.heartbeat.timeout.ms=300000存储层级问题,参考链接:https://blog.csdn.net/lipeng_bigdata/article/details/50948184