Jämförda versioner

Nyckel

  • Dessa rader lades till.
  • Denna rad togs bort.
  • Formateringen ändrades.


Innehållsförteckning

Installera Mule och påför generella runtimeberoenden

  1. Följ rekommenderad instruktion för att installera Mule på https://code.google.com/p/soi-toolkit/wiki/IG_RT_MuleESB.

  2. Ladda ner ActiveMQ-jar (ActiveMQ 5.9.1) från från följande länk och tillför den på:
    1. Mule-3.3.1: <MULE_HOME>/lib/shared/default/

      Varning

      Mule-3.3.1: notera att det är viktigt att ActiveMQ-jar ligger under <MULE_HOME>/lib/shared/default/ för att inte orsaka problem med att applikationsloggar hamnar i fel logfiler (andra applikationers logfiler).


    2. Mule-3.7.0: <MULE_HOME>/lib/user/
      Not: shared-dir som används för Mule-3.3.1 är deprecated för Mule-3.7.0 
  3. Mule-3.7.0: Två patchar måste tillföras Mule 3.7.0, se "Anvisningar för rättningar av Mule" längre ned på denna sida.
Info
titleVal av activeMQ-bibliotek

Det är bättre att följa Mulesofts rekommendationer och undvika activemq-all-x.x.x.jar och istället lägga in endast de jar-filer som behövs. Se https://docs.mulesoft.com/mule-user-guide/v/3.7/activemq-integration. Speciellt för EI rekommenderas detta starkt.


Minnesparametrar

Se över minnesinställningar för heapsize på heapsize på Mule installationen

I NTjP, den nationella instansen av SKLTP används följande inställningar vad gäller heapsize för Mule på en server med 8GB arbetsminne.

...

Se över minnesinställningar för MaxPermSize för MaxPermSize på Mule installationen

Info
titleJava 8

Avsnittet nedan gäller endast Java 7, För Java 8 har denna parameter avvecklats. Vid uppstart av Mule fås ett varningsmeddelande (som kan ignoreras)

JavaHotSpot(TM)64-BitServer VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0


Enligt http://www.mulesoft.org/jira/browse/MULE-6544 så sätts MaxPermSize till 256m. Om det finns behov av att uppdatera denna parameter, tex för att klara av fler applikationer i samma Mule instans, så behövs följande konfiguration uppdateras i filen <MULE_HOME>/bin/Additionaladditional.groovy:

// increase max PermGen space size
// IBM JVM doesn't have a notion of the PermGen space
if (!System.properties."java.vm.vendor".toUpperCase().contains("IBM")) {
     w << "wrapper.java.additional.${paramIndex++}=-XX:MaxPermSize=512m\n"
}

...

verifiera ändringen genom att gå in i Mule Management Console och titta på värdet Perm Gen enligt bilden nedan.

Konfigurera loggning

log4j.properties

Default konfigureras loggning i Mule  i <MULE_HOME>/conf/log4j.properties. Varje applikation som driftsätts i Mule rekommenderas bära sin egen konfigurationsfil för loggning, som styr vart applikationen skall logga och hur det skall loggas.

...

Kodblock
# Default log level
log4j.rootCategory=INFO, console
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%-5p %d [%t] %c: %m%n


################################################
# You can set custom log levels per-package here
################################################


# Reduce noise for Mule High Availability 
log4j.logger.com.gigaspaces=ERROR
log4j.logger.com.j_spaces=ERROR
log4j.logger.com.sun.jini=ERROR
log4j.logger.net.jini=ERROR


# CXF is used heavily by Mule for web services
log4j.logger.org.apache.cxf=WARN

# Apache Commons tend to make a lot of noise which can clutter the log.
log4j.logger.org.apache=WARN
# Reduce startup noise
log4j.logger.org.springframework.beans.factory=WARN

# Mule classes
log4j.logger.org.mule=INFO
log4j.logger.com.mulesoft=INFO

wrapper.conf

I <mule_home>/wrapper.conf kan man konfigurera loggning, tex storlek på mule.log (mule_ee.log).

Kodblock
titlewrapper.conf
 #********************************************************************
# Wrapper Logging Properties
#********************************************************************
# Format of output for the console.  (See docs for formats)
wrapper.console.format=M
# Log Level for console output.  (See docs for log levels)
wrapper.console.loglevel=INFO

# Log file to use for wrapper output logging.
wrapper.logfile=%MULE_BASE%/logs/%MULE_APP%.log

# Format of output for the log file.  (See docs for formats)
wrapper.logfile.format=M

# Log Level for log file output.  (See docs for log levels)
wrapper.logfile.loglevel=INFO

# Maximum size that the log file will be allowed to grow to before
#  the log is rolled. Size is specified in bytes.  The default value
#  of 0, disables log rolling.  May abbreviate with the 'k' (kb) or
#  'm' (mb) suffix.  For example: 10m = 10 megabytes.
wrapper.logfile.maxsize=10m

# Maximum number of rolled log files which will be allowed before old
#  files are deleted.  The default value of 0 implies no limit.
wrapper.logfile.maxfiles=10

# Log Level for sys/event log output.  (See docs for log levels)
wrapper.syslog.loglevel=NONE


Stoppa och starta Mule

Hantera start och stop av Mule

...

<MULE_HOME>/bin ./mule start -app vp-services-2.2.0-RC2:skltp-ei-application-mule-backend-app-1.0.0-RC6:skltp-ei-application-mule-frontend-app-1.0.0-RC6

 

Exempel


Nedan är ett exempel från NTjP, där startordningen på applikationer definierats i ett script med filnamn start.sh.

Notera att det måste vara :'  i slutet av alla APPLICATIONS rader, utom den sista

...

Kodblock
wrapper.java.additional.4=-Dcom.sun.management.jmxremote.port=<port nr>
wrapper.java.additional.5=-Dcom.sun.management.jmxremote.password.file=%MULE_HOME%/conf/jmx.password
wrapper.java.additional.6=-Dcom.sun.management.jmxremote.ssl=false

...


Skapa filen %MULE_HOME%/conf/jmx.password enligt nedan och sätt lösenord på de 2 rollerna monitorRole och controlRole.

Kodblock
##############################################################
#    File permissions of the jmxremote.password file
##############################################################
#      Since there are cleartext passwords stored in this file,
#      this file must be readable by ONLY the owner,
#      otherwise the program will exit with an error.
#
# The file format for password and access files is syntactically the same
# as the Properties file format.  The syntax is described in the Javadoc
# for java.util.Properties.load.
# Typical password file has multiple  lines, where each line is blank,
# a comment (like this one), or a password entry.
#
#
# A password entry consists of a role name and an associated
# password.  The role name is any string that does not itself contain
# spaces or tabs.  The password is again any string that does not
# contain spaces or tabs.  Note that passwords appear in the clear in
# this file, so it is a good idea not to use valuable passwords.
#
# A given role should have at most one entry in this file.  If a role
# has no entry, it has no access.
# If multiple entries are found for the same role name, then the last one
# is used.
#
# In a typical installation, this file can be read by anybody on the
# local machine, and possibly by people on other machines.
# For # security, you should either restrict the access to this file,
# or specify another, less accessible file in the management config file
# as described above.
#
monitorRole <some password>
controlRole <some password>

 


Filen jmx.password skall endast ha rättigheter att kunna läsas av användaren, inga andra rättigheter, för att Mule skall starta. Detta kan man på linux åstadkomma med följande.

Kodblock
$chmod 400 jmx.password

Firewall tunnling av JMX

Lägg till nedan i ACTIVEMQ_HOME/bin/<operativsystem>/wrapper.conf (under de avkommenterade raderna ovan) och ändra "n" i "wrapper.java.additional.n" så att "n" för varje rad nedan är ett nummer i den befintliga sekvensen i filen.

Inget format
# Firewall tunnelling of JMX
#-----------------------------------------------------------------------------
# Note: by default (Java 7) two ports are needed, the com.sun.management.jmxremote.port
#   and a second port which is dynamically allocated by the server.
#   To avoid dynamic allocation of the second port, add property
#   com.sun.management.jmxremote.rmi.port below and set it to the same port as
#   the first port for convenience (fewer holes in the firewall).
#   This is available in Java 7 > update 4 according to blog:
#     "Tunneling JMX in the 7u4 JDK", http://hirt.se/blog/?p=289
#   but the property is missing from the official Java docs for both Java 7 and 8:
#     http://docs.oracle.com/javase/7/docs/technotes/guides/management/agent.html
#-----------------------------------------------------------------------------
wrapper.java.additional.n=-Dcom.sun.management.jmxremote.rmi.port=<PORT NUMBER>


Anvisningar för rättningar av Mule

För skltp finns ett antal obligatoriska patchar för Mule. För aktuella patchar och installationsanvisningar, se Release Note - Patchar för Mule.

För Mule 3.7.0 se också Release notes SKLTP 3.0.0.