IMF-GEC13-QSR: PubSub_for_PerfSONAR-README.txt

File PubSub_for_PerfSONAR-README.txt, 6.3 KB (added by Rudra Dutta, 9 years ago)

IMF Optical Measurement Handler using IMF Messaging Service - Document

1Setting up and testing the prototype implementation of PSM (Publish-Subscribe) module to connect to perfSONAR
5-> These components are necessary to run:
6        - Openfire XMPP server( Download and install the latest version.
7        - PSM prototype software (use svn to download the source code. instructions are detailed below).
8        - A publish subscribe client: two options are available
9                -> a Psi IM client ( Download and install the latest version.
10                -> or a trivial subscriber application included with PSM (included in the svn source code download)
14$ export IMF_HOME=$HOME/IMF
15Install java 1.6 sdk, recent versions of Maven and Ant. Be sure java, mvn and ant executables are on your path.
18On geni-imf-dev host append the following to your .bashrc file (may vary on
19different platforms, here CentOS5.5 and default installations are assumed):
20export JAVA_HOME=/opt/java/jdk1.6.0_18
21export ANT_HOME=/opt/java/apache-ant-1.8.0
22export MAVEN_HOME=/opt/java/apache-maven-2.2.1
23export PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$MAVEN_HOME/bin:$PATH
26Setting up Openfire
27Download and setup  Openfire according to instructions. Notice, it is already running on, so this step can be skipped. It is setup to use BEN LDAP credentials.
30Setting up PSM prototype
31Check out the code out of the repository :
32$ cd $HOME
33$ svn co
34$ cd $IMF_HOME/imf_pfsr/src/psm
35$ mvn install assembly:assembly
37The last line attempts to perform a build. If maven reports problems with unavailable jars (jms, mail, jmxtools, jmxri, smack-pubsub, smackx-pubsub) they can be installed manually as follows:
38$ mvn install:install-file -DgroupId=org.jivesoftware.smackx -DartifactId=smackx-pubsub -Dversion=3.1.0 -Dpackaging=jar -Dfile=lib/smackx.jar
39$ mvn install:install-file -DgroupId=org.jivesoftware.smack -DartifactId=smack-pubsub -Dversion=3.1.0 -Dpackaging=jar -Dfile=lib/smack.jar
40$ mvn install:install-file -DgroupId=javax.mail -DartifactId=mail -Dversion=1.4 -Dpackaging=jar -Dfile=lib/mail-1.4.jar
41$ mvn install:install-file -DgroupId=javax.jms -DartifactId=jms -Dversion=1.1 -Dpackaging=jar -Dfile=lib/jms.jar
42$ mvn install:install-file -DgroupId=com.sun.jdmk -DartifactId=jmxtools -Dversion=1.2.1 -Dpackaging=jar -Dfile=lib/jmxtools.jar
43$ mvn install:install-file -DgroupId=com.sun.jmx -DartifactId=jmxri -Dversion=1.2.1 -Dpackaging=jar -Dfile=lib/jmxri.jar
45Repeat the build attempt:
46$ mvn install assembly:assembly
47A jar including all the dependencies should be built in target/psm-0.1-jar-with-dependencies.jar
51PSM will require "can_pub" and "can_sub" credentials to the node namespace (for eg. Repository).
53Instructions on how to generate the .jks file are as follows:
551. Obtain cert-keypairs by emailing to Anirban Mandal ( anirban AT )  what is the node namespace for which you need pub/sub credentials.
572. Creating a pkcs12 file with your cert and key:
59   Eg:
60   openssl pkcs12 -export -in ashu-cert.pem -inkey ashu-key.pem -out ashu-gcf-encrypted.p12
62   Remember the password you enter in this step. You will need that later in step 2.d  Some clients just need this .p12 file and this password to log in.
643. Importing cert-keypair to java keystore.
66   Use Portecle:
67   Click Launch.
69* Create a new keystore of type JKS
70* Click on "Import Key Pair"
71* Locate the .p12 file (ashu-gcf-encrypted.p12 in the example)
72* Enter the password protecting the .p12 file
73* Import the key and certificate, but change the key alias to something simpler than a GUID
74* Enter and confirm a new key password (I usually give the same password as the one protecting .p12 file)
75* Click on "Save Keystore"
76* Enter and confirm the new keystore password (use same as the key password)
78This will result in the java keystore. PSM will need path to this keystore and the password above to log in through measurement/
80Running PSM
81Create a file. A sample file is located on the top directory ~IMF/
82Save it in $IMF_HOME.
84Create a file called A sample file is located on the top directory ~IMF/
85Save it in $IMF_HOME.
88Start PSM by
89$ cd $IMF_HOME/imf_pfsr/src/psm
90$ java -cp $IMF_HOME:target/psm-0.1-jar-with-dependencies.jar org.renci.geni_imf.psm.Simple
91You should observe it successfully connect to perfSONAR and perform logins to devices and start publishing measurements. You should run this program at background so it can keep publishing data to subscribers.
93Viewing measurements
95You can observe the measurement nodes by downloading and installing the  Psi IM client. Once you log in to the openfire server ( using your BEN credentials) you can do 'Service Discovery', open and see the available measurement nodes. You cannot see their values.
97Alternatively you can start up a simple subscribe client. First create a file in $IMF_HOME:
98IMF.pubsub.server=<openfire host:port, for BEN it is>
99IMF.pubsub.login=<login to openfire server>
100IMF.pubsub.password=<password to openfire server>
101Then start the client
103$ cd $IMF_HOME/imf_pfsr/src/psm
104$  java -cp $IMF_HOME:target/psm-0.1-jar-with-dependencies.jar org.renci.geni_imf.psm.SimpleSubscriber
105The window will show available nodes with checkbuttons next to them. Clicking on one or more of them and clicking 'Subscribe' will initiate the XMPP subscription and the values will begin to be displayed. Unclicking nodes and clicking 'Subscribe' will cancel all subscriptions.
107Clearing all measurement nodes
108$ java -cp $IMF_HOME:target/psm-0.1-jar-with-dependencies.jar:./src/main/resources/org/renci/geni_imf/psm/ org.renci.geni_imf.psm.ClearPubSub
111If your PSM returns errors such as authentication problem, make sure you have
112the right username and password in
113If there is any existing node that is not created by you, you will be
114forbidden to publish data to that node. You can either use a different root
115node in or ask the owner of that node to delete it.
117Note -  for our implementation the modules need VPN access to each other's running machines