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

From AgileApps Support Wiki
imported>Aeric
imported>Aeric
 
(63 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Warn|1=
<br>
<br>
'''This feature has been deprecated and should not be used with the latest versions of AgileApps. This document is no longer being updated.'''
}}
<includeonly>===Installing the Messaging Server===</includeonly>
<includeonly>===Installing the Messaging Server===</includeonly>
====Installing HornetQ====
====Prerequisites====
HornetQ is the Message Queue engine used by the Messaging Server.<br>
Before starting the Messaging Server installation, the [[Platform Installation Guide#Platform Installation|Application Server]] (appserver) should be installed.


'''To install HornetQ
====Download the Messaging Server====
# Download it from http://www.jboss.org/hornetq/downloads.html<br>(For the release to use, see the [[Software Requirements]].)
# Download the messaging server {{DOCHOST}}/files/messaging-server.tar.gz
# Unpack the archive to the desired location (<tt>hornetq-2.2.14</tt>, at the the time of this writing).
#:
# Edit <tt>{hornetq-folder}/config/stand-alone/non-clustered/hornetq-users.xml</tt>
# Unpack the archive to the application server directory.<br>For example:
# Create a new user by adding the following code to the <tt><configuration></tt> section:
#: <tt>cd {appserver}/</tt>
#: <tt>gunzip messaging-server.tar.gz</tt>
#: <tt>tar xfz messaging-server.tar</tt>
 
====Install HornetQ====
HornetQ is the Message Queue engine used by the Messaging Server.
 
'''To install HornetQ:'''
# Download the release specified in the [[Software Requirements]] from<br>http://www.jboss.org/hornetq/downloads.html
#:
# Unpack the archive to the desired location.<br>For example:
#: <tt>cd {appserver}/</tt>
#: <tt>tar xfz hornetQ-{version}.tar</tt>
# Edit <tt>{hornetq_install}/config/stand-alone/non-clustered/hornetq-users.xml</tt><br>Add the following code to the <tt><configuration></tt> section to create the admin user who will have access to the queue:
#:<syntaxhighlight lang="xml" enclose="div">
#:<syntaxhighlight lang="xml" enclose="div">
<user name="[USER_NAME]" password="[PASSWORD]">
<user name="[USER_NAME]" password="[PASSWORD]">
Line 13: Line 32:
</user>
</user>
</syntaxhighlight>
</syntaxhighlight>
# Edit <tt>{hornetq-folder}/config/stand-alone/non-clustered/hornetq-configuration.xml</tt>
# Edit <tt>{hornetq_install}/config/stand-alone/non-clustered/hornetq-configuration.xml</tt><br>Replace the <tt><security>...</security></tt> section with the following:
# Replace the <tt><security>...</security></tt> section with the following:
#:<syntaxhighlight lang="xml" enclose="div">
#:<syntaxhighlight lang="xml" enclose="div">
<security-settings>
<security-settings>
Line 29: Line 47:
</syntaxhighlight>
</syntaxhighlight>


{{Note|
====Start HornetQ====
:HornetQ is started using <tt>[hornetq-folder]/bin/start.sh</tt>.
Start HornetQ before proceeding with the next step in the installation:
:It should be started before launching the platform's messaging server.
:<tt>{hornetq_install}/bin/run.sh</tt>
{{Note|<br>HornetQ should always be started before launching the platform's messaging server.
:''Learn more: [[Server Restart Sequence]]}}
:''Learn more: [[Server Restart Sequence]]}}


====Configuring the Platform's Service Provider Settings====
====Configure the Platform's Service Provider Settings====
# Go to the {{Service Provider URL}}
# Go to the {{Service Provider URL}}
# Log in as the admin user
# Log in as the admin user
Line 40: Line 59:
# Set values for the following parameters:
# Set values for the following parameters:
::{| border="1" cellspacing="0" cellpadding="2"
::{| border="1" cellspacing="0" cellpadding="2"
| '''HornetQ Host''' || &nbsp;IP address of the server where HornetQ is installed (default: <tt>localhost</tt>)
| '''HornetQ Host''' || &nbsp;IP address of the server where HornetQ is installed<br>&nbsp;(If running on the same server as the messaging server, enter <tt>localhost</tt>)
|-
|-
| '''HornetQ Port''' || &nbsp;Default: 5445.<br>&nbsp;Needs to be specified only if the port specified for the netty acceptor<br> &nbsp;was changed in <tt>hornetq-configuration.xml</tt> &nbsp;
| '''HornetQ Port''' || &nbsp;Default: 5445.<br>&nbsp;Needs to be specified only if the port specified for the netty acceptor<br> &nbsp;was changed in <tt>hornetq-configuration.xml</tt> &nbsp;
Line 46: Line 65:
| '''HornetQ User<br>HornetQ Password''' || &nbsp;Use the same credentials you specified in <tt>hornetq-users.xml</tt>
| '''HornetQ User<br>HornetQ Password''' || &nbsp;Use the same credentials you specified in <tt>hornetq-users.xml</tt>
|-
|-
| '''HornetQ QoS''' || &nbsp;The number of simultaneously working Message Queue listeners.
| '''HornetQ QoS''' || &nbsp;The number of simultaneously working Message Queue listeners.<br>&nbsp;(A typical value is 2.)
|}
|}
:5. Click '''[Save]'''
:5. Click '''[Save]'''
:6. Restart the server to read the new configuration:
:{|
{{:Common:Restart}}
|}


====Creating an SSL Keystore====
====Create 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 Messaging Server accepts only SSL-encrypted connections. It needs a valid SSL certificate to perform a Handshake and data exchange with client systems.  


{{TBD|Which of the following two paragraphs is correct?}}<br>
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.
The same Java keystore, SSL certificate, and private key used for the application server can be used for the Messaging Server.
 
The same Java keystore used for the application server can be used for the Messaging Server. You can create the SSL certificate and private key in that keystore.


:''Learn more:'' [[Managing SSL Certificates]].
:''Learn more:'' [[Managing SSL Certificates]].


====Configuring the Messaging Server====
====Configure the Messaging Server====
# Go to <tt>{appserver_installation}/messaging-server/conf/</tt>.<br>That directory contains two configuration files:
# Start the appserver:
#: <tt>{appserver}/profiles/IS_default/bin/startup.sh</tt>
# Go to <tt>{appserver}/messaging-server/conf/</tt>.<br>That directory contains two configuration files:
#:* <tt>log4j.properties</tt> – standard Apache Log4J configuration file.
#:* <tt>log4j.properties</tt> – standard Apache Log4J configuration file.
#:* <tt>server.properties</tt> – Messaging Server configuration file.
#:* <tt>server.properties</tt> – Messaging Server configuration file.
#:
#:
# In <tt>server.properties</tt>, configure following parameters:
# In <tt>server.properties</tt>, configure the following parameters:
#* <tt>netty_port</tt>
#* <tt>netty_port</tt>
#*: Use 443 if it is on a standalone system.
#*: Use 443 if it is on a standalone system.
#*: If is on the same system as the appserver, then:
#*: If is on the same system as the appserver, then:
#*:* Use the default value (7007)
#*:* Use the default value (7443)
#*:* Add Apache Web Server proxy instructions (see end of document)
#*:* Add Apache Web Server proxy instructions (see end of document)
#* <tt>debug</tt> – set value to “1” if you want to see content of all incoming HTTP requests in the log
#* <tt>debug</tt> – set value to <tt>1</tt> to see content of all incoming HTTP requests in the log.
#*:  Otherwise, use the default value (<tt>0</tt>).
#* <tt>ssl_keystore</tt> – absolute or relative path to your SSL keystore
#* <tt>ssl_keystore</tt> – absolute or relative path to your SSL keystore
#* <tt>ssl_keystore_password</tt> – password for your SSL keystore
#* <tt>ssl_keystore_password</tt> – password for your SSL keystore
#* <tt>customer_db_server</tt> - put proper values for host, username and password to connect to the platform's MySQL Database
#* <tt>message_db_server</tt> - put proper values for host, username and password to connect to the  Messaging Server Database.<br>If the Messaging Server doesn't have a separate MySQL instance, copy the value of <tt>customer_db_server</tt>
#:
#:
# Edit <tt>{appserver_installation}/tomcat/webapps/networking/servicedesk/js/msg_server_link.js</tt>
# In platform's [[Service Provider Settings]], set the '''Messaging Server Host''' parameter to the messaging server's hostname (or IP address) and port. For example, hostname:7443.
# Replace the content of that file with this:
 
#: <tt>var messagingServerHost = "[YOUR_LONGJUMP_HOST_NAME_OR_IP]";</tt>
=====AppServer Installation=====
Follow these steps when running the Messaging Server on the same system as an appserver:
# Copy the messaging script to its target destination:
#: <tt>cp {appserver_installation}/messaging-server/messaging  /etc/init.d/</tt>
# Make <tt>messaging</tt> an autostart script:
#: <tt>cd /etc/init.d/</tt>
#: <tt>chkconfig –add messaging</tt>
 
=====Standalone Installation=====
For maximum performance, follow these steps to run the Messaging Server on a standalone system:
# Install MySQL on the Messaging Server instance. Use the same MySQL credentials as on the appserver.
# Import <tt>messagingdb.sql</tt> into MySQL on the Messaging Server system.
#:'''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 the entire <tt>messaging-server</tt> directory to the installation directory.
#* Copy <tt>es.jar</tt> from the platform's <tt>tomcat/lib</tt> to <tt>messaging-server/lib</tt>
#* Copy the downloaded mysql connector library to <tt>messaging-server/lib</tt>
#* Copy the SSL keystore file directory to <tt>messaging-server/conf/ssl</tt>
#:
# 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>messaging-server/messaging</tt> correct the path for the <tt>cd</tt> command to go to <tt>{install-dir}/messaging-server</tt>
#:
#:
# Copy the messaging script (<tt>{appserver_installation}/messaging-server/messaging) to <tt>/etc/init.d/</tt>
# Copy the messaging script to its target destination:
#: <tt>cp messaging-server/messaging /etc/init.d/</tt>
# Make <tt>messaging</tt> an autostart script:
# Make <tt>messaging</tt> an autostart script:
#: <tt>cd /etc/init.d/</tt>
#: <tt>cd /etc/init.d/</tt>
#: <tt>chkconfig –add messaging</tt>
#: <tt>chkconfig –add messaging</tt>
=====Verifying if the Messaging Server has Started=====
:Run the following commands in the messaging server console:
{{Note|If the server is not up and running, you will not see any output for these commands. In such scenarios, review the server log files.}}
::* <tt>netstat -anop | grep 7443</tt> - Verify if the port 7443 is listening.
::* <tt>ps -ef |grep netty</tt> - Verify if the netty server is up and running.
====Finding the Server Logs====
:* <tt>messaging-server/logs/server.log</tt> contains the runtime log records for the Messaging Server
:* <tt>messaging-server/logs/startup.log</tt> contains startup and class loading errors

Latest revision as of 08:56, 27 August 2021

Warn.png

Warning:

This feature has been deprecated and should not be used with the latest versions of AgileApps. This document is no longer being updated.


Prerequisites

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

Download the Messaging Server

  1. Download the messaging server https://agileappscloud.info/aawiki-src/download/files/messaging-server.tar.gz
  2. Unpack the archive to the application server directory.
    For example:
    cd {appserver}/
    gunzip messaging-server.tar.gz
    tar xfz messaging-server.tar

Install 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>

Start 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

Configure 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 running on the same server as the messaging server, 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 the server to read the new configuration:
  1. Login as root
  2. {install-dir}/profiles/IS_default/bin/restart.sh

Create 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.

Configure the Messaging Server

  1. Start the appserver:
    {appserver}/profiles/IS_default/bin/startup.sh
  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 (7443)
      • 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
    • customer_db_server - put proper values for host, username and password to connect to the platform's MySQL Database
    • message_db_server - put proper values for host, username and password to connect to the Messaging Server Database.
      If the Messaging Server doesn't have a separate MySQL instance, copy the value of customer_db_server
  4. In platform's Service Provider Settings, set the Messaging Server Host parameter to the messaging server's hostname (or IP address) and port. For example, hostname:7443.
AppServer Installation

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

  1. Copy the messaging script to its target destination:
    cp {appserver_installation}/messaging-server/messaging /etc/init.d/
  2. 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 the 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:
    • Copy the entire messaging-server directory to the installation directory.
    • Copy es.jar from the platform's tomcat/lib to messaging-server/lib
    • Copy the downloaded mysql connector library to messaging-server/lib
    • Copy the SSL keystore file directory to messaging-server/conf/ssl
  4. In startmessaging.sh, correct the path for each JAR used in Java classpath to reference the jars in messaging-server/lib
  5. In messaging-server/messaging correct the path for the cd command to go to {install-dir}/messaging-server
  6. Copy the messaging script to its target destination:
    cp messaging-server/messaging /etc/init.d/
  7. Make messaging an autostart script:
    cd /etc/init.d/
    chkconfig –add messaging
Verifying if the Messaging Server has Started
Run the following commands in the messaging server console:

Notepad.png

Note: If the server is not up and running, you will not see any output for these commands. In such scenarios, review the server log files.

  • netstat -anop | grep 7443 - Verify if the port 7443 is listening.
  • ps -ef |grep netty - Verify if the netty server is up and running.


Finding the Server Logs

  • messaging-server/logs/server.log contains the runtime log records for the Messaging Server
  • messaging-server/logs/startup.log contains startup and class loading errors