例如可以用下面的scripts來查dfs.replication的設定值為何
[root@master02.dev ~]>cat ~/tttt.sh
#!/bin/bash
SEARCHPATH="./"
if [ -z "$1" ]; then
SEARCHPATH="./"
else
SEARCHPATH="$1"
fi
for file in `find $SEARCHPATH -name "*xml"`
do
echo $file
cat $file | awk -F "\n" 'BEGIN{a=-1}{if(a < 0) { match($1 , pattern , ar); if( RSTART > 0) a=range; } if( a > 0) { a--; print markhead,$1; } }' range=2 pattern='dfs.replication' markhead='#'
done
[root@master02.dev process]>cd
[root@master02.dev ~]>cd /var/run/cloudera-scm-agent/process
[root@master02.dev process]>~/tttt.sh
./12-mapreduce-TASKTRACKER/mapred-site.xml
./12-mapreduce-TASKTRACKER/core-site.xml
./12-mapreduce-TASKTRACKER/hdfs-site.xml
# <name>dfs.replication</name>
# <value>3</value>
./13-mapreduce-JOBTRACKER/mapred-queue-acls.xml
./13-mapreduce-JOBTRACKER/fair-scheduler.xml
./13-mapreduce-JOBTRACKER/mapred-site.xml
./13-mapreduce-JOBTRACKER/core-site.xml
./13-mapreduce-JOBTRACKER/capacity-scheduler.xml
./13-mapreduce-JOBTRACKER/hdfs-site.xml
# <name>dfs.replication</name>
# <value>3</value>
./9-hdfs-NAMENODE/core-site.xml
./9-hdfs-NAMENODE/hdfs-site.xml
# <name>dfs.replication</name>
# <value>3</value>
./19-deploy-client-config/hadoop-conf/core-site.xml
./19-deploy-client-config/hadoop-conf/hdfs-site.xml
# <name>dfs.replication</name>
# <value>3</value>
./10-hdfs-DATANODE/core-site.xml
./10-hdfs-DATANODE/hdfs-site.xml
# <name>dfs.replication</name>
# <value>3</value>
./7-hdfs-NAMENODE-format/core-site.xml
./7-hdfs-NAMENODE-format/hdfs-site.xml
# <name>dfs.replication</name>
# <value>3</value>
./20-deploy-client-config/hadoop-conf/mapred-site.xml
./20-deploy-client-config/hadoop-conf/core-site.xml
./20-deploy-client-config/hadoop-conf/hdfs-site.xml
# <name>dfs.replication</name>
# <value>3</value>
./11-hdfs-NAMENODE-createtmp/core-site.xml
./11-hdfs-NAMENODE-createtmp/hdfs-site.xml
# <name>dfs.replication</name>
# <value>3</value>
./8-hdfs-SECONDARYNAMENODE/core-site.xml
./8-hdfs-SECONDARYNAMENODE/hdfs-site.xml
# <name>dfs.replication</name>
# <value>3</value>
2014年4月11日 星期五
訂閱:
文章 (Atom)
文章分類
- 爬山 (3)
- 參考文章 (3)
- 鳥事 (5)
- 報稅 (1)
- AIX (2)
- ajax (1)
- BCB (3)
- C/C++ (2)
- cloudera (3)
- DISK (1)
- ftp (1)
- Fuse (2)
- gdb (2)
- hadoop (13)
- hdfs (8)
- HPC (2)
- hypertable (12)
- iOS (1)
- iscsi (1)
- JAVA (2)
- KFS (5)
- kickstart (1)
- KVM (2)
- LAMP (2)
- linux (2)
- Lion (1)
- LVM (2)
- mapreduce (3)
- mpi (3)
- mpich2 (4)
- msgpack (2)
- mysql (2)
- nfs (1)
- openmp (2)
- OS (1)
- OSX (2)
- others (5)
- PBS (1)
- performance_tuning (3)
- php (3)
- phplist (3)
- programming (27)
- REST (2)
- RHCA (6)
- rhel (13)
- rhel6 (4)
- scp (1)
- shell_scripts (2)
- snowleopard (2)
- Solaris (6)
- ssh (1)
- syslog (1)
- t-442-1 (4)
- torque (1)
- ubuntu (2)
- VNC (1)
- watercolor (5)
- windows (1)
- yum (1)