The Alluxio shell contains multiple command line operations that interact with Alluxio.
alluxio fs ls /
alluxio fs copyFromLocal /home/test_input.txt /test_input.txt
Copied file:///home/test_input.txt to /test_input.txt
alluxio fs ls /
12 PERSISTED 11-28-2019 17:10:17:449 100% /test_input.txt
The test_input.txt file is displayed in Alluxio. The parameters in the file indicate the file size, whether the file is persistent, creation date, cache ratio of the file in Alluxio, and file name.
alluxio fs cat /test_input.txt
Test Alluxio
Alluxio uses a unified namespace feature to unify the access to storage systems. For details, see https://docs.alluxio.io/os/user/2.0/en/advanced/Namespace-Management.html.
This feature allows users to mount different storage systems to an Alluxio namespace and seamlessly access files across storage systems through the Alluxio namespace.
Mounted obs://obs-mrstest/data at /mnt/obs
38 PERSISTED 11-28-2019 17:42:54:554 0% /mnt/obs/hive_load.txt 12 PERSISTED 11-28-2019 17:43:07:743 0% /mnt/obs/test_input.txt
You can also view the newly mounted files and directories on the Alluxio web UI.
0 PERSISTED 11-28-2019 11:15:19:719 DIR /app-logs 1 PERSISTED 11-28-2019 11:18:36:885 DIR /apps 1 PERSISTED 11-28-2019 11:18:40:209 DIR /apps/templeton 239440292 PERSISTED 11-28-2019 11:18:40:209 0% /apps/templeton/hive.tar.gz ..... 1 PERSISTED 11-28-2019 19:00:23:879 DIR /mnt 2 PERSISTED 11-28-2019 19:00:23:879 DIR /mnt/obs 38 PERSISTED 11-28-2019 17:42:54:554 0% /mnt/obs/hive_load.txt 12 PERSISTED 11-28-2019 17:43:07:743 0% /mnt/obs/test_input.txt .....
The command output shows all files that are from the mounted storage system in the root directory of the Alluxio file system (the default directory is the HDFS root directory, that is, hdfs://hacluster/). The /app-logs and /apps directories are in HDFS, and the /mnt/obs/ directory is in OBS.
Alluxio can accelerate data access, because it uses memory to store data. Example commands are provided as follows:
294520189 PERSISTED 11-28-2019 19:38:55:000 0% /mnt/obs/test_data.csv
The output indicates that the cache percentage of the file in Alluxio is 0%, that is, the file is not in Alluxio memory.
294520189 PERSISTED 11-28-2019 19:38:55:000 100% /mnt/obs/test_data.csv
The output shows that the file has been fully loaded to Alluxio.
59510 real 0m5.777s user 0m5.992s sys 0m0.592s
According to the comparison of the two time consumption records, the time consumed for accessing data stored in Alluxio memory is significantly reduced.