CS 696 Emerging Technologies: Java Distributed Computing Spring Semester, 1999 Reggie Problems Explained |
||
---|---|---|
© 1999, All Rights Reserved, SDSU & Roger Whitney San Diego State University -- This page last updated 17-Apr-99 |
Starting Reggie Services
When you start a reggie service, the class com.sun.jini.reggie.RegistrarImpl is registered with rmid and rmid will create an instance of that class. This instance is the reggie server. Hence who ever starts the rmid will own the reggie server process. If your rmid uses a nonstandard process then you must inform reggie of the rmid port number. Set the java.rmi.activation.port property. See http://www-rohan.sdsu.edu/java/jdk1.2/docs/guide/rmi/spec/rmi-properties.doc2.html for details. The following uses the rmid listening on port 5435.
java -Djava.rmi.activation.port=5435 -jar /opt/jini1_0/lib/reggie.jar http://fargo.sdsu.edu:8888/reggie-dl.jar /opt/jini1_0/example/lookup/policy /tmp/whitney/reggie_log whitney.rohan.sdsu.edu
A slightly better version of this command is:
java -Djava.rmi.activation.port=5435 -jar /opt/jini1_0/lib/reggie.jar http://fargo.sdsu.edu:8888/reggie-dl.jar /opt/jini1_0/example/lookup/policy $HOME/reggie_log ´whoami´"."´hostname´"."´domainname´
this will use your home directory for the reggie log file and your login name, machine host name and domain name for the group.
A Shell Script Here is a modified version of the script that I use to start reggie
#/bin/csh #Start jini services switch ($#) case 0: case 1: echo "Usage: reggie httpPort rmidPort" exit 2 endsw set httpPort=$1; set rmidPort=$2; set jiniDir=/opt/jini1_0/lib set jiniLog=~whitney/jini_data/jini_logs set jiniData=~whitney/jini_data rm -R $jiniLog/reggie java -Djava.rmi.activation.port=$rmidPort -jar $jiniDir/reggie.jar http://eli.sdsu.edu:$httpPort/reggie-dl.jar $jiniData/policy $jiniLog/reggie ´whoami´"."´hostname´"."´domainname´ & echo "reggie started"
Some rmid Magic
Start rmid on port X
"Start reggie" (i.e. register it with rmid on port X & let rmid start reggie)
Run ps to get a list of processes
Note the pid of the reggie process
Use the kill command to kill the reggie process
Run ps again.
Note that reggie is running, but has a new pid!
rmid restarts reggie
Example rohan 107-> ps PID TT S TIME COMMAND 20590 pts/56 S 0:00 -tcsh 24493 pts/56 S 0:02 /opt/java/bin/../rmid -port 23456 25196 pts/56 S 0:12 /opt/../java -cp reggie 22766 pts/112 S 0:00 -tcsh rohan 108-> kill 25196 rohan 109-> ps PID TT S TIME COMMAND 20590 pts/56 S 0:00 -tcsh 24493 pts/56 S 0:02 /opt/java/bin/../rmid -port 23456 27255 pts/56 S 0:01 /opt/../java -cp reggie 22766 pts/112 S 0:00 -tcsh
More rmid Magic
Stop rmid with the command:
rmid -stop -port X
Use ps to verify that both rmid & reggie are not running
Start rmid in the directory that contains the rmid log, that is from the same location you first started rmid
Use ps to verify that both rmid & reggie are both running
Use the kill command to kill both rmid & reggie
Start rmid in the directory that contains the rmid log, that is from the same location you first started rmid
Use ps to verify that both rmid & reggie are both running
rmid is your friend
Some Questions