Excerpt |
---|
Helpful Scripts, Commands, etc. for Working with Hadoop Configurations. |
Setting the current shim for all your pentaho applications with 1 command.
This linux shell command finds all plugin.properties files from the current directory and lower and sets active.hadoop.configuration to the provided argument. The argument is the name of the hadoop configuration to use.
Code Block |
---|
find . -wholename "*pentaho-big-data-plugin/plugin.properties" -exec sed -i "s/\(active.hadoop.configuration=\)\(.*\)/\1$1/g" {} \;
|
This linux shell command finds all plugin.properties files from the current directory and lower and prints the value of active.hadoop.configuration
Code Block |
---|
find . -wholename "*pentaho-big-data-plugin/plugin.properties" -exec ls {} \; -exec grep -o "active\.hadoop\.configuration=[0-9A-Za-z\-]*" {} \; | cut -f2 -d=
|
Alias to find the shims directory and change your current directory to it:
Code Block |
---|
alias goshims="cd \`find . -wholename \"*pentaho-big-data-plugin/hadoop-configurations\"\`"
|
Alias to find the active shim's directory and change your current directory to it:
Code Block |
---|
alias goshim='SHIM_PROP="`find . -wholename \"*pentaho-big-data-plugin/plugin.properties\" -exec ls {} 2>/dev/null \; | head --lines=1`"; \
ACTIVE_SHIM="`grep -o \"active\.hadoop\.configuration=[0-9A-Za-z\-]*\" \"$SHIM_PROP\" | sed \"s/.*=//g\"`"; \
HADOOP_CONFIG_PATH="`grep -o \"hadoop\.configurations\.path=[0-9A-Za-z\-]*\" \"$SHIM_PROP\" | sed \"s/.*=//g\"`"; \
cd "`dirname \"$SHIM_PROP\"`/$HADOOP_CONFIG_PATH/$ACTIVE_SHIM"'
|
Code Block |
---|
find . -name "*-site.xml" -exec sed -i "s/sandbox.hortonworks.com/my.resourcemanager.com/g" {} \;
|
Code Block |
---|
find . -name "*-site.xml" -exec sed -i "s/clouderamanager.cdh5.test/my.resourcemanager.com/g" {} \;
|