Alluxio HA 安装

Alluxio is a memory speed virtual distributed storage system.Alluxio是一个开源的基于内存的分布式存储系统,现在成为开源社区中成长最快的大数据开源项目之一。
Alluxio HA 安装

alluxio下载地址https://www.alluxio.org/download

Alluxio HA 安装
考虑系统的可用性,对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_75
ALLUXIO_HOME=/data1/alluxio-1.4.0
ALLUXIO_RAM_FOLDER=/data1/alluxio-1.4.0/ramdisk
ALLUXIO_UNDERFS_ADDRESS=/data1/alluxio-data
ALLUXIO_WORKER_MEMORY_SIZE=1000MB
ALLUXIO_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=2
alluxio.worker.tieredstore.level0.alias=MEM
alluxio.worker.tieredstore.level0.dirs.path=/mnt/ramdisk
alluxio.worker.tieredstore.level0.dirs.quota=1GB
alluxio.worker.tieredstore.level0.watermark.high.ratio=0.9
alluxio.worker.tieredstore.level0.watermark.low.ratio=0.7
alluxio.worker.tieredstore.level1.alias=HDD
alluxio.worker.tieredstore.level1.dirs.path=/data1/alluxio-data
alluxio.worker.tieredstore.level1.dirs.quota=500GB
alluxio.worker.tieredstore.level1.watermark.high.ratio=0.9
alluxio.worker.tieredstore.level1.watermark.low.ratio=0.7
~HA相关设置~
alluxio.zookeeper.enabled=true
alluxio.zookeeper.address=192.168.101.72:2181,192.168.101.73:2181,192.168.101.74:2181
alluxio.master.journal.folder=hdfs://liangbeta/user/hadoop/alluxio/journal
alluxio.worker.block.heartbeat.timeout.ms=300000
~~~

-3. 配置文件中,涉及到hdfs的目录,需要创建一下

su - hdfs
hdfs dfs -mkdir -p /user/hadoop/alluxio/journal
hdfs dfs -chown alluxio:hadoop /user/hadoop/alluxio
hdfs://liangbeta/user/hadoop/alluxio/journal

-4. 设置一下/etc/profile

export JAVA_HOME=/usr/local/jvm/jdk1.7.0_75
export HADOOP_HOME=/usr/local/hadoop/hadoop-release
export HADOOP_CONF_DIR=/usr/local/hadoop/hadoop-release/etc/hadoop
export ALLUXIO_HOME=/data1/alluxio-1.4.0
export 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/conf
alluxio-env.sh       alluxio-site.properties       core-site.xml        hdfs-site.xml     log4j.properties  workers

-6. 对于新搭建的集群,需要对master和worker进行format才能启动服务。
格式化master

Format Master
alluxio format

格式化worker

Format Worker
alluxio formatWorker

-7. 给Worker机器加上起Worker服务的用户的免密sudo权限, 不然在启动worker的时候需要输入alluxio的密码
在/etc/sudoers中添加如下内容

<user_name> ALL=(ALL)       NOPASSWD: ALL
实际设置如下:
alluxio     ALL=(ALL)       NOPASSWD: ALL

-8. 这里要特别强调,由于安全需求,大数据环境,都是通过kerberos进行认证的,需要在KDC上创建alluxio用户,并生成keytab,拷贝到alluxio服务器上,创建定时任务,进行kinit

$ id
uid=1100(alluxio) gid=1091(hadoop) groups=1091(hadoop)
$ crontab -l
0 * * * *  kinit -kt /etc/security/keytab/alluxio.keytab alluxio

$ klist
Ticket cache: FILE:/tmp/krb5cc_1100
Default principal: alluxio@LIANG.COM

Valid starting     Expires            Service principal
12/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. 启动Master
sh alluxio-start.sh master

-10. 启动Worker
sh alluxio-start.sh worker

-11. 启动关闭Proxy
Alluxio proxy进程可以向外提供REST接口,可以在master节点和worker节点上启动。
目前我们在master节点和worker节点上都启动了proxy进程。
sh alluxio-start.sh proxy

-12. 启动之后,可以通过网页查询
Alluxio HA 安装
-13. worker信息页面
Alluxio HA 安装
-14. 创建的目录,在Browse页,可以看到
Alluxio HA 安装

-15. 创建一个/user/test目录

$ alluxio fs mkdir /user/test
Successfully created directory /user/test 

Alluxio HA 安装
-16. Alluxio命令汇总
启动关闭Master

sh alluxio-start.sh master
sh alluxio-stop.sh master

启动关闭Worker

sh alluxio-start.sh worker
sh alluxio-stop.sh worker

启动关闭Proxy

sh alluxio-start.sh proxy
sh alluxio-stop.sh proxy

-17. 新建目录及授权方法
检查启动alluxio的用户

ps -ef|grep alluxio
切换到用户
su - alluxio
创建用户
alluxio fs mkdir &lt;path&gt;
为用户赋权
alluxio fs chown &lt;user&gt; &lt;path&gt;

Updated on 2018-4-3
需要注意的是,在worker的配置上,需要配置alluxio-site.properties文件,设置alluxio的访问层级,不然,默认只是使用memory,不会使用SSD或者磁盘


cat alluxio-site.properties
alluxio.worker.tieredstore.levels=2
alluxio.worker.tieredstore.level0.alias=MEM
alluxio.worker.tieredstore.level0.dirs.path=/data1/alluxio-ramdisk
alluxio.worker.tieredstore.level0.dirs.quota=20GB
alluxio.worker.tieredstore.level0.watermark.high.ratio=0.9
alluxio.worker.tieredstore.level0.watermark.low.ratio=0.7
alluxio.worker.tieredstore.level1.alias=SSD
alluxio.worker.tieredstore.level1.dirs.path=/data1/alluxio-data
alluxio.worker.tieredstore.level1.dirs.quota=450GB
alluxio.worker.tieredstore.level1.watermark.high.ratio=0.9
alluxio.worker.tieredstore.level1.watermark.low.ratio=0.7

-# User properties
-# alluxio.user.file.readtype.default=CACHE_PROMOTE
-# alluxio.user.file.writetype.default=MUST_CACHE

-# HA
alluxio.zookeeper.enabled=true
alluxio.zookeeper.address=zookeeper1:2181,zookeeper2:2181,zookeeper3:2181

alluxio.master.journal.folder=hdfs://lialng/user/alluxio/journal
alluxio.worker.block.heartbeat.timeout.ms=300000

存储层级问题,参考链接:
https://blog.csdn.net/lipeng_bigdata/article/details/50948184

转载于:https://blog.51cto.com/hsbxxl/2054858

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值