Setting up and testing the prototype implementation of PSM (Publish-Subscribe) module to connect to perfSONAR Installation -> These components are necessary to run: - Openfire XMPP server(http://www.igniterealtime.org/projects/openfire/). Download and install the latest version. - PSM prototype software (use svn to download the source code. instructions are detailed below). - A publish subscribe client: two options are available -> a Psi IM client (http://psi-im.org/). Download and install the latest version. -> or a trivial subscriber application included with PSM (included in the svn source code download) Preliminary $ export IMF_HOME=$HOME/IMF Install java 1.6 sdk, recent versions of Maven and Ant. Be sure java, mvn and ant executables are on your path. On geni-imf-dev host append the following to your .bashrc file (may vary on different platforms, here CentOS5.5 and default installations are assumed): export JAVA_HOME=/opt/java/jdk1.6.0_18 export ANT_HOME=/opt/java/apache-ant-1.8.0 export MAVEN_HOME=/opt/java/apache-maven-2.2.1 export PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$MAVEN_HOME/bin:$PATH Setting up Openfire Download and setup Openfire according to instructions. Notice, it is already running on geni-imf-dev.renci.org, so this step can be skipped. It is setup to use BEN LDAP credentials. Setting up PSM prototype Check out the code out of the repository : $ cd $HOME $ svn co https://geni-imf.renci.org/svn/PubSub_for_PerfSONAR/IMF $ cd $IMF_HOME/imf_pfsr/src/psm $ mvn install assembly:assembly The 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: $ mvn install:install-file -DgroupId=org.jivesoftware.smackx -DartifactId=smackx-pubsub -Dversion=3.1.0 -Dpackaging=jar -Dfile=lib/smackx.jar $ mvn install:install-file -DgroupId=org.jivesoftware.smack -DartifactId=smack-pubsub -Dversion=3.1.0 -Dpackaging=jar -Dfile=lib/smack.jar $ mvn install:install-file -DgroupId=javax.mail -DartifactId=mail -Dversion=1.4 -Dpackaging=jar -Dfile=lib/mail-1.4.jar $ mvn install:install-file -DgroupId=javax.jms -DartifactId=jms -Dversion=1.1 -Dpackaging=jar -Dfile=lib/jms.jar $ mvn install:install-file -DgroupId=com.sun.jdmk -DartifactId=jmxtools -Dversion=1.2.1 -Dpackaging=jar -Dfile=lib/jmxtools.jar $ mvn install:install-file -DgroupId=com.sun.jmx -DartifactId=jmxri -Dversion=1.2.1 -Dpackaging=jar -Dfile=lib/jmxri.jar Repeat the build attempt: $ mvn install assembly:assembly A jar including all the dependencies should be built in target/psm-0.1-jar-with-dependencies.jar Authorization PSM will require "can_pub" and "can_sub" credentials to the node namespace (for eg. Repository). Instructions on how to generate the .jks file are as follows: 1. Obtain cert-keypairs by emailing to Anirban Mandal ( anirban AT renci.org ) what is the node namespace for which you need pub/sub credentials. 2. Creating a pkcs12 file with your cert and key: Eg: openssl pkcs12 -export -in ashu-cert.pem -inkey ashu-key.pem -out ashu-gcf-encrypted.p12 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. 3. Importing cert-keypair to java keystore. Use Portecle: http://portecle.sourceforge.net/ Click Launch. * Create a new keystore of type JKS * Click on "Import Key Pair" * Locate the .p12 file (ashu-gcf-encrypted.p12 in the example) * Enter the password protecting the .p12 file * Import the key and certificate, but change the key alias to something simpler than a GUID * Enter and confirm a new key password (I usually give the same password as the one protecting .p12 file) * Click on "Save Keystore" * Enter and confirm the new keystore password (use same as the key password) This will result in the java keystore. PSM will need path to this keystore and the password above to log in through measurement/subscriber.properties. Running PSM Create a measurements.properties file. A sample file is located on the top directory ~IMF/ Save it in $IMF_HOME. Create a file called log4j.properties. A sample file is located on the top directory ~IMF/ Save it in $IMF_HOME. Start PSM by $ cd $IMF_HOME/imf_pfsr/src/psm $ java -cp $IMF_HOME:target/psm-0.1-jar-with-dependencies.jar org.renci.geni_imf.psm.Simple You 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. Viewing measurements You can observe the measurement nodes by downloading and installing the Psi IM client. Once you log in to the openfire server (geni-imf-dev.renci.org:5222 using your BEN credentials) you can do 'Service Discovery', open pubsub.geni-imf-dev.renci.org and see the available measurement nodes. You cannot see their values. Alternatively you can start up a simple subscribe client. First create a subscriber.properties file in $IMF_HOME: IMF.pubsub.server= IMF.pubsub.login= IMF.pubsub.password= Then start the client $ cd $IMF_HOME/imf_pfsr/src/psm $ java -cp $IMF_HOME:target/psm-0.1-jar-with-dependencies.jar org.renci.geni_imf.psm.SimpleSubscriber The 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. Clearing all measurement nodes $ 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 Troubleshooting If your PSM returns errors such as authentication problem, make sure you have the right username and password in measurement.properties. If there is any existing node that is not created by you, you will be forbidden to publish data to that node. You can either use a different root node in measurement.properties or ask the owner of that node to delete it. Note - for our implementation the modules need VPN access to each other's running machines