Running pubman coreservice fedora postgres on one machine
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 = 'xxx.xxx.xxx.xxx,localhost'
+listen_addresses = 'xxx.xxx.xxx.xxx,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
+host all postgres xxx.xxx.xxx.xxx/32 trust +host all postgres xxx.xxx.xxx.xxx/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
- installing both instances alongside the normal "default" under $JBOSS_HOME/server
- resolving any port conflicts
- 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
$JBOSS_HOME/server/coreservice/conf/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://xxx.xxx.xxx.xxx:8082/fedora +fedora.url = http://localhost:10082/fedora # @@ -113,7 +113,7 @@ escidoc-core.selfurl = http://myhostname.xxx.xxx # 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://xxx.xxx.xxx.xxx: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://xxx.xxx.xxx.xxx:5432/riTriples +triplestore.datasource.url=jdbc:postgresql://localhost:5432/riTriples
$JBOSS_HOME/server/coreservice/conf/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>
$JBOSS_HOME/server/coreservice/deploy/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://xxx.xxx.xxx.xxx:5432/jb_messaging</connection-url> + <connection-url>jdbc:postgresql://yyy.yyy.yyy.yyy:5432/jb_messaging</connection-url>
$JBOSS_HOME/server/coreservice/deploy/jboss-web.deployer/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">
$JBOSS_HOME/server/coreservice/deploy/jms/uil2-service.xml[edit]
--- originals/coreservice.conf/uil2-service.xml 2007-10-22 11:43:32.000000000 +0200 +++ coreservice_conf/uil2-service.xml 2011-11-09 11:56:53.000000000 +0100 @@ -19,7 +19,7 @@ <attribute name="BindAddress">${jboss.bind.address}</attribute> - <attribute name="ServerBindPort">8093</attribute> + <attribute name="ServerBindPort">9093</attribute>
changing the startup-scripts[edit]
--- coreservice 2011-11-09 11:30:41.000000000 +0100 +++ jboss 2011-03-16 09:56:17.000000000 +0100 @@ -31,7 +31,7 @@ jboss_ps_log=`mktemp /var/tmp/jboss-ps.log.XXXXXX` ps aux --cols 1024 >"$jboss_ps_log" jboss_is_running="false" - if grep "org.jboss.Main -c coreservice" "$jboss_ps_log" >/dev/null 2>/dev/null ; then + if grep org.jboss.Main "$jboss_ps_log" >/dev/null 2>/dev/null ; then @@ -40,7 +40,7 @@ # Check for missing binaries and configuration # Note: Special treatment of stop for LSB conformance -JBOSS_CONFIG=/etc/sysconfig/coreservice +JBOSS_CONFIG=/etc/sysconfig/j2ee @@ -120,8 +120,8 @@ rc_failed 0 else # try to fix permissions - test -d "$JBOSS_HOME/server/${JBOSS_CONFIG:-coreservice}" && \ - chown -R --dereference jboss:jboss "$JBOSS_HOME/server/${JBOSS_CONFIG:-coreservice}" 2>/dev/null || true + test -d "$JBOSS_HOME/server/${JBOSS_CONFIG:-default}" && \ + chown -R --dereference jboss:jboss "$JBOSS_HOME/server/${JBOSS_CONFIG:-default}" 2>/dev/null || true # define options and start server JBOSS_START_OPTIONS="" test -n "$JBOSS_CONFIG" && JBOSS_START_OPTIONS="-c $JBOSS_CONFIG"
Changes in Pubman[edit]
Pubman configuration was intentionally left as near to the original as possible. The changes to pubman.properties were necessary to allow the apache2 server configuration on newhost that serve both pubmanhost and coreservicehost on port 80 to distinguish http requests for coreservice from those for pubman
$JBOSS_HOME/server/pubman/conf/pubman.properties[edit]
--- originals/pubman.conf/pubman.properties 2011-10-13 13:42:47.000000000 +0200 +++ pubman_conf/pubman.properties 2011-11-09 14:44:39.000000000 +0100 @@ -45,8 +45,8 @@ escidoc.pubman.component.pattern=/viewComponentPage.jsp?componentId=$1 # URL of the FIZ framework instance -escidoc.framework_access.framework.url=http://xxx.xxx.xxx.xxx -escidoc.framework_access.login.url=http://xxx.xxx.xxx.xxx:80 +escidoc.framework_access.framework.url=http://xxx.xxx.xxx.xxx/coreservice +escidoc.framework_access.login.url=http://xxx.xxx.xxx.xxx/coreservice @@ -203,7 +203,7 @@ escidoc.cone.subjectVocab=ddc;mpipks;iso639-3 -escidoc.framework_access.login.url=http://xxx.xxx.xxx.xxx +escidoc.framework_access.login.url=http://xxx.xxx.xxx.xxx/coreservice
$JBOSS_HOME/server/pubman/deploy/eaiprovider.war/WEB-INF/classes/proai.properties[edit]
proai.db.url = jdbc:postgresql://xxx.xxx.xxx.xxx:5432/proai