Ignore:
Timestamp:
Jul 8, 2009, 2:20:41 PM (15 years ago)
Author:
waue
Message:

0.1-2 fix some bug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nutchez-0.1/debian/nutchez.postinst

    r69 r94  
    88fi
    99
    10 ln -sf /opt/nutch/bin/nutchez /usr/local/sbin/
    11 ln -sf /opt/nutch/bin/nutchez-func.sh /usr/local/sbin/
     10ln -sf /opt/nutch/bin/nutchez /usr/sbin/
     11ln -sf /opt/nutch/bin/nutchez-func.sh /usr/sbin/
    1212
    13 setup_hdfsadm_user() {
    14   if ! getent passwd hdfsadm >/dev/null; then
    15     useradd hdfsadm
    16     mkdir -p /home/hdfsadm/.ssh
    17     mkdir -p /var/log/nutch
    18     ssh-keygen -t rsa -q -f /home/hdfsadm/.ssh/id_rsa -N ""
    19     cp /home/hdfsadm/.ssh/id_rsa.pub /home/hdfsadm/.ssh/authorized_keys
    20     chown hdfsadm:hdfsadm /var/log/nutch
    21     chown -R hdfsadm:hdfsadm /opt/nutch
    22     chown -R hdfsadm:hdfsadm /home/hdfsadm
    23   fi
     13show_message(){
     14  cat /etc/nutch/README
    2415}
    25 
    26 check_root() {
    27   if ! test -e /root/.ssh/id_rsa ; then
    28     ssh-keygen -t rsa -q -f /root/.ssh/id_rsa -N ""
    29   fi
    30   if test -e /root/.ssh/id_rsa.pub ; then
    31     if ! test -e /root/.ssh/authorized_keys ; then
    32       cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys
    33     fi
    34   else
    35     ssh-keygen -t rsa -q -f /root/.ssh/id_rsa -N ""
    36     cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys
    37   fi
    38 
    39 }
    40 
    41 start_hadoop() {
    42   if getent passwd hdfsadm >/dev/null; then
    43     su -c "/opt/nutch/bin/hadoop namenode -format" hdfsadm -
    44     su -c "/opt/nutch/bin/start-all.sh" hdfsadm -
    45   else
    46     /opt/nutch/conf/hadoop-env.sh
    47     /opt/nutch/bin/hadoop namenode -format
    48     /opt/nutch/bin/start-all.sh
    49   fi
    50 }
    51 show_message() {
     16show_old_message() {
    5217  echo "You can use the instruction : \" nutchez\" to easyly use nutch"
    5318  echo "Enjoy"
    5419}
    55 show_old_message() {
    56   echo "You can quickly start by following ways [in /opt/nutch/ with root privilege]:"
    57   echo "(1) Modify the urls/urls.txt file with indicate urls, one site one line."
    58   echo "(2) Use this instruction \"bin/nutch crawl urls -dir search -depth 4 -topN 50\" to crawl web"
    59   echo "(3) Type \" tomcat/bin/startup.sh \" and use browser to check the result in http://localhost:8080/"
    60   echo "Enjoy !"
    61 }
    62 #setup_hdfsadm_user
    63 #check_root
    64 #start_hadoop
    6520show_message
Note: See TracChangeset for help on using the changeset viewer.