Running pubman coreservice fedora postgres on one machine

From MPDLMediaWiki
Revision as of 11:28, 15 November 2011 by Bourke (talk | contribs) (→‎server.xml)
Jump to navigation Jump to search

This is a protected page.

This page documents the configuration setup used to run the whole pubman stack on one virtual machine (vm34) while the original three servers were being upgraded in November 2011.

Most changes consisted of changing port-numbers to avoid conflict, but in addition, changes were necessary to the apache server, and the side-by-side location of two jboss servers.

Changes in Fedora[edit]

here the diff output from the main fedora configuration file. The Fedora ports were moved from 8082, 8005, 8082 to 10082, 10005, 10443 to avoid conflict with the two co-resident jbosses.

 --- originals/fedora_conf/fedora.fcfg	2010-09-16 15:36:30.000000000 +0200
 +++ fedora_conf/fedora.fcfg	2011-11-08 14:35:21.000000000 +0100
 @@ -8,15 +8,15 @@
    <comment>Defines one or more email addresses for server administrators; 
		list is space delimited.</comment>
  </param>
 -  <param name="fedoraServerPort" value="8082">
 +  <param name="fedoraServerPort" value="10082">
    <comment>Defines the port number on which the Fedora server runs; 
		default is 8080.</comment>
  </param>
 -  <param name="fedoraShutdownPort" value="8005">
 +  <param name="fedoraShutdownPort" value="10005">
      <comment>Defines the port number used to shutdown the Fedora sever; 
		default is 8005.</comment>
    </param>
 -  <param name="fedoraRedirectPort" value="8443">
 +  <param name="fedoraRedirectPort" value="10443">
      <comment>Defines the redirect port of the Fedora sever; default is 8443.</comment>
    </param>
    <param name="fedoraServerHost" value="localhost">
 @@ -180,7 +180,7 @@
	    	character encoding that should be used. Default is UTF-8.</comment>
      </param>
      <param name="defaultExportFormat" value="info:fedora/fedora-system:FOXML-1.1"/>
 -    <param name="gSearchRESTURL" value="http://localhost:8080/fedoragsearch/rest">
 +    <param name="gSearchRESTURL" value="http://localhost:10080/fedoragsearch/rest">
      <comment>The REST endpoint of the Fedora Generic Search service.

and here the differences in the tomcat fedora configuration.


 --- originals/tomcat_conf/server.xml	2010-09-16 15:03:47.000000000 +0200
 +++ tomcat_conf/server.xml	2011-11-08 14:41:42.000000000 +0100
 @@ -20,7 +20,7 @@
     define subcomponents such as "Valves" at this level.
     Documentation at /docs/config/server.html
   -->
 -<Server port="8005" shutdown="SHUTDOWN"> 
 +<Server port="10005" shutdown="SHUTDOWN"> 
    <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on"/>  
 @@ -55,7 +55,7 @@
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL HTTP/1.1 Connector on port 8080
      -->  
 -    <Connector port="8082" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"  enableLookups="true"  
 acceptCount="100" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" URIEncoding="UTF-8"/>  
 +    <Connector port="10082" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="10443"  enableLookups="true" acceptCount="100" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"  URIEncoding="UTF-8"/>  
 -    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" URIEncoding="UTF-8"/>  
 +    <Connector port="10009" protocol="AJP/1.3" redirectPort="10443" URIEncoding="UTF-8"/>  


In addition, the fedora artefacts had to be reachable via the same path (/opt/fedora/data) as on the original system, to maintain consistency with the paths to the objects in the postgresql DB. This was achieved via a symbolic link

Changes in PostgreSQL[edit]

All changes in PostgreSQL configuration related to the ip-address / hostname that the server was running on. No other changes were made to server configuration.

changes to postgresql.conf[edit]

 --- originals/postgresql.conf	2011-11-15 11:35:28.000000000 +0100
 +++ postgres_conf/postgresql.conf	2011-11-09 16:33:27.000000000 +0100
 @@ -53,7 +53,7 @@
 # - Connection Settings - 
 -listen_addresses = 'srv01.mpdl.mpg.de,localhost'
 +listen_addresses = 'vm34.mpdl.mpg.de,localhost'
  #listen_addresses = 'localhost'		# what IP address(es) to listen on;

changes to pg_hba.conf[edit]

 --- originals/pg_hba.conf	2011-02-22 10:27:35.000000000 +0100
 +++ postgres_conf/pg_hba.conf	2011-11-09 13:07:29.000000000 +0100
 @@ -71,13 +71,14 @@
 local   all         all                               trust
 local	nagdb	    nagios 			      ident sameuser
 # IPv4 local connections:
 -host    all         postgres    134.76.28.241/32      trust
 -host    all         postgres    134.76.28.241/32      md5
 -host    jb_messaging jms_messaging 134.76.28.241/32   trust
 -host    jb_messaging jms_messaging 134.76.28.241/32   md5
 +host    all         postgres    134.76.28.206/32      trust
 +host    all         postgres    134.76.28.206/32      md5
 +host    jb_messaging jms_messaging 134.76.28.206/32   trust
 +host    jb_messaging jms_messaging 134.76.28.206/32   md5
 host    all         postgres    134.76.28.210/32      trust
 host    all         postgres    134.76.28.210/32      md5
 host    proai       escidoc     134.76.28.242/32      md5
 +host  proai       escidoc     134.76.28.206/32      md5
 +host  proai	    escidoc     134.76.28.206/32      trust
 host    all         postgres    192.129.1.64/26       md5
 host    all         postgres    127.0.0.1/32          md5
 host    fedora31    fedoraAdmin 127.0.0.1/32          md5

Merging of databases[edit]

The content of the large databases was taken (via rsync) directly from srv01). In addition, pubman uses two further pgsql databases on srv03, cone and pubman-import.

The content of these databases was dumped on srv03, for example with:

 pg_dump --create --inserts --encoding=UTF-8 -f cone.sql cone

then transferred, loaded with

 psql -f cone.sql

Changes in Coreservice[edit]

since both coreservice and pubman run in jboss, on the same machine, the two instances had to run side-by-side without any conflict. This involved

  1. installing both instances alongside the normal "default" under $JBOSS_HOME/server
  2. resolving any port conflicts
  3. changing the startup scripts to start the required server instance

running instances side-by-side[edit]

 # ls /data/jboss-4.2.2.GA/server
 all  coreservice  default  minimal  pubman

resolving port conflicts[edit]

for the jboss-specific files there is adequate documentation at the JBoss Community site ConfigurePorts

escidoc-core-properties[edit]

 --- originals/coreservice.conf/escidoc-core.properties	2011-04-01 14:30:40.000000000 +0200
 +++ coreservice_conf/escidoc-core.properties	2011-11-09 12:19:37.000000000 +0100
 @@ -49,7 +49,7 @@ 
  #PROPERTIES USED BY THE INDEXER###################################
  # url of the fedoragsearch
 -gsearch.url = http://localhost:8080/fedoragsearch/rest
 +gsearch.url = http://localhost:9080/fedoragsearch/rest 
  # login of user used for authentication of gsearch against eSciDoc-Core-Infrastructure
  # must be a user that has System-Administrator or System-Inspector rights
 @@ -92,7 +92,7 @@ 
  # Fedora connnection settings, needed for the
  # Object Manager to access the repository.
 -fedora.url = http://srv01.mpdl.mpg.de:8082/fedora
 +fedora.url = http://localhost:10082/fedora
 #
 @@ -113,7 +113,7 @@
  escidoc-core.selfurl = http://coreservice.mpdl.mpg.de 
 # Base URL of the JNDI of the eSciDoc Infrastructure
 -escidoc-core.default.jndi.url = jnp://localhost:1099
 +escidoc-core.default.jndi.url = jnp://localhost:9099
 # URLS of JNDIs of other core-services
 # Only define these properties 
 @@ -242,7 +242,7 @@
 #
 # set parameter for the PID Managment service
 #
 -escidoc-core.PidSystemRESTService.host = http://localhost:8080/pidmanager/pid/handle/
 +escidoc-core.PidSystemRESTService.host = http://localhost:9080/pidmanager/pid/handle/
 @@ -294,7 +294,7 @@
  #
 # postgresql jdbc settings
 #
 -escidoc-core.datasource.url=jdbc:postgresql://srv01.mpdl.mpg.de:5432/escidoc-core
 +escidoc-core.datasource.url=jdbc:postgresql://localhost:5432/escidoc-core
 @@ -325,7 +325,7 @@
 #
 # These settings work for MPTStore, not Mulgara!
 #
 -triplestore.datasource.url=jdbc:postgresql://srv01.mpdl.mpg.de:5432/riTriples
 +triplestore.datasource.url=jdbc:postgresql://localhost:5432/riTriples

jboss-service.xml[edit]

 --- originals/coreservice.conf/jboss-service.xml	2011-10-18 15:47:56.000000000 +0200
 +++ coreservice_conf/jboss-service.xml	2011-11-09 11:45:15.000000000 +0100
 @@ -207,7 +207,7 @@
        name="jboss:service=WebService">
        <attribute name="BindAddress">${jboss.bind.address}</attribute>      
 -      <attribute name="Port">8083</attribute>
 +      <attribute name="Port">9083</attribute>
        <attribute name="Host">${java.rmi.server.hostname}</attribute>
 @@ -248,13 +248,13 @@
 -      <attribute name="Port">1099</attribute>
 +      <attribute name="Port">9099</attribute>
        <attribute name="BindAddress">${jboss.bind.address}</attribute>
 -      <attribute name="RmiPort">1098</attribute>
 +      <attribute name="RmiPort">9098</attribute>
        <attribute name="RmiBindAddress">${jboss.bind.address}</attribute>
 @@ -423,7 +423,7 @@
     <mbean code="org.jboss.invocation.jrmp.server.JRMPInvoker"
        name="jboss:service=invoker,type=jrmp">
 -      <attribute name="RMIObjectPort">4444</attribute>
 +      <attribute name="RMIObjectPort">9444</attribute>
        <attribute name="ServerAddress">${jboss.bind.address}</attribute>

postgres-ds.xml[edit]

 --- originals/coreservice.conf/postgres-ds.xml	2011-02-15 11:07:39.000000000 +0100
 +++ coreservice_conf/postgres-ds.xml	2011-11-08 17:50:10.000000000 +0100
 @@ -15,7 +15,7 @@
  <datasources>
    <local-tx-datasource>
      <jndi-name>DefaultDS</jndi-name>
 -    <connection-url>jdbc:postgresql://srv01.mpdl.mpg.de:5432/jb_messaging</connection-url>
 +    <connection-url>jdbc:postgresql://vm34.mpdl.mpg.de:5432/jb_messaging</connection-url>

server.xml[edit]

 --- originals/coreservice.conf/server.xml	2007-10-22 11:43:30.000000000 +0200
 +++ coreservice_conf/server.xml	2011-11-09 11:55:39.000000000 +0100
 @@ -19,10 +19,10 @@
           APR (HTTP/AJP) Connector: /docs/apr.html
           Define a non-SSL HTTP/1.1 Connector on port 8080
      -->
 -    <Connector port="8080" address="${jboss.bind.address}"    
 +    <Connector port="9080" address="${jboss.bind.address}"    
           maxThreads="250" maxHttpHeaderSize="8192"
           emptySessionPath="true" protocol="HTTP/1.1"
 -         enableLookups="false" redirectPort="8443" acceptCount="100"
 +         enableLookups="false" redirectPort="9443" acceptCount="100"
           connectionTimeout="20000" disableUploadTimeout="true" /> 
 -    <Connector port="8009" address="${jboss.bind.address}" protocol="AJP/1.3"
 -         emptySessionPath="true" enableLookups="false" redirectPort="8443" />
 +    <Connector port="9009" address="${jboss.bind.address}" protocol="AJP/1.3"
 +         emptySessionPath="true" enableLookups="false" redirectPort="9443" />
        <Engine name="jboss.web" defaultHost="localhost">

uil2-service.xml[edit]

changing the startup-scripts[edit]

Changes in Pubman[edit]