Difference between revisions of "Installing the Messaging Server: DEPRECATED"

From AgileApps Support Wiki
imported>Aeric
imported>Aeric
Line 101: Line 101:
#:'''Note:'''<br>The MySQL instance used by the Messaging Server contains real-time data, only. There is no need for backups or database replication, as the data structures can be easily restored by re-running that SQL script.
#:'''Note:'''<br>The MySQL instance used by the Messaging Server contains real-time data, only. There is no need for backups or database replication, as the data structures can be easily restored by re-running that SQL script.
# Copy these files from the appserver system to the Messaging Server system:
# Copy these files from the appserver system to the Messaging Server system:
#* The entire <tt>tomcat/lib</tt> directory. {{TBD|To where?}}
#* The entire <tt>messaging-server</tt> directory to the installation directory.
#* The entire <tt>messaging-server</tt> directory. {{TBD|To where?}}
#* The entire <tt>tomcat/lib</tt> directory to <tt>messaging-server/lib</tt>
#* The SSL keystore file directory. {{TBD|To where?}}
#* The SSL keystore file directory to <tt>messaging-server/conf/ssl</tt>
# Go to the <tt>messaging-server/</tt> directory. {{TBD|Where is it?}}
# In <tt>conf/server.properties</tt>, change the <tt>customer_db_server</tt> connection string to link to the MySQL instance used by the appserver(s).
# In <tt>conf/server.properties</tt>, change the <tt>customer_db_server</tt> connection string to link to the MySQL instance used by the appserver(s). {{TBD|value format?}}
# In <tt>startmessaging.sh</tt>, correct the path for each JAR used in Java classpath to reference the jars in <tt>messaging-server/lib</tt>
# In <tt>startmessaging.sh</tt>, correct the path for each JAR used in Java classpath. {{TBD|where are the jars?}}
# In the <tt>startmessaging.sh</tt> script, correct the path for the <tt>cd</tt> command to go to <tt>{install-dir}/messaging-server</tt>
# In the <tt>messaging</tt> script, correct the path for the <tt>cd</tt> command. {{TBD|to go where?}}
# In <tt>tomcat/webapps/networking/servicedesk/js/msg_server_link.js</tt>, replace the content of the file with:  
# In <tt>tomcat/webapps/networking/servicedesk/js/msg_server_link.js</tt>, replace the content of the file with:  
#: <tt>var messagingServerHost = "[YOUR_MESSAGING_SERVER_HOST_NAME_OR_IP]";</tt>
#: <tt>var messagingServerHost = "[YOUR_MESSAGING_SERVER_HOST_NAME_OR_IP]";</tt>

Revision as of 21:00, 28 February 2014

Prerequisites

Before starting the Messaging Server installation, the Application Server (appserver) should be installed.

Installing HornetQ

HornetQ is the Message Queue engine used by the Messaging Server.

To install HornetQ

  1. Download the release specified in the Software Requirements from
    http://www.jboss.org/hornetq/downloads.html
  2. Unpack the archive to the desired location.
    For example:
    cd {appserver}/
    tar xfz hornetQ-{version}.tar
  3. Edit {hornetq_install}/config/stand-alone/non-clustered/hornetq-users.xml
    Add the following code to the <configuration> section to create the admin user who will have access to the queue:
    <syntaxhighlight lang="xml" enclose="div">

<user name="[USER_NAME]" password="[PASSWORD]">

  <role name="admin"/>

</user> </syntaxhighlight>

  1. Edit {hornetq_install}/config/stand-alone/non-clustered/hornetq-configuration.xml
    Replace the <security>...</security> section with the following:
    <syntaxhighlight lang="xml" enclose="div">

<security-settings>

  <security-setting match="#">
     <permission type="createNonDurableQueue" roles="guest, admin"/>
     <permission type="deleteNonDurableQueue" roles="guest, admin"/>
     <permission type="createDurableQueue" roles="admin"/>
     <permission type="deleteDurableQueue" roles="admin"/>
     <permission type="consume" roles="guest, admin"/>
     <permission type="send" roles="guest, admin"/>
     <permission type="manage" roles="admin"/>
  </security-setting>

</security-settings> </syntaxhighlight>

Starting HornetQ

Start HornetQ before proceeding with the next step in the installation:

{hornetq_install}/bin/run.sh

Notepad.png

Note:
HornetQ should always be started before launching the platform's messaging server.

Learn more: Server Restart Sequence

Configuring the Platform's Service Provider Settings

  1. Go to the Service Provider URL: http://{yourDomain}/networking/Service?t=1&targetpage=ViewPort.jsp
  2. Log in as the admin user
  3. Go to Settings > Service Provider Settings > Service Configuration
  4. Set values for the following parameters:
HornetQ Host  IP address of the server where HornetQ is installed
 (If on the appserver, enter localhost)
HornetQ Port  Default: 5445.
 Needs to be specified only if the port specified for the netty acceptor
 was changed in hornetq-configuration.xml  
HornetQ User
HornetQ Password
 Use the same credentials you specified in hornetq-users.xml
HornetQ QoS  The number of simultaneously working Message Queue listeners.
 (A typical value is 2.)
5. Click [Save]
6. Restart Tomcat to read the new configuration:
Common:Tomcat restart

Creating an SSL Keystore

The Messaging Server accepts only SSL-encrypted connections. It needs a valid SSL certificate to perform a Handshake and data exchange with client systems.

The same Java keystore, SSL certificate, and private key used for the application server can be used for the Messaging Server. So once that has been set up, nothing else needs to be done.

Learn more: Managing SSL Certificates.

Configuring the Messaging Server

  1. Start the appserver:
    {appserver}/scripts/longjump start
  2. Go to {appserver}/messaging-server/conf/.
    That directory contains two configuration files:
    • log4j.properties – standard Apache Log4J configuration file.
    • server.properties – Messaging Server configuration file.
  3. In server.properties, configure the following parameters:
    • netty_port
      Use 443 if it is on a standalone system.
      If is on the same system as the appserver, then:
      • Use the default value (7007)
      • Add Apache Web Server proxy instructions (see end of document)
    • debug – set value to 1 to see content of all incoming HTTP requests in the log.
      Otherwise, use the default value (0).
    • ssl_keystore – absolute or relative path to your SSL keystore
    • ssl_keystore_password – password for your SSL keystore
AppServer Installation

Follow these steps when running the Messaging Server on the same system as an appserver:

  1. In {appserver}/tomcat/webapps/networking/servicedesk/js/msg_server_link.js, replace the content of the file with:
    var messagingServerHost = "[YOUR_LONGJUMP_HOST_NAME_OR_IP]";
  2. Copy the messaging script to its target destination:
    cp {appserver_installation}/messaging-server/messaging /etc/init.d/
  3. Make messaging an autostart script:
    cd /etc/init.d/
    chkconfig –add messaging
Standalone Installation

For maximum performance, follow these steps to run the Messaging Server on a standalone system:

  1. Install MySQL on Messaging Server instance. Use the same MySQL credentials as on the appserver.
  2. Import messagingdb.sql into MySQL on the Messaging Server system.
    Note:
    The MySQL instance used by the Messaging Server contains real-time data, only. There is no need for backups or database replication, as the data structures can be easily restored by re-running that SQL script.
  3. Copy these files from the appserver system to the Messaging Server system:
    • The entire messaging-server directory to the installation directory.
    • The entire tomcat/lib directory to messaging-server/lib
    • The SSL keystore file directory to messaging-server/conf/ssl
  4. In conf/server.properties, change the customer_db_server connection string to link to the MySQL instance used by the appserver(s).
  5. In startmessaging.sh, correct the path for each JAR used in Java classpath to reference the jars in messaging-server/lib
  6. In the startmessaging.sh script, correct the path for the cd command to go to {install-dir}/messaging-server
  7. In tomcat/webapps/networking/servicedesk/js/msg_server_link.js, replace the content of the file with:
    var messagingServerHost = "[YOUR_MESSAGING_SERVER_HOST_NAME_OR_IP]";
  8. Copy the messaging script to its target destination:
    cp messaging-server/messaging /etc/init.d/
  9. Make messaging an autostart script:
    cd /etc/init.d/
    chkconfig –add messaging