How to start 2 RMI servers on same machine ?

Hello friends,

I am developing databackup project USING RMI

i want to start servers on same machine and client may be on different machine.

we tried it used as on different port . but it stil not working.

so can u provide me solution for that ,

how to start that two server on the same machine. ?

reply me soon

thanks

[374 byte] By [Ghanshyama] at [2007-10-3 3:10:50]
# 1
Not working how?There is nothing special about multiple RMI servers in one machine. I know one application that has 50,000.
ejpa at 2007-7-14 21:01:38 > top of Java-index,Core,Core APIs...
# 2

Ghanshyam,

It is possible to run multiple RMI servers as long as the port is different. For instance if you run the RMI daemon using port 2700:

rmid -port 2700

and RMI daemon using port 2800:

rmid -port 2800

You will see these ports open if you do an nmap

or netstat -a

Make sure you bind your separate RMI instances on separate ports when calling Naming.bind()

Anthony

Message was edited by:

abargnesi

Message was edited by:

abargnesi

abargnesia at 2007-7-14 21:01:38 > top of Java-index,Core,Core APIs...
# 3

Wrong from start to finish.

There is never a need to run two instances of rmid, which doesn't seem to have anything to do with the question. There also should be no need to change its port, as it's reserved by IANA.

There is no need to use two ports. As long as their socket factories are null or equal, two or more RMI servers in the same JVM can share a single port. This includes the Registry if it is started inside the application JVM, which is my preferred technique. So any number of RMI servers and the Registry can share port 1099 for example.

There is also no need for two RMI registries and therefore also no need to specify different ports to Naming.bind().

Please don't post misinformation.

ejpa at 2007-7-14 21:01:38 > top of Java-index,Core,Core APIs...
# 4
Hi ejp,I had a similar question. I have two disparate applications running on the same or different machines. Is it ok for both to programmatically invoke RMI registries and not share the same. Is there any performance hit that this would take ?Anmol
kamikaze_for_youa at 2007-7-14 21:01:38 > top of Java-index,Core,Core APIs...
# 5
You can have as many Registries as there are JVMs in a machine. There's no performance impact.
ejpa at 2007-7-14 21:01:39 > top of Java-index,Core,Core APIs...
# 6
hi ejp,can i have two application servers running at the same time on a single machine. if no, then what are the reasons for it, if yes then how should i proceed.thanks & regards,detox
DeToXa at 2007-7-14 21:01:39 > top of Java-index,Core,Core APIs...
# 7

> can i have two application servers running at the same time on a single machine.

If you use different ports, you can run several app servers on the same box.

For development purposes, each of our colleagues has an own app server instance on the same box with different ports.

Now the question arises: can we run different web servers on the same box. If yes, how and why? What do you think?

BIJ001a at 2007-7-14 21:01:39 > top of Java-index,Core,Core APIs...
# 8
On which ports would they listen?
bschauwejavaa at 2007-7-14 21:01:39 > top of Java-index,Core,Core APIs...