-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathdfsio.sh
51 lines (32 loc) · 1.03 KB
/
dfsio.sh
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
#!/bin/bash
trap "" HUP
#if [ $EUID -eq 0 ]; then
# echo "this script must not be run as root. su to hdfs user to run"
# exit 1
#fi
DFSIO_JAR=/usr/hdp/current/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient-tests.jar
FILES=10
FILESIZE=100000
LOGDIR=logs
if [ ! -d "$LOGDIR" ]
then
mkdir ./$LOGDIR
fi
DATE=`date +%Y-%m-%d:%H:%M:%S`
DFSIO_WRITE_OUTPUT_FILE="./$LOGDIR/dfsio_write_results.txt_$DATE"
DFSIO_READ_OUTPUT_FILE="./$LOGDIR/dfsio_read_results.txt_$DATE"
echo Running DFSIO CLEAN job
echo ===============================================================
yarn jar $DFSIO_JAR TestDFSIO -clean
echo Running DFSIO WRITE job
echo ===============================================================
yarn jar $DFSIO_JAR TestDFSIO \
-write -nrFiles $FILES \
-fileSize $FILESIZE \
-resFile $DFSIO_WRITE_OUTPUT_FILE
echo Running DFSIO READ job
echo ===============================================================
yarn jar $DFSIO_JAR TestDFSIO \
-read -nrFiles $FILES \
-fileSize $FILESIZE \
-resFile $DFSIO_READ_OUTPUT_FILE