Alluxio 1.8.1

【原创】大数据基础之Alluxio(1)简介、安装、使用-LMLPHP

官方:http://www.alluxio.org/

一 简介

Open Source Memory Speed Virtual Distributed Storage
Alluxio, formerly Tachyon, enables any application to interact with any data from any storage system at memory speed.

alluxio是一个开源的拥有内存访问速度的虚拟分布式存储;之前叫Tachyon,可以使应用像访问内存数据一样访问任何存储系统中的数据。

1 优势

Storage Unification and Abstraction

Alluxio unifies data access to different systems, and seamlessly bridges computation frameworks and underlying storage.

【原创】大数据基础之Alluxio(1)简介、安装、使用-LMLPHP

Remote Data Acceleration

Decouple compute and storage without any loss in performance.

将计算和存储分离,并且不会损失性能;

【原创】大数据基础之Alluxio(1)简介、安装、使用-LMLPHP

2 部署结构

Alluxio can be divided into three components: masters, workers, and clients. A typical setup consists of a single leading master, multiple standby masters, and multiple workers. The master and worker processes constitute the Alluxio servers, which are the components a system administrator would maintain. The clients are used to communicate with the Alluxio servers by applications such as Spark or MapReduce jobs, Alluxio command-line, or the FUSE layer.

alluxio由master、worker组成,其中master如果有多个,只有一个是leading master,其他为standby master;

【原创】大数据基础之Alluxio(1)简介、安装、使用-LMLPHP

3 角色

Master

The Alluxio master service can be deployed as one leading master and several standby masters for fault tolerance. When the leading master goes down, a standby master is elected to become the new leading master.

【原创】大数据基础之Alluxio(1)简介、安装、使用-LMLPHP

1)Leading Master

Only one master process can be the leading master in an Alluxio cluster. The leading master is responsible for managing the global metadata of the system. This includes file system metadata (e.g. the file system inode tree), block metadata (e.g. block locations), and worker capacity metadata (free and used space). Alluxio clients interact with the leading master to read or modify this metadata. All workers periodically send heartbeat information to the leading master to maintain their participation in the cluster. The leading master does not initiate communication with other components; it only responds to requests via RPC services. The leading master records all file system transactions to a distributed persistent storage to allow for recovery of master state information; the set of records is referred to as the journal.

alluxio中只有一个leading master,leading master负责管理所有的元数据,包括文件系统元数据、block元数据和worker元数据;worker会定期向leading master发送心跳;leading master会记录所有的文件操作到日志中;

2)Standby Masters

Standby masters read journals written by the leading master to keep their own copies of the master state up-to-date. They also write journal checkpoints for faster recovery in the future. They do not process any requests from other Alluxio components.

standby master会及时同步读取leader master的日志;

Worker

Alluxio workers are responsible for managing user-configurable local resources allocated to Alluxio (e.g. memory, SSDs, HDDs). Alluxio workers store data as blocks and serve client requests that read or write data by reading or creating new blocks within their local resources. Workers are only responsible for managing blocks; the actual mapping from files to blocks is only stored by the master.

worker负责管理资源,比如内存、ssd等;worker负责将数据存储为block同时响应client的读写请求;实际的file和block的映射关系保存在master中;

【原创】大数据基础之Alluxio(1)简介、安装、使用-LMLPHP

Because RAM usually offers limited capacity, blocks in a worker can be evicted when space is full. Workers employ eviction policies to decide which data to keep in the Alluxio space.

Client

The Alluxio client provides users a gateway to interact with the Alluxio servers. It initiates communication with the leading master to carry out metadata operations and with workers to read and write data that is stored in Alluxio.

client先向leading master请求元数据信息,然后向worker发送读写请求;

二 安装

1 下载

2 配置本机ssh登录

即可以 ssh localhost
详见:https://www.cnblogs.com/barneywill/p/10271679.html

3 配置

4 初始化

5 启动

如果报错:

需要添加sudo权限

三 使用

1 命令行

文件系统操作

看起来和hdfs命令很像

admin操作

查看统计信息

2 UFS(Under File Storage)

UFS=LocalFileSystem

1 默认配置

2 命令示例

With the default configuration, Alluxio uses the local file system as its under file storage (UFS). The default path for the UFS is ./underFSStorage.

Alluxio is currently writing data only into Alluxio space, not to the UFS.Configure Alluxio to persist the file from Alluxio space to the UFS by using the persist command.

Alluxio默认用的是本地文件系统作为UFS,只有执行persist命令之后,文件才会持久化到UFS中;

UFS=HDFS

1 配置

如果你想对hdfs上全部数据进行加速并且路径不变,可以配置为hdfs的根目录

2 配置hadoop

1)链接

Copy or make symbolic links from hdfs-site.xml and core-site.xml from your Hadoop installation into ${ALLUXIO_HOME}/conf

2)直接配置路径

3 命令

可以看到hdfs上所有的目录了

4 文件映射

这时可以通过访问

来访问底层存储

注意:这里需要指定$alluxio_server和端口,存在单点问题,后续ha方式部署之后可以解决这个问题。

3 Spark访问

1 准备:(二选一)

1)配置

This Alluxio client jar file can be found at /<PATH_TO_ALLUXIO>/client/alluxio-1.8.1-client.jar

2)拷贝jar

2 访问

参考:http://www.alluxio.org/docs/1.8/en/compute/Spark.html

4 hive访问

拷贝jar

重启metastore和hiveserver2

5 部署方式

1 集群ha部署

即多worker+多master+zookeeper

1 配置集群服务器间ssh可达

同上

2 配置

将配置同步到集群所有服务器

3 配置masters和workers

4 启动

5 访问方式

如果client启动时增加环境变量

则可以直接这样访问

6 与hdfs互通

拷贝jar

将以下配置添加到 $HADOOP_CONF_DIR/core-site.xml

则可以通过hdfs客户端访问alluxio

参考:http://www.alluxio.org/docs/1.8/en/deploy/Running-Alluxio-On-a-Cluster.html

2 Alluxio on Yarn部署

Alluxio还有很多种部署方式,其中一种是Alluxio on Yarn,对于类似Spark on Yarn的用户来说,非常容易使用Alluxio来加速Spark。

详见:

http://www.alluxio.org/docs/1.8/en/deploy/Running-Alluxio-On-Yarn.html

04-28 20:38