Hi, I am a novice XMPP developer who try to install and configure an Openfire server in a Debian distribution. I have installed it following this process:
$wget http://www.igniterealtime.org/downloadServlet?filename=openfire/openfire_3.6.2_a ll.deb --output-document=openfire_3.6.2_all.deb
100%[====================================>] 11,641,798 739.80K/s ETA 00:00
09:29:49 (659.55 KB/s) - `openfire_3.6.2_all.deb' saved [11641798/11641798] $dpkg -i openfire_3.6.2_all.deb Selecting previously deselected package openfire. |
However, it doesn't work. I think that it is a problem related with JVM, because of this:
$ java -version |
I have found this document in the fourm, but I don't found the bin/openfire document.These are the Openfire configuration files in the server:
$ apt-cache show openfire |
I have checked that admininstration console ports are rigth in /etc/openfire/openfire.xml
<adminConsole> |
and I have also changed some JVM parameters in /etc/sysconfig/openfire unsuccessfully.
# If you wish to set any specific options to pass to the JVM, you can |
Does anybody know what could be wrong?
Thanks in advance
A folder named"sysconfig" doesn't exist in my debian etch install. But it seems that you try to run Openfire in virtualized environment (perhabs Virtuozzo or OpenVZ). I encountered the same problem on my virtual server (although I also had problems installing the JVM). My solution was to edit the /etc/init.d/openfire. There is variable named DAEMON_OPTS in which you can insert -Xmx??m to set the maximal heap size to ?? MB. That worked for me under Debian etch in Virtuozzo environment.
You are right, I am working in a strato virtual server. I have found DAEMON_OPTS variable in /etc/init.d/openfire file and I have tried to set -Xms and -Xmx to several values, but unluckily it didn't work.
Thanks you anyway.
Strange for me this fix worked: How does your DAEMON_OPTS line looks? My first line of the DAEMON_OPTS variable looks like this:
DAEMON_OPTS="$DAEMON_OPTS -Xmx64m -server -DopenfireHome=${DAEMON_DIR} \
This way I let Openfire 64 MB for his heap. In total this makes about 100-120 MB of memory usage. May I ask how your virtual machine is configured and how much does ist cost? I considered to change my provider because I'm running very often in trouble with my numproc counter. I have a limit of 240 but Openfire seems to consume very much of the numproc ressource.
Firsts lines in my etc/init.d/openfire are:
| /etc/init.d/openfire |
|---|
#!/bin/sh
# Attempt to locate JAVA_HOME, code borrowed from jabref package
PATH=/sbin:/bin:/usr/sbin:/usr/bin:${JAVA_HOME}/bin test -x $JAVA || exit 0
# Include openfire defaults if available
DAEMON_OPTS="$DAEMON_OPTS -Xmx64m -server -DopenfireHome=${DAEMON_DIR} \ ... |
So I am pretty sure that something is wrong somewhere else. I think that available memory is enough:
| $free -m result | total | used | free | shared | buffers | cached |
|---|---|---|---|---|---|---|
| Mem | 2019 | 1992 | 26 | 0 | 211 | 862 |
| -/+ buffers/cache | 918 | 1100 | ||||
| Swap | 2996 | 2 | 2993 |
And it seems to be the problem with JVM. Somebody has told me that there was an old version of openfire working in this machine some time ago. I have tried to reinstall some old versions, but the result is the same:
| $java -version |
|---|
Error occurred during initialization of VM Could not reserve enough space for object heap |
Thanks again.
The problem in Virtuozzo environments ist that the command "free" does not deliver reliable results. I my case on a machine from keyweb ist shows me the total memory of the host machine although I only have 768 MB available in my vserver. That is also the reason why java has memory problems. It tries to allocate too much memory because it "sees" the whole memory of the host machine (at least thats my theory so far). If you run the command "java -Xmx32m -version" you should get a proper output.
Your DAEMON_OPT variable looks ok. Just like mine. You said that someone already run Openfire on that virtual machine. Didn't set up everything yourself. Because already the installatiion of sun-java5-bin should be problemativ and should have gone wrong on a vserver. Another thing ist that 64 MB ist just the heap size you allow the JVM to allocate. But heap ist not the only memory. If you have only 128 MB total RAM for your vserver it is likely that your really have too few memory.
Hi,
you should have read http://www.igniterealtime.org/community/docs/DOC-1021 - VPS are not meant to run Java applications.
In any case you need to tune the JVM to use as little memory as possible which also means that your installation may support not more than 100 users. You could try it with parameters like:
-Xms16m -Xmx32m -Xss128k -XX:ThreadStackSize=128 -XX:PermSize=8m -XX:MaxPermSize=64m -XX:+PrintGCDetails -Xloggc:/tmp/gc.log -Djava.net.preferIPv4Stack=true -server
Monitor the GC log and adjust the Xmx and (decrease) MaxPermSize values as needed.
To start Openfire you need to chdir to the directory and enter "java -Xms16m -Xmx32m -Xss128k -XX:ThreadStackSize=128 -XX:PermSize=8m -XX:MaxPermSize=64m -XX:+PrintGCDetails -Xloggc:/tmp/gc.log -Djava.net.preferIPv4Stack=true -server -jar lib/startup.jar" - that's much faster for tests than running the start script.
LG
Good news. I have reinstalled JRE6 and executed the command that you have suggest me, and it is the result:
| /usr/share/openfire/lib$ java -Xms16m -Xmx32m -Xss128k -XX:ThreadStackSize=128 -XX:PermSize=8m -XX:MaxPermSize=64m -XX:+PrintGCDetails -Xloggc:/tmp/gc.log -Djava.net.preferIPv4Stack=true -server -jar ./startup.jar |
|---|
| Could not locate home java.io.FileNotFoundException at org.jivesoftware.openfire.XMPPServer.locateOpenfire(XMPPServer.java:827) at org.jivesoftware.openfire.XMPPServer.initialize(XMPPServer.java:296) at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:415) at org.jivesoftware.openfire.XMPPServer.<init>(XMPPServer.java:161) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct orAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC onstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:106) at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.ja va:51) Critical Error! The home directory has not been configured, which will prevent the application from working correctly.
|
I have to look for the solution to this new problem but I have more information to solve it now. If I found any problems,I ask in this thread: http://www.igniterealtime.org/community/thread/28410. Thanks to deureulenspiegel and LG for your suggestions.
Hi,
you may need to "cd openfire/bin" before you start java. And then use "... ../lib/startup.jar" instead of "... ./lib/startup.jar"
LG