Two servers on the same machine

catruchos9 years ago

In order to test the new versions with changes and imporvemets

¿Would be possible to install two different and separate servers on the same machine (raspberry pi) each one listening on different ports ?

¿ How this can be done ?,

I imagine that duplicating the folder /opt/traccar and after that duplicate the service somehow

Thanks

Anton Tananaev9 years ago

Funny thing is that just today I installed two instances of Traccar on the same machine. Basically you need to copy the folder and then change "traccar/bin/traccar" and "traccar/conf/wrapper.conf" files. Rename all "traccar" to "traccar2" or some other name. Make sure you rename in the comments as well.

roshi_mty8 years ago

Hi Anton i'm trying to make work 2 instances at the same time but i have a problem with the windows service, i have the two installations in different folder but when the service is running just work one at the time.

already changed ports, folder names and the previous changes you mentioned.

thanks in advance amazing job by the way.

Anton Tananaev8 years ago

You need to make sure each service has a unique name, and ports are not conflicting.

roshi_mty8 years ago

ok wow, that was fast.

i changed it to Traccar and Traccar2
i changed the port in default.xml to 8082 and 8083

v3.9 Traccar path in properties:

java.exe -classpath "C:\Program Files\Traccar39\wrapper.jar" -Xrs -Dwrapper.service=true -Djava.net.preferIPv4Stack=true "-Dwrapper.config=C:\Program Files\Traccar39\conf\wrapper.conf" -Dwrapper.additional.1x=-Xrs -Djna_tmpdir=C:\Users\ADMINI~1\AppData\Local\Temp\2 org.rzo.yajsw.boot.WrapperServiceBooter

V3.8 Traccar2 path in properties:

java.exe -classpath "C:\Program Files (x86)\Traccar2\wrapper.jar" -Xrs -Dwrapper.service=true -Djava.net.preferIPv4Stack=true "-Dwrapper.config=C:\Program Files (x86)\Traccar2\conf\wrapper.conf" -Dwrapper.additional.1x=-Xrs -Djna_tmpdir=C:\Users\ADMINI~1\AppData\Local\Temp\2 org.rzo.yajsw.boot.WrapperServiceBooter

but only the first one running work.

thanks

Anton Tananaev8 years ago

Where did you change it? In the wrapper config file?

roshi_mty8 years ago

yes in the wrapper config file
the port in the default.xml file

in the Traccar2 which is v3.8

wrapper.java.command=java
wrapper.java.app.jar=tracker-server.jar
wrapper.app.parameter.1=./conf/traccar2.xml
wrapper.java.additional.1=-Dfile.encoding=UTF-8
wrapper.logfile=logs/wrapper.log.YYYYMMDD
wrapper.logfile.rollmode=DATE
wrapper.ntservice.name=traccar2
wrapper.ntservice.displayname=Traccar2
wrapper.ntservice.description=Traccar2

in Traccar which is v3.9

wrapper.java.command=java
wrapper.java.app.jar=tracker-server.jar
wrapper.app.parameter.1=./conf/traccar.xml
wrapper.java.additional.1=-Dfile.encoding=UTF-8
wrapper.logfile=logs/wrapper.log.YYYYMMDD
wrapper.logfile.rollmode=DATE
wrapper.ntservice.name=traccar
wrapper.ntservice.displayname=Traccar
wrapper.ntservice.description=Traccar
wrapper.daemon.run_level_dir=${if (new File('/etc/rc0.d').exists()) return '/etc/rcX.d' else return '/etc/init.d/rcX.d'}
Anton Tananaev8 years ago

OK, configurations look good. Have you checked logs for errors?

Hicham6 years ago

Unable to locate the class org.traccar.Main

Anton Tananaev6 years ago

Have you compiled it yourself? Or are you using official release?

Pinakin Shobhana6 years ago

Hello Anton
i have use traccar 4.2 in this version does not found wrapper config file so how can i change log file wrapper.log to wrapper.log.YYYYMMDD

Anton Tananaev6 years ago

There's no wrapper log file

Pinakin Shobhana6 years ago

Thanks for replay me

traccar 4.2 how can i change log file tracker-server.log to tracker-server.log.yyyymmdd
i want a every day new file to store log

Anton Tananaev6 years ago

That's how Traccar works by default.

Pinakin Shobhana6 years ago

default all log store in tracker-server.log file but i want a day wise tracker-server.log every day store new log file