The port number used for accessing the Alluxio file system is 19998, and the access address is alluxio://<Master node IP address of Alluxio>:19998/<PATH>. This section uses examples to describe how to access the Alluxio file system using data applications (Spark, Hive, Hadoop MapReduce, and Presto).
source /opt/client/bigdata_env
kinit MRS cluster user
Example: kinit admin
For example, prepare the input file test_input.txt in the local /home directory, and run the following command to save the test_input.txt file to Alluxio:
alluxio fs copyFromLocal /home/test_input.txt /input
spark-shell
val s = sc.textFile("alluxio://<Name of the Alluxio node>:19998/input")
val double = s.map(line => line + line)
double.saveAsTextFile("alluxio://<Name of the Alluxio node>:19998/output")
Replace Name of the Alluxio node>:19998 with the actual node name and port numbers of all nodes where the AlluxioMaster instance is deployed. Use commas (,) to separate the node name and port number, for example, node-ana-coremspb.mrs-m0va.com:19998,node-master2kiww.mrs-m0va.com:19998,node-master1cqwv.mrs-m0va.com:19998.
source /opt/client/bigdata_env
kinit MRS cluster user
Example: kinit admin
1, Alice, company A 2, Bob, company B
alluxio fs copyFromLocal /home/hive_load.txt /hive_input
beeline
CREATE TABLE u_user(id INT, name STRING, company STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' STORED AS TEXTFILE;
LOAD DATA INPATH 'alluxio://<Name of the Alluxio node>:19998/hive_input' INTO TABLE u_user;
Replace Name of the Alluxio node>:19998 with the actual node name and port numbers of all nodes where the AlluxioMaster instance is deployed. Use commas (,) to separate the node name and port number, for example, node-ana-coremspb.mrs-m0va.com:19998,node-master2kiww.mrs-m0va.com:19998,node-master1cqwv.mrs-m0va.com:19998.
select * from u_user;
source /opt/client/bigdata_env
kinit MRS cluster user
Example: kinit admin
For example, prepare the input file test_input.txt in the local /home directory, and run the following command to save the test_input.txt file to Alluxio:
alluxio fs copyFromLocal /home/test_input.txt /input
yarn jar /opt/share/hadoop-mapreduce-examples-<Hadoop version>-mrs-<MRS cluster version>/hadoop-mapreduce-examples-<Hadoop version>-mrs-<MRS cluster version>.jar wordcount alluxio://<Name of the Alluxio node>:19998/input alluxio://<Name of the Alluxio node>:19998/output
source /opt/client/bigdata_env
kinit MRS cluster user
Example: kinit admin
beeline
CREATE TABLE u_user (id int, name string, company string) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' LOCATION 'alluxio://<Name of the Alluxio node>:19998/u_user';
insert into u_user values(1,'Alice','Company A'),(2, 'Bob', 'Company B');
Replace Name of the Alluxio node>:19998 with the actual node name and port numbers of all nodes where the AlluxioMaster instance is deployed. Use commas (,) to separate the node name and port number, for example, node-ana-coremspb.mrs-m0va.com:19998,node-master2kiww.mrs-m0va.com:19998,node-master1cqwv.mrs-m0va.com:19998.