-
Notifications
You must be signed in to change notification settings - Fork 2
/
Hdfs commands-EditsFsImage-Configfiles
54 lines (35 loc) · 1.18 KB
/
Hdfs commands-EditsFsImage-Configfiles
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
sudo useradd juan
#add password to user juan
sudo passwd juan
#create a group
groupadd supergroup
#assaign a group to user juan
usermod -g supergroup juan
#the folder owner is hdfs:supergroup
sudo -su hfds hdfs dfs -mkdir /work
#change owner and permissions of the folder
sudo -su hdfs hdfs dfs -chown juan:supergroup /work #being root
sudo -su juan
hdfs dfs -chmod 755 /work
//edits files and fsimages
#go to /dfs/nn/current to see the files edits files of the namenode
cd /dfs/nn/current
ls -ltr
#go to /dfs/snn/current to see the files edits files of the Secundary namenode
cd /dfs/snn/current
ls -ltr
# in order to generate a new fsimage and edit log
#first get into safe mode
sudo -u hdfs hdfs dfsadmin -safemode enter
#this line create the new edit log and fsimage
sudo -u hdfs hdfs dfsadmin -saveNamespace
#leave the safemode
sudo -u hdfs hdfs dfsadmin -safemode leave
###find the config files in the cluster
#go to the cluster where is the namenode service
find / -name "core-site.xml"
#go to
cd /var/run/cloudera-scm-agent/process/ #you will see varios namenode, there are various because
# in this way cloudera handle rollbacks
###find log files
cd /var/log/hadoop-hdfs