Instal.lació Openbravo 2.50

De Wikijoan
Dreceres ràpides: navegació, cerca
export ANT_HOME=/opt/apache-ant-1.8.0
export PATH=${PATH}:${ANT_HOME}/bin

(fer-ho per l'usuari joan i per l'usuari root)

ficar aquestes variables a /etc/environment

Descarrego OpenbravoERP-2.50MP13.tar.bz2. Descomprimeixo. Llegeixo el README

Tinc instal.lats el Postgres, ant, Tomcat i un servidor Pentaho (opcional però vull avaluar aquesta opció).

First, download the setup binary corresponding to your system:

$ cd /home/joan/Descargas/OpenbravoERP-2.50MP13/
$ ant setup
Buildfile: /home/joan/Descargas/OpenbravoERP-2.50MP13/build.xml/manager/html

setup.check.os:

setup.check.arch:

setup.exists.test:

setup:
      [get] Getting: https://dev.openbravo.com/svn/packaging/setup/output/setup-properties-linux.bin
      [get] To: /home/joan/Descargas/OpenbravoERP-2.50MP13/config/setup-properties-linux.bin
      [get] ....................................................
      [get] ....................................................
      [get] ............................

BUILD SUCCESSFUL
Total time: 11 seconds

Next run the downloaded file in the config directory. For example in x86 Linux:

$ sudo bash (no cal)
$ cd config/
$ ./setup-properties-linux.bin (com a root) (no cal)

aquest fitxer és el binari d'instal.lació

Selecciono Postgres:

El tema del Pentaho Server i la Authentication Class ho deixo de banda. Ho faré a posteriori seguint l'article:

Comença la instal.lació, i acaba ràpidament sense cap missatge d'error, quan de fet hauria d'haver trigat una bona estona.

$ tail -f /opt/OpenbravoERP/installation_logs/01database.log -> no exsteix. L'altra possibilitat és passar d'aquest bin i compilar.

$ ant install.source

It creates the database structure, builds the core, compiles Openbravo and generates a war file. Comença a crear-se la base de dades.

Deploy this war file into the tomcat/webapps directory. (/usr/share/tomcat6)

BUILD FAILED
SQL Command failed with: ERROR: no se pudo acceder al archivo «$libdir/uuid-ossp»: No existe el fichero ó directorio

Trobo la solució a:

(No hi ha cap necessitat d'instal.lar com a root.)

$ sudo apt-get install libuuid1 (ja ho tenia instal.lat)
$  sudo apt-get install postgresql-contrib

Torno a compilar

BUILD FAILED

Les coses que han fallat són:

...
compile.src.gen:
    [javac] /home/joan/OpenbravoERP-2.50MP13/src/build.xml:354: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
...
[importsampledata] java.lang.OutOfMemoryError: Java heap space
...
Caused by: java.lang.OutOfMemoryError: Java heap space
...
Total time: 39 minutes 44 seconds

Prueba a darle mas memoria. In order to avoid HTTP Status 500 - java.lang.OutOfMemoryError: Java heap space, increase the value of -Xmx option in Apache Tomcat CATALINA_OPTS variable.

CATALINA_OPTS="-server -Djava.awt.headless=true -Xms384M -Xmx1024M -XX:MaxPermSize=256M"
JAVA_OPTS="-Xms384M -Xmx1024M -XX:MaxPermSize=256M"
ANT_OPTS=" -Xms384M -Xmx1024M -XX:MaxPermSize=256M"

export CATALINA_OPTS="-server -Djava.awt.headless=true -Xms384M -Xmx1024M -XX:MaxPermSize=256M"
export JAVA_OPTS="-Xms384M -Xmx1024M -XX:MaxPermSize=256M"
export ANT_OPTS=" -Xms384M -Xmx1024M -XX:MaxPermSize=256M"
BUILD SUCCESSFUL
Total time: 30 minutes 38 seconds
copy.files:
      [sql] Executing commands
      [sql] 2 of 2 SQL statements executed successfully
    [mkdir] Created dir: /usr/share/tomcat6/webapps/openbravo
     [copy] Copying 10105 files to /usr/share/tomcat6/webapps/openbravo
    [mkdir] Created dir: /usr/share/tomcat6/webapps/openbravo/WEB-INF/classes
     [copy] Copying 3287 files to /usr/share/tomcat6/webapps/openbravo/WEB-INF/classes

Openbravo 2.50 a Ubuntu (amb paquet)

  Hardware

    * In order to install Openbravo ERP 2.50 it is necessary to have at least 1024MB of RAM.

(no m'estranya que tingui problemes...)

La manera més pràctica és insta.lar-ho a partir del paquet, tal com s'explica aquí.

Openbravo 2.50: Custom Installation

Després de setup-properties-linux.bin, Configure the Openbravo.properties and log4j.lcf files using the configuration wizard.

A Openbravo.properties puc escollir que es generi només el .war (es genera dins de lib), i més tard faré el deploy.

#Deploy mode: valid values [class, war, none]
#deploy.mode=class
deploy.mode=war 

El que fa el .bin és editar Openbravo.properties i log4j.lcf, que es poden editar manualment.

$ ant install.source

build.war:
      [war] Building war: /home/joan/Descargas/OpenbravoERP-2.50MP13/lib/openbravo.war

BUILD SUCCESSFUL
Total time: 32 minutes 59 seconds
ant deploy.context (amb el Tomcat engegat...)
...
BUILD SUCCESSFUL
Total time: 1 minute 37 seconds

Before you access your Openbravo instance, it is strongly recommended that you run the following command to validate your system configuration:

ant diagnostic
...
BUILD FAILED
/home/joan/Descargas/OpenbravoERP-2.50MP13/build.xml:787: The following error occurred while executing this line:
/home/joan/Descargas/OpenbravoERP-2.50MP13/src-diagnostics/build.xml:58: The following error occurred while executing this line:
/home/joan/Descargas/OpenbravoERP-2.50MP13/src-diagnostics/build.xml:115: The following error occurred while executing this line:
/home/joan/Descargas/OpenbravoERP-2.50MP13/src-diagnostics/build.xml:157: Server seems not to be Tomcat

Total time: 37 seconds

El problema és del tomcat. A la línia 58 tinc:

    <antcall target="check.tomcat" />

    <antcall target="check.tomcat.version" />

  <target name="check.tomcat.version">
    <taskdef name="checkTomcatVersion" classname="org.openbravo.task.CheckTomcatVersion">
      <classpath refid="diagnostic.class.path" />
    </taskdef>
    <checkTomcatVersion />
  </target>

Miro el openbravo.log, i obtinc errors de tipus PermGen space

This error occurs when the JVM runs out of space in the permanent generation heap. Since the defaults for the JVM are quite low, the first step should be to increase the default using -XX:MaxPermSize.

Minimal hardware requirement for Openbravo is 1GB RAM preferably 2Gb and Dual Core processor or equivalent 1.8Ghz, or higher. Even if you achieve to run Openbravo on 256 RAM it will not going to serve sessions for other users, for that more than 2GB rather 4GB is needed.

Solució

Amplio la memòria RAM a 2,5GB

CATALINA_OPTS="-server -Djava.awt.headless=true -Xms384M -Xmx1024M -XX:MaxPermSize=256M"
JAVA_OPTS="-Xms384M -Xmx1024M -XX:MaxPermSize=256M"
ANT_OPTS=" -Xms384M -Xmx1024M -XX:MaxPermSize=256M"

export CATALINA_OPTS="-server -Djava.awt.headless=true -Xms384M -Xmx1024M -XX:MaxPermSize=256M"
export JAVA_OPTS="-Xms384M -Xmx1024M -XX:MaxPermSize=256M"
export ANT_OPTS=" -Xms384M -Xmx1024M -XX:MaxPermSize=256M"

i també és important fer aquests canvis permanents.

S'instal.la bé

el fitxer openbravo.war que s'ha generat està en la carpeta /OpenbravoERP-2.50MP13/lib/

Ara hem de desplegar el war. Copiem el war a la carpeta webapps/ del Tomcat, apaguem i arrenquem el Tomcat, i ja s'haurà desplegat.

$ sudo cp openbravo.war /usr/share/tomcat6/webapps
$ sudo /usr/share/tomcat6/bin/shutdown.sh
$ sudo /usr/share/tomcat6/bin/startup.sh

(Si no va, tornar a arrencar l'ordinador...)

Eines de l'usuari
Espais de noms
Variants
Accions
Navegació
IES Jaume Balmes
Màquines recreatives
CNC
Informàtica musical
joanillo.org Planet
Eines