Alluxio Instation

Alluxio Instation

Download Alluxio

  • Download Alluxio
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    # 解壓縮下載的tar包,或者自行編譯的tar包
    [root@testmain ~]# tar -zxvf alluxio-1.6.0-hadoop-2.8-bin.tar.gz -C /opt/software
    [root@testmain ~]# cd /opt/software
    [root@testmain software]# ln -s alluxio-1.6.0-hadoop-2.8 alluxio
    # 將file owner更改為啟動Alluxio的Linux user
    [root@testmain software]# sudo chown -R hadoop:hadoop alluxio-1.6.0-hadoop-2.8/
    [root@testmain software]# sudo chown -R hadoop:hadoop alluxio
    # 配置環境變量
    [root@testmain software]# sudo vim /etc/profile
    export ALLUXIO_HOME="/opt/software/alluxio"
    export PATH="$ALLUXIO_HOME/bin:$PATH"
    [root@testmain software]# source /etc/profile

Configure Alluxio

  • Alluxio Quick Start Guide
    1
    2
    3
    4
    5
    [root@testmain software]# cd alluxio
    [root@testmain alluxio]# cp conf/alluxio-site.properties.template conf/alluxio-site.properties
    [root@testmain alluxio]# vim conf/alluxio-site.properties
    ## 將文件內此行註解取消
    alluxio.master.hostname=localhost

Validate Alluxio environment

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# 切換至啟動Alluxio的Linux user
[root@testmain alluxio]# su - hadoop
# 驗證Alluxio的本地運行環境
[hadoop@testmain ~]$ alluxio validateEnv local
2017-11-05 18:35:27,468 INFO ConfigurationUtils - Configuration file /opt/software/alluxioBuild1.6/conf/alluxio-site.properties loaded.
Validating proxy.web.port.available...OK
Validating master.web.port.available...OK
Validating worker.web.port.available...OK
Validating ssh.masters.reachable...OK
Validating worker.storage.space...OK
Validating ufs.root.accessible...Unable to list under file system path /opt/software/alluxioBuild1.6/underFSStorage.
Failed
Validating ulimit.nproc...OK
Validating worker.rpc.port.available...OK
Validating ulimit.nofile...OK
Validating ssh.workers.reachable...OK
Validating worker.ramdisk.mount.privilege...[sudo] password for hadoop:
OK
Validating master.rpc.port.available...OK
Validating worker.data.port.available...OK
Validation failed. Total failures: 1.
# Validating ufs.root.accessible...Unable to list under file system path
# /opt/software/alluxioBuild1.6/underFSStorage.
# 錯誤指出無法使用指定路徑中的目錄,直接創建一個
[hadoop@testmain ~]$ mkdir /opt/software/alluxioBuild1.6/underFSStorage
# 再次驗證Alluxio的本地運行環境
[hadoop@testmain ~]$ alluxio validateEnv all
2017-11-05 18:36:02,074 INFO ConfigurationUtils - Configuration file /opt/software/alluxioBuild1.6/conf/alluxio-site.properties loaded.
Validating master environment on localhost...
2017-11-05 18:36:03,245 INFO ConfigurationUtils - Configuration file /opt/software/alluxioBuild1.6/conf/alluxio-site.properties loaded.
Validating proxy.web.port.available...OK
Validating ssh.masters.reachable...OK
Validating ssh.workers.reachable...OK
Validating ufs.root.accessible...OK
Validating ulimit.nofile...OK
Validating ulimit.nproc...OK
Validating master.rpc.port.available...OK
Validating master.web.port.available...OK
Validation succeeded.
Connection to localhost closed.
Validating worker environment on localhost...
2017-11-05 18:36:03,938 INFO ConfigurationUtils - Configuration file /opt/software/alluxioBuild1.6/conf/alluxio-site.properties loaded.
Validating proxy.web.port.available...OK
Validating ssh.masters.reachable...OK
Validating ssh.workers.reachable...OK
Validating ufs.root.accessible...OK
Validating ulimit.nofile...OK
Validating ulimit.nproc...OK
Validating worker.data.port.available...OK
Validating worker.ramdisk.mount.privilege...[sudo] password for hadoop:
OK
Validating worker.rpc.port.available...OK
Validating worker.storage.space...OK
Validating worker.web.port.available...OK
Validation succeeded.
Connection to localhost closed.
# 如果要將Alluxio運行在集群中,則要驗證所有節點的運行環境
[hadoop@testmain ~]$ alluxio validateEnv all
2017-11-04 23:36:57,178 INFO ConfigurationUtils - Configuration file /opt/software/alluxio-1.6.0-hadoop-2.8/conf/alluxio-site.properties loaded.
Validating master environment on localhost...
2017-11-04 23:36:57,738 INFO ConfigurationUtils - Configuration file /opt/software/alluxio-1.6.0-hadoop-2.8/conf/alluxio-site.properties loaded.
Validating proxy.web.port.available...OK
Validating ssh.masters.reachable...OK
Validating ssh.workers.reachable...OK
Validating ufs.root.accessible...OK
Validating ulimit.nofile...The user limit for number of open files is too small. The current value is 4096. It should be bigger than 16384
Failed
Validating ulimit.nproc...The user limit for number of user processes is too small. The current value is 1024. It should be bigger than 16384
Failed
Validating master.rpc.port.available...OK
Validating master.web.port.available...OK
Validation failed. Total failures: 2.
Connection to localhost closed.
Validating worker environment on localhost...
2017-11-04 23:36:58,323 INFO ConfigurationUtils - Configuration file /opt/software/alluxio-1.6.0-hadoop-2.8/conf/alluxio-site.properties loaded.
Validating proxy.web.port.available...OK
Validating ssh.masters.reachable...OK
Validating ssh.workers.reachable...OK
Validating ufs.root.accessible...OK
Validating ulimit.nofile...The user limit for number of open files is too small. The current value is 4096. It should be bigger than 16384
Failed
Validating ulimit.nproc...The user limit for number of user processes is too small. The current value is 1024. It should be bigger than 16384
Failed
Validating worker.data.port.available...OK
Validating worker.ramdisk.mount.privilege...[sudo] password for hadoop:
OK
Validating worker.rpc.port.available...OK
Validating worker.storage.space...RAM disk is not mounted at /mnt/ramdisk, skip validation.
OK
Validating worker.web.port.available...OK
Validation failed. Total failures: 2.
Connection to localhost closed.
# 上述錯誤指出,當前Linux user的open files跟processes上限次數不足
# 透過修改此文件,進行當前Linux user的open files跟processes上限次數設定
[hadoop@testmain ~]$ sudo vim /etc/security/limits.conf
hadoop - nofile 16384
hadoop - nproc 16384
# 進行登出登入,並確認修改是否生效
[hadoop@testmain ~]$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 30374
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 16384
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 16384
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
# 再次進行環境驗證
[hadoop@testmain ~]$ alluxio validateEnv all
2017-11-05 18:38:56,955 INFO ConfigurationUtils - Configuration file /opt/software/alluxioBuild1.6/conf/alluxio-site.properties loaded.
Validating master environment on localhost...
2017-11-05 18:38:57,532 INFO ConfigurationUtils - Configuration file /opt/software/alluxioBuild1.6/conf/alluxio-site.properties loaded.
Validating proxy.web.port.available...OK
Validating ssh.masters.reachable...OK
Validating ssh.workers.reachable...OK
Validating ufs.root.accessible...OK
Validating ulimit.nofile...OK
Validating ulimit.nproc...OK
Validating master.rpc.port.available...OK
Validating master.web.port.available...OK
Validation succeeded.
Connection to localhost closed.
Validating worker environment on localhost...
2017-11-05 18:38:58,151 INFO ConfigurationUtils - Configuration file /opt/software/alluxioBuild1.6/conf/alluxio-site.properties loaded.
Validating proxy.web.port.available...OK
Validating ssh.masters.reachable...OK
Validating ssh.workers.reachable...OK
Validating ufs.root.accessible...OK
Validating ulimit.nofile...OK
Validating ulimit.nproc...OK
Validating worker.data.port.available...OK
Validating worker.ramdisk.mount.privilege...[sudo] password for hadoop:
OK
Validating worker.rpc.port.available...OK
Validating worker.storage.space...OK
Validating worker.web.port.available...OK
Validation succeeded.

Start Alluxio

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# 格式化Alluxio,為啟動Alluxio做準備
[hadoop@testmain ~]$ alluxio format
Executing the following command on all worker nodes and logging to /opt/software/alluxioBuild1.6/logs/task.log: /opt/software/alluxio/bin/alluxio formatWorker
Waiting for tasks to finish...
All tasks finished
Formatting Alluxio Master @ testmain
2017-11-05 18:38:26,989 INFO ConfigurationUtils - Configuration file /opt/software/alluxioBuild1.6/conf/alluxio-site.properties loaded.
2017-11-05 18:38:26,996 INFO Format - Formatting master journal: /opt/software/alluxioBuild1.6/journal/
2017-11-05 18:38:27,065 INFO UfsJournal - Formatting /opt/software/alluxioBuild1.6/journal/BlockMaster/v1
2017-11-05 18:38:27,114 INFO UfsJournal - Formatting /opt/software/alluxioBuild1.6/journal/FileSystemMaster/v1
2017-11-05 18:38:27,116 INFO Format - Formatting complete
# 在localhost啟動Alluxio
[hadoop@testmain ~]$ alluxio-start.sh local
Killed 0 processes on testmain
Killed 0 processes on testmain
Killed 0 processes on testmain
Killed 0 processes on testmain
Starting master @ testmain. Logging to /opt/software/alluxio-1.6.0-hadoop-2.8/logs
Starting secondary master @ testmain. Logging to /opt/software/alluxio-1.6.0-hadoop-2.8/logs
Formatting RamFS: /mnt/ramdisk (2668407466)
[sudo] password for hadoop:
Starting worker @ testmain. Logging to /opt/software/alluxio-1.6.0-hadoop-2.8/logs
Starting proxy @ testmain. Logging to /opt/software/alluxio-1.6.0-hadoop-2.8/logs
# 使用jps確認Alluxio相關程序的運行狀況
[hadoop@testmain ~]$ jps
4467 Jps
4419 AlluxioWorker
4421 AlluxioProxy
4237 AlluxioMaster
4239 AlluxioSecondaryMaster

Files operation in Alluxio

1
2
3
4
5
6
7
[hadoop@testmain ~]$ alluxio fs ls /
[hadoop@testmain ~]$ echo "Hello world" >> testFile
# 將本地文件上傳至Alluxio
[hadoop@testmain ~]$ alluxio fs copyFromLocal testFile /
Copied file:///home/hadoop/testFile to /
[hadoop@testmain ~]$ alluxio fs ls /
-rw-r--r-- hadoop hadoop 12 NOT_PERSISTED 11-04-2017 23:57:33:994 100% /testFile

View on the Website

  • 透過ip/domain:19999訪問Alluxio頁面

Stop Alluxio

1
2
3
4
5
[hadoop@testmain ~]$ alluxio-stop.sh local
Killed 1 processes on testmain
Killed 1 processes on testmain
Killed 1 processes on testmain
Killed 1 processes on testmain