Project

General

Profile

« Previous | Next » 

Revision 4808

Added by daigle over 15 years ago

Update replication documentation and fix code so that replication log is available.

View differences:

lib/style/skins/dev/replMain.html
77 77
  <tr>
78 78
    <td rowspan="2" width="50%">
79 79
    <form action="../../../servlet/replication" method="POST" target="bottom">
80
      <input type="radio"  name="action" value="getall"> Get All - bring all updated
81
      documents from remote hosts to this server<br><br>
80
      <input type="hidden"  name="action" value="getall"> 
81
      Get All - bring all updated documents from remote hosts to this server<br><br>
82 82
      
83 83
      <input type="submit" value="Submit" target="bottom">
84 84
    </form>
src/edu/ucsb/nceas/metacat/MetacatReplication.java
96 96
           MetacatReplication.replLog("deltaT handler started with rate=" +
97 97
                   timeInterval + " mini seconds at " +firstTime.toString());
98 98
       }
99
		       
100
       String logFilePath = 
101
    	   PropertyService.getProperty("replication.logdir") + "/metacatreplicationerror.log";
102
       if (FileUtil.getFileStatus(logFilePath) == FileUtil.DOES_NOT_EXIST) {
103
    	   FileUtil.createFile(logFilePath);
104
       }
105
       
106
       if (FileUtil.getFileStatus(logFilePath) < FileUtil.EXISTS_READ_WRITABLE) {
107
    	   logMetacat.error(logFilePath + " does not exist read/writable.");
108
       }
109
       
99 110
    }
100 111
    catch (Exception e)
101 112
    {
......
155 166
      params.put(name, value);
156 167
    }
157 168

  
158
    String action = ((String[])params.get("action"))[0];
169
    String action = "";
170
    if (!params.isEmpty() && params.get("action") != null) {
171
    	action = ((String[])params.get("action"))[0];
172
    }
159 173
    String server = null;
160 174

  
161 175
    try {
src/edu/ucsb/nceas/metacat/admin/PropertiesAdmin.java
242 242
					logMetacat.error(errorString);
243 243
					validationErrors.add(errorString);
244 244
				}
245
				
246
				// Try to create temporary directories if necessary.
247
				String replLogDir = PropertyService.getProperty("replication.logdir");
248
				try {
249
					FileUtil.createDirectory(replLogDir);
250
				} catch (IOException ioe) {		
251
					String errorString = "Could not create directory: " + replLogDir +
252
						" : " + ioe.getMessage();
253
					logMetacat.error(errorString);
254
					validationErrors.add(errorString);
255
				}
245 256

  
246 257
				// write the backup properties to a location outside the 
247 258
				// application directories so they will be available after
docs/user/replication.html
313 313

  
314 314
<a name="ControlPanel"></a><div class="header1">The Replication Control Panel:</div>      
315 315
  There is an html control panel for controling replication.  After
316
  installing Metacat, you can access
317
  it by going through the Metacat servlet context you have setup and calling up
318
  replControl.html.  For instance, if you setup a Metacat servlet instance 
319
  called 'knb' you would probably type 
316
  installing Metacat, you can access it by calling replControl.html.  For instance, if you 
317
  setup a Metacat application context called 'knb' you would probably type :
320 318
  
321
  <div class="code">http://server.domain.com:8080/Metacat/style/skins/dev/replControl.html</div>  
319
  <div class="code">http://server.domain.com/knb/style/skins/dev/replControl.html</div>  
322 320
  
323 321
  The control panel is an easy interface for adding/removing/altering servers and 
324 322
  starting the delta-T handler.  It will also allow you to 'force replicate' your 
......
404 402
  </li>
405 403
  <li>Sample values when creating certificate</li>
406 404
    <ul class="list2">
405
    <li>Enter PEM pass phrase: (note: I use the first part of the host name)
407 406
    <li>Country Name (2 letter code) [AU]: <b>US</b></li>
408 407
    <li>State or Province Name (full name) [Some-State]: <b>California</b> 
409 408
        (note: this is spelled in full)</li>
410 409
    <li>Locality Name (eg, city) []: <b>Santa Barbara</b></li>
411
    <li>Organization Name (eg, company) [Internet Widgits Pty Ltd]: </b>UCSB</b></li>
410
    <li>Organization Name (eg, company) [Internet Widgits Pty Ltd]: <b>UCSB</b></li>
412 411
    <li>Organizational Unit Name (eg, section) []: <b>NCEAS</b></li>
413 412
    <li>Common Name (eg, YOUR name) []: <b>myserver.mydomain.edu</b>
414 413
        (note: use the host name without port number)</li>
......
421 420
    <ul class="list2">
422 421
    <li>Run the command:
423 422
      <div class="code">openssl req -x509 -days 800 -in REQ.pem -key &lt;hostname&gt;-apache.key -out &lt;hostname&gt;-apache.crt</div>
424
      where &lt;aliasname&gt; is the same name you used when you created the certificate.  </li>
425
    <li>A file named &lt;outputfile&gt;.cert will be created in the same directory where you run the keytool 
423
      where &lt;hostname&gt; is the same name you used when you created the certificate.  </li>
424
    <li>A file named &lt;hostname&gt;-apache.crt will be created in the same directory where you run the keytool 
426 425
      command.  You can name the output file anything you like, but keep in mind that it will get sent to the 
427 426
      partner machine used for replication.  The filename should have have enough meaning that someone who sees 
428
      it on that machine can have some idea where it came from.  Again, something like "&lt;hostname&gt;-tomcat.cert"
427
      it on that machine can have some idea where it came from.  Again, something like "&lt;hostname&gt;-apache.crt"
429 428
      will suffice.</li>   
430 429
    </ul>
431 430
  </li>   
......
467 466
  replication server.
468 467
  <ul class="list1">
469 468
  <li>Import the remote certificate by running:
470
    <div class="code">keytool -import -alias &lt;remotehostalias&gt; -file &lt;remotehostfilename&gt;.cert -keystore $JAVA_HOME/lib/security/cacerts</div>
469
    <div class="code">keytool -import -alias &lt;remotehostalias&gt; -file &lt;remotehostfilename&gt;.crt -keystore $JAVA_HOME/jre/lib/security/cacerts</div>
471 470
    where the &lt;remotehostfilename&gt; is the certificate file you created on the remote machine and
472 471
    copied to this machine.  The &lt;remotehostalias&gt; is the name the certificate will use in
473 472
    the keystore.  It should be something that identifies the remote host.  

Also available in: Unified diff