Changeset 176 for nutchez-0.2/src
- Timestamp:
- Jun 10, 2010, 1:27:27 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
nutchez-0.2/src/test/nutchez
r175 r176 15 15 # [PATH Declaration] # 16 16 NutchEZ_Install_PATH=/opt/nutchez 17 Tomcat_HOME=/opt/nutchez/tomcat 17 18 NutchEZ_HOME=/home/nutchuser/nutchez 18 19 … … 55 56 fi 56 57 fi 57 58 58 } 59 59 … … 79 79 rm $clusterStatus 2> /dev/null 80 80 #printf '%16s\t %11s\t %10s\t %25s\n' "[IP] [Hostanme] [Network] [Dtatnode & Tasktracker]" >>$clusterStatus 81 echo -e "[IP] \t\t [Host anme] \t [Network] \t [Dtatnode & Tasktracker]" >>$clusterStatus81 echo -e "[IP] \t\t [Hostname] \t [Network] \t [Dtatnode & Tasktracker]" >>$clusterStatus 82 82 echo -e "------------------------------------------------------------------------" >>$clusterStatus 83 83 echo -e "\nStart to check cluster..." … … 136 136 137 137 $DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC =" --title "[Datanode & Tasktracker Setup]" \ 138 --menu "Plz choose: " 1 0 65 3\138 --menu "Plz choose: " 15 65 4 \ 139 139 "start" "Start datanodes & tasktrackers" \ 140 140 "stop" "Stop datanodes & tasktrackers" \ … … 143 143 144 144 if [ "$(cat $clusterSetup)" == "start" ]; then 145 echo -e "\n[Start datanode & tasktracker]" 145 146 for node in $(cat $runNodes) 146 147 do 147 echo -e "start !" 148 echo -e "ssh -o StrictHostKeyChecking=no $node /opt/nutchez/nutch/bin/hadoop-daemon.sh start datanode" 149 ssh -o StrictHostKeyChecking=no $node "/opt/nutchez/nutch/bin/hadoop-daemon.sh start datanode" 150 echo -e "ssh -o StrictHostKeyChecking=no $node /opt/nutchez/nutch/bin/hadoop-daemon.sh start tasktracker" 151 ssh -o StrictHostKeyChecking=no $node "/opt/nutchez/nutch/bin/hadoop-daemon.sh start tasktracker" 148 echo -e "start $node datanode & tasktracker !" 149 ssh -o StrictHostKeyChecking=no $node "$NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh start datanode \ 150 ; $NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh start tasktracker" 152 151 [ $? == "0" ] || echo "Can't ssh to $node !!!" 153 152 done 154 153 elif [ "$(cat $clusterSetup)" == "stop" ]; then 154 echo -e "\n[Stop datanode & tasktracker]" 155 155 for node in $(cat $runNodes) 156 156 do 157 echo -e "stop !" 158 echo -e "ssh -o StrictHostKeyChecking=no $node /opt/nutchez/nutch/bin/hadoop-daemon.sh stop datanode" 159 ssh -o StrictHostKeyChecking=no $node "/opt/nutchez/nutch/bin/hadoop-daemon.sh stop datanode" 160 echo -e "ssh -o StrictHostKeyChecking=no $node /opt/nutchez/nutch/bin/hadoop-daemon.sh stop tasktracker" 161 ssh -o StrictHostKeyChecking=no $node "/opt/nutchez/nutch/bin/hadoop-daemon.sh stop tasktracker" 157 echo -e "stop $node datanode & tasktracker !" 158 ssh -o StrictHostKeyChecking=no $node "$NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh stop datanode \ 159 ; $NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh stop tasktracker" 162 160 [ $? == "0" ] || echo "Can't ssh to $node !!!" 163 161 done 164 162 else 163 echo -e "\n[Restart datanode & tasktracker]" 165 164 for node in $(cat $runNodes) 166 165 do 167 echo -e "restart !"168 ssh -o StrictHostKeyChecking=no $node " /opt/nutchez/nutch/bin/hadoop-daemon.sh stop datanode"169 ssh -o StrictHostKeyChecking=no $node "/opt/nutchez/nutch/bin/hadoop-daemon.sh stop tasktracker"170 ssh -o StrictHostKeyChecking=no $node " /opt/nutchez/nutch/bin/hadoop-daemon.sh start datanode"171 ssh -o StrictHostKeyChecking=no $node "/opt/nutchez/nutch/bin/hadoop-daemon.sh start tasktracker"166 echo -e "restart $node datanode & tasktracker !" 167 ssh -o StrictHostKeyChecking=no $node "$NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh stop datanode \ 168 ; $NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh stop tasktracker" 169 ssh -o StrictHostKeyChecking=no $node "$NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh start datanode \ 170 ; $NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh start tasktracker" 172 171 [ $? == "0" ] || echo "Can't ssh to $node !!!" 173 172 done … … 197 196 198 197 if [ "$(cat $tomcatSwitch)" == "start" ]; then 199 echo " /opt/nutchez/tomcat/bin/startup.sh"200 /opt/nutchez/tomcat/bin/startup.sh198 echo "$Tomcat_HOME/bin/startup.sh" 199 $Tomcat_HOME/bin/startup.sh 201 200 elif [ "$(cat $tomcatSwitch)" == "stop" ]; then 202 echo " /opt/nutchez/tomcat/bin/shutdown.sh"203 /opt/nutchez/tomcat/bin/shutdown.sh201 echo "$Tomcat_HOME/bin/shutdown.sh" 202 $Tomcat_HOME/bin/shutdown.sh 204 203 elif [ "$(cat $tomcatSwitch)" == "restart" ]; then 205 echo " /opt/nutchez/tomcat/bin/restart.sh"206 /opt/nutchez/tomcat/bin/shutdown.sh207 /opt/nutchez/tomcat/bin/startup.sh204 echo "$Tomcat_HOME/bin/restart.sh" 205 $Tomcat_HOME/bin/shutdown.sh 206 $Tomcat_HOME/bin/startup.sh 208 207 else 209 208 exit 0 … … 214 213 function tomcat_port(){ 215 214 216 if [ ! -e /opt/nutchez/tomcat/conf/server.xml ]; then215 if [ ! -e $Tomcat_HOME/conf/server.xml ]; then 217 216 $DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC =" --title "[Tomcat Servel.xml]" \ 218 --msgbox "Fial: Don't find /opt/nutchez/tomcat/conf/server.xml !!!" 10 50217 --msgbox "Fial: Don't find $Tomcat_HOME/conf/server.xml !!!" 10 50 219 218 exit 220 219 fi … … 226 225 exit 227 226 else 228 modify_line_nu=$(cat -n /opt/nutchez/tomcat/conf/server.xml | grep -v SSL | grep 'HTTP/1.1' | grep '<Connector' | awk '{print $1}') 229 sed -i "${modify_line_nu}c <Connector port="$tomcatPort" protocol="HTTP/1.1"" /opt/nutchez/tomcat/conf/server.xml 230 fi 227 modify_line_nu=$(cat -n $Tomcat_HOME/conf/server.xml | grep -v SSL | grep 'HTTP/1.1' | grep '<Connector' | awk '{print $1}') 228 sed -i "${modify_line_nu}c <Connector port="$tomcatPort" protocol="HTTP/1.1"" $Tomcat_HOME/conf/server.xml 229 $Tomcat_HOME/bin/shutdown.sh 230 $Tomcat_HOME/bin/startup.sh 231 fi 232 233 231 234 } 232 235
Note: See TracChangeset
for help on using the changeset viewer.