Ignore:
Timestamp:
2014-08-20T15:11:26+12:00 (10 years ago)
Author:
ak19
Message:

Dr Bainbridge moved launching the jetty server for solr to after de-activating the collection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/bin/script/activate.pl

    r29190 r29220  
    583583    }
    584584   
    585 
     585    # Now the logic in GLI's CollectionManager.java (processComplete()
     586    # and installCollection()) and Gatherer.configGS3Server().
     587
     588    # 1. Get library URL
     589   
     590    # For web servers that are external to a Greenstone installation,
     591    # the user can pass in their web server's library URL.
     592    # For web servers included with GS (like tomcat for GS3 and server.exe
     593    # and apache for GS2), we work out the library URL:
     594    if(!$library_url) {
     595        $library_url = &get_library_URL($gs_mode); # returns undef if no server is running
     596    }
     597   
     598    # CollectionManager's installCollection phase in GLI
     599    # 2. Ping the library URL, and if it's a persistent server and running, release the collection
     600   
     601    my $is_persistent_server = undef;
     602    if($library_url) { # undef if no valid server URL
     603   
     604        &print_msg("Pinging $library_url\n");       
     605        if (&ping_library($library_url, $gs_mode, $site)) { # server running
     606       
     607            # server is running, so release the collection if
     608            # the server is persistent and the collection is active
     609            &print_msg("Checking if Greenstone server is persistent\n");
     610            $is_persistent_server = &is_persistent($library_url, $gs_mode);         
     611           
     612            if ($is_persistent_server) { # only makes sense to issue activate and deactivate cmds to a persistent server
     613               
     614                &print_msg("Checking if the collection $qualified_collection is already active\n");
     615                my $collection_active = &ping_library_collection($library_url, $gs_mode, $qualified_collection, $site);
     616
     617                if ($collection_active) {
     618                &print_msg("De-activating collection $qualified_collection\n");
     619                &deactivate_collection($library_url, $gs_mode, $qualified_collection, $site);
     620                }
     621                else {
     622                &print_msg("Collection is not active => No need to deactivate\n");
     623                }
     624            }
     625            else {
     626                &print_msg("Server is not persistent => No need to deactivate collection\n");
     627            }
     628        }
     629        else {
     630            &print_msg("No response to Ping => Taken to mean server is not running\n");
     631        }
     632
     633    }
     634
     635    # 2b. If we're working with a solr collection, then start up the solrserver now.
    586636    my $solr_server;
    587637    my @corenames = ();
     
    612662    # by removing the temporary building cores and (re)creating the index cores
    613663    }
    614    
    615     # Now the logic in GLI's CollectionManager.java (processComplete()
    616     # and installCollection()) and Gatherer.configGS3Server().
    617 
    618     # 1. Get library URL
    619    
    620     # For web servers that are external to a Greenstone installation,
    621     # the user can pass in their web server's library URL.
    622     # For web servers included with GS (like tomcat for GS3 and server.exe
    623     # and apache for GS2), we work out the library URL:
    624     if(!$library_url) {
    625         $library_url = &get_library_URL($gs_mode); # returns undef if no server is running
    626     }
    627    
    628     # CollectionManager's installCollection phase in GLI
    629     # 2. Ping the library URL, and if it's a persistent server and running, release the collection
    630    
    631     my $is_persistent_server = undef;
    632     if($library_url) { # undef if no valid server URL
    633    
    634         &print_msg("Pinging $library_url\n");       
    635         if (&ping_library($library_url, $gs_mode, $site)) { # server running
    636        
    637             # server is running, so release the collection if
    638             # the server is persistent and the collection is active
    639             &print_msg("Checking if Greenstone server is persistent\n");
    640             $is_persistent_server = &is_persistent($library_url, $gs_mode);         
    641            
    642             if ($is_persistent_server) { # only makes sense to issue activate and deactivate cmds to a persistent server
    643                
    644                 &print_msg("Checking if the collection $qualified_collection is already active\n");
    645                 my $collection_active = &ping_library_collection($library_url, $gs_mode, $qualified_collection, $site);
    646 
    647                 if ($collection_active) {
    648                 &print_msg("De-activating collection $qualified_collection\n");
    649                 &deactivate_collection($library_url, $gs_mode, $qualified_collection, $site);
    650                 }
    651                 else {
    652                 &print_msg("Collection is not active => No need to deactivate\n");
    653                 }
    654             }
    655             else {
    656                 &print_msg("Server is not persistent => No need to deactivate collection\n");
    657             }
    658         }
    659         else {
    660             &print_msg("No response to Ping => Taken to mean server is not running\n");
    661         }
    662 
    663     }
    664    
     664
     665
    665666    # 3. Do all the moving building to index stuff now 
    666667
Note: See TracChangeset for help on using the changeset viewer.