Changes between Initial Version and Version 1 of OMF/OMF60/2Operator


Ignore:
Timestamp:
May 13, 2019, 7:13:34 PM (6 years ago)
Author:
seskar
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • OMF/OMF60/2Operator

    v1 v1  
     1== Installation Guide ==
     2
     3=== Introduction ===
     4
     5In an OMF testbed, everything is a resource. The entity that controls one or multiple resources is called Resource Controller (RC). The RC can run directly on the resource (e.g. a PC), or run on a separate computer that can control the resources (e.g. a bunch of sensor nodes or an OpenFlow switch). OMF is designed to support many different types of resources, and additional RCs for those resources can make use of our OMF APIs.
     6
     7All communication in OMF is done via !Publish/Subscribe (!PubSub). By default OMF uses AMQP for that, but other messaging layers such as XMPP are supported. Each OMF component must be able to talk to at least one !PubSub server, although there can be multiple PubSub servers used in an experiment. The examples in this guide are using XMPP.
     8
     9The experimenter uses the Experiment Controller (EC) to run the experiment script and steer the resources. The EC can be installed on a user-facing machine inside the testbed, or alternatively on the user's own computer.
     10
     11[[Image(), caption="OMF components"]]
     12
     13=== Prepare Your Environment ===
     14OMF could run under Ruby with versions not earlier than 1.9.3. Your operating system most likely have this version available by the time of writing this documentation. If you do require information regarding installing Ruby, please see official ruby site, or simply search for it.
     15
     16Some additional packages shall be installed in order to compile native extensions for certain dependent libraries, for example 'Eventmachine':
     17
     18==== !Ubuntu/Debian ====
     19{{{
     20sudo apt-get install ruby-dev build-essential libssl-dev
     21}}}
     22
     23If you decided, for some particular reasons, to choose XMPP over AMQP as your communication layer, you also need additional libraries which handle XML parsing.
     24{{{
     25sudo apt-get install libxml2-dev libxslt-dev
     26}}}
     27
     28==== Fedora ====
     29{{{
     30sudo yum update -y audit
     31sudo yum install -y ruby-devel make gcc gpp gcc-c++ openssl-devel
     32}}}
     33
     34Again, ONLY needed for XMPP and XML
     35{{{
     36sudo yum install -y libxml2 libxml2-devel libxslt libxslt-devel
     37}}}
     38
     39=== Install communication server ===
     40
     41OMF6 currently supports XMPP and AMQP for its message transport. Only one message transport is required.
     42
     43We RECOMMEND AMQP for its superior performance and pub-sub support
     44
     45TEST OPERATORS need to install a communication server in their testbed. It should be reachable from the outside Internet if any of the testbed users are on the outside of your organisation or if you want to federate your testbed with another organisation over the public Internet. DEVELOPERS might just run a server on their local machine for development.
     46
     47==== AMQP server (RabbitMQ) Installation ====
     48
     49For OMF, we RECOMMEND using RabbitMQ. Other AMQP servers may work as well, but have not been tested.
     50
     51* Uninstall any other AMQP servers first
     52* Make sure port TCP 5672 is open in your firewall
     53* Install RabbitMQ on Ubuntu / Debian:
     54{{{
     55sudo apt-get install rabbitmq-server
     56}}}
     57[http://www.rabbitmq.com/download.html Installation instructions for other operating systems]
     58
     59===== Common Issues When Installing RabbitMQ =====
     60* Allow the guest user to connect from a remote host
     61If you wish to allow the guest user to connect from a remote host, you should set the loopback_users configuration item to []. A complete rabbitmq.config which does this would look like:
     62{{{
     63[[{loopback_users, []]}].
     64}}}
     65[https://www.rabbitmq.com/access-control.html More details]
     66* Client (EC or RC) cannot connect to AMQP broker (aka rabbitmq-server)
     67[http://rubydoc.info/github/ruby-amqp/amqp/master/file/docs/Troubleshooting.textile#Inspecting_AMQP_broker_log_file Older installation issues]
     68When installing on old Ubuntu and some Debian distro, the default RabbitMQ version you get may be old. For example on Debian 6 you will get RabbitMQ version below 2. However, the AMQP library used by EC and RC expect a more recent version of RabbitMQ. [http://www.rabbitmq.com/install-debian.html Follow the instruction to upgrade your rabbitmq-server]
     69After upgrading rabbitmq-server as mentioned above, you should clean any existing queue data from the previous version by removing all files under /var/lib/rabbitmq/mnesia/
     70* What PORTS should I open when using clustering setup
     71[https://www.rabbitmq.com/clustering.html#firewall Firewall instructions]
     72In the most common configuration you will need to open ports 4369 and 25672 for clustering to work.
     73* Troubleshooting other RabbitMQ issues
     74[http://www.rabbitmq.com/troubleshooting.html Troubleshooting instructions]
     75
     76===== Verify AQMP Server Installation ======
     77If you want to verify that your RabbitMQ server is responding, you can follow this "Hello World" tutorial.
     78
     79==== XMPP Server (Openfire) Installation ====
     80For OMF, we recommend using Openfire. Other XMPP servers may work as well, but this has not been extensively tested. Ejabberd is known to have some issues regarding node permissions and database cleanup. If are upgrading from an older Openfire release and you have trouble running OMF, please wipe your Openfire database and recreate the pubsub nodes.
     81
     82* Uninstall any other XMPP servers first
     83* Make sure ports TCP 5222, 5269 and 9090 are open in your firewall
     84* Openfire 3.8.1 requires Java, but has some issues with OpenJDK. Instead we recommend to install Oracle Java 7. Ubuntu users can follow this guide.
     85* After installing Java, on Ubuntu 12.04 or higher, run the following commands as root:
     86{{{
     87wget http://www.igniterealtime.org/downloadServlet?filename=openfire/openfire_3.8.1_all.deb
     88dpkg -i downloadServlet\?filename\=openfire%2Fopenfire_3.8.1_all.deb
     89}}}
     90* On any other OS, download Openfire and install it alongside the Oracle Java JRE
     91* Check if openfire is running: {{{ ps aux | grep openfire . Startup can take a while, please be patient.
     92* If openfire failed to start, you may need to edit /etc/init.d/openfire and set the correct JAVA_HOME for your Java installation, e.g.:
     93{{{
     94JAVA_HOME=/usr/lib/jvm/java-7-oracle
     95}}}
     96* Direct your web browser to http://localhost:9090 and begin the setup wizard
     97* Choose your language and click continue
     98* Enter the XMPP server's hostname (e.g. xmpp.domain.com or localhost) in the Domain field and click continue
     99* Choose the embedded database. You can also use other database types, but you will need to install the database server first and manually create a user and a database for Openfire.
     100* If you are using mySQL, you need to change the length of the Pubsub node names in the mySQL database. Basically you need to run the commands:
     101{{{
     102mysql -u openfire -p
     103use openfire;
     104alter table ofPubsubNode modify name VARCHAR(100);
     105quit;
     106}}}
     107* Choose the default profile and click continue
     108* Enter an admin password and click continue, then wait until the installation is finished
     109* Log on to the web GUI at http://localhost:9090 with the user/password you chose in the wizard
     110* Click 'Server', 'Server Settings', 'Registration & Login', enable 'Inband Account Registration' and disable 'Anonymous Login'
     111* To avoid duplicate subscriptions to the same topic in order to reduce the volume of messages, we recommend turning the multiple subscriptions feature off. Inside the Openfire system properties panel, add Property Name: xmpp.pubsub.multiple-subscriptions Property Value: false
     112* OPTIONAL: for server2server connectivity (used for testbed federation), you need to set up a DNS name "pubsub.yourhost.name" which can be resolved by public DNS servers. It can be an A record pointing to the same IP address as your host, or a CNAME pointing to the hostname. There is no need for a DNS SRV record. Learn more about S2S here.
     113* OPTIONAL: if your testbed consists of several hundred nodes, you may consider increasing the maximum open file descriptor limit for the "openfire" user. This can be done by editing /etc/security/limits.conf and adding the lines root soft nofile 100000 and root hard nofile 100000, which allows a maximum of 100K open sockets/files per process. The default in Ubuntu is 1024. If this is not increased you may run into a problem where openfire does not accept any more incoming TCP connections.
     114* Restart Openfire to apply any changes made: /etc/init.d/openfire restart
     115
     116===== Verify XMPP Server Installation =====
     117To verify that Openfire has been set up correctly, we are providing a test script (also available here). Run:
     118{{{
     119curl -O https://raw.github.com/mytestbed/omf/master/doc/openfire_test.rb
     120ruby openfire_test.rb <xmpp_hostname>
     121}}}
     122Watch the output for any lines starting with ERROR. Double check your Openfire settings as described above and re-run the test until you receive no more ERRORs.
     123
     124=== Install Resource Controller (RC) ===
     125
     126On a typical node, you could install the RC as root:
     127{{{
     128gem install omf_rc --no-ri --no-rdoc
     129}}}
     130
     131If you'd like to start the Resource Controller upon booting your node, please run the following as root (THIS COMMAND WILL OVERWRITE /etc/omf_rc/config.yml if the file exists):
     132{{{
     133install_omf_rc -i -c
     134}}}
     135
     136This installs an init script for your distribution (currently supports Debian, Ubuntu and Fedora) and installs a default RC configuration file at /etc/omf_rc/config.yml.
     137
     138You should edit this file and set the correct values for your testbed before you can run the RC successfully. Here's an example configuration file:
     139{{{
     140environment: production
     141
     142communication:
     143  url: amqp://localhost
     144
     145resources:
     146- type: node
     147  uid: <%= Socket.gethostname %>
     148}}}
     149Ruby's ERB syntax is used here to set the UID (topic name) to the output of the Ruby command Socket.gethostname. We assume that the host name of each node is unique (e.g. assigned via DHCP), so we can use the same configuration file for all of them.
     150
     151==== Start RC ====
     152If you want to start the RC using an init script and you installed this script with the '-i' flag above, you can start the daemon like this:
     153
     154===== Ubuntu: =====
     155{{{
     156start omf_rc
     157}}}
     158===== Debian & Fedora: =====
     159{{{
     160/etc/init.d/omf_rc start
     161}}}
     162Check for the RC process by running:
     163{{{
     164ps aux | grep omf_rc
     165}}}
     166
     167If there is no "omf_rc" process, check the syslog for any errors that the startup script may have thrown. Also check /var/log/omf_rc.log for any errors.
     168
     169To verify that your RC is responding correctly, we are providing a test script (also available here). Open a new terminal and run:
     170{{{
     171curl -O https://raw.github.com/mytestbed/omf/master/doc/rc_alive_check.rb
     172ruby rc_alive_check.rb xmpp://<xmpp_hostname> <your hostname>
     173}}}
     174
     175Using the same XMPP URI as in the RC config file and your local machine's hostname (run hostname to find out), unless you changed the :uid: parameter in the RC config file to another name. Watch the output for any lines starting with ERROR. If the RC could be contacted successfully at the "test" topic, your resource is ready to run experiments.
     176
     177==== Configure RC ====
     178RC could be configured via changing the configuration files. Examples can be found under https://github.com/mytestbed/omf/tree/master/omf_rc/config/
     179
     180Only load certain resource proxies and set default property value
     181https://github.com/mytestbed/omf/blob/master/omf_rc/config/config_node_topo_check.yml.example
     182
     183Customise Logging
     184https://github.com/mytestbed/omf/blob/master/omf_rc/config/with_custom_logging.yml
     185
     186ALWAYS RESTART RC TO MAKE CHANGES EFFECTIVE
     187
     188==== Test RC ====
     189To check if a particular resource controller responds to FRCP messages properly, simply send a FRCP REQUEST message to the resource, and expect an answer from it. OMF provides a tiny utility to do exactly this:
     190{{{
     191omf_send_request -r amqp://localhost/interlagos uid
     192}}}
     193It basically asks a resource called 'interlagos' about its 'uid' property. If such RC runs properly, you would see:
     194{{{
     195interlagos
     196  uid: interlagos
     197-----------------
     198}}}
     199Otherwise you would see NOTHING.
     200
     201===  Experiment Controller (EC) ===
     202==== Install EC ====
     203{{{
     204gem install omf_ec --no-ri --no-rdoc
     205}}}
     206
     207=== Run EC ===
     208{{{
     209omf_ec <PATH_TO_YOUR_OEDL_FILE>
     210}}}
     211
     212This, without any parameters will use built in default values. It will:
     213
     214Connect to amqp server on localhost
     215Write info level log messages to STDOUT
     216Write all log messages to rolling log files in /var/tmp/ as omf_ec..log
     217Configuring EC
     218You could use command line options or configuration file to set up your experiment controller.
     219
     220It is always useful to run EC help page for available options
     221{{{
     222omf_ec -h
     223}}}
     224Some common command line options are:
     225* Use another AQMP server
     226{{{
     227omf_ec -u amqp://another_amqp_server <PATH_TO_YOUR_OEDL_FILE>
     228}}}
     229* Use OML server at localhost:3003
     230{{{
     231omf_ec -u amqp://another_amqp_server --oml-uri tcp:localhost:3003 <PATH_TO_YOUR_OEDL_FILE>
     232}}}
     233* Show :debug log message in STDOUT
     234{{{
     235omf_ec -u amqp://another_amqp_server --oml-uri tcp:localhost:3003 -d <PATH_TO_YOUR_OEDL_FILE>
     236}}}
     237
     238Options can also be set by using a configuration file, you can store options like the communication URI and the OML URI here to avoid entering them on every EC run, and provide the configure file using '-c' option. For example ([https://github.com/mytestbed/omf/tree/master/omf_ec/example/config/default.yml simple configuration file]):
     239{{{
     240communication:
     241  url: amqp://localhost
     242
     243oml_uri: tcp:localhost:3003
     244}}}
     245
     246Save the file as my_ec.yml for example and then start experiment controller by:
     247{{{
     248omf_ec -c my_ec.yml <PATH_TO_YOUR_OEDL_FILE>
     249}}}
     250
     251The other example config files can be found at [https://github.com/mytestbed/omf/tree/master/omf_ec/example/config OMF github]
     252
     253===== Customise Logging =====
     254You could [https://github.com/mytestbed/omf/tree/master/omf_ec/example/config/with_custom_logging.yml customise logging] by describing level, appenders, layout etc. in the logging configuration file.
     255
     256===== Does My EC Work? ======
     257To verify that you can run experiments on the testbed, we are providing an experiment script (also available here). Run:
     258{{{
     259curl -O https://raw.github.com/mytestbed/omf/master/doc/oedl_simple_test.rb
     260
     261omf_ec -u <xmpp|amqp>://<pubsub_hostname> exec oedl_simple_test.rb -- --res1 <hrn>
     262Replace <pubsub_hostname> with the hostname of the testbed's XMPP server or AMQP server. Replace <hrn> with the ID of a PC-style resource controller in the testbed (this is usually the testbed node's hostname).
     263
     26418:36:59 INFO  XMPP::Communicator: Connecting to '<xmpp_hostname>' ...
     26518:36:59 INFO  Object: Connected
     26618:36:59 INFO  Object: Start experiment: 2013-03-07T07:36:59Z
     26718:36:59 INFO  OmfEc: res1 = "test" (String)
     26818:36:59 INFO  OmfEc: Subscribed to 249bf4cd-f799-4fe3-aee6-72f92af002db
     26918:36:59 INFO  OmfEc: Subscribed to test
     27018:36:59 INFO  OmfEc: Config test to join Actor
     27118:37:00 INFO  OmfEc: Newly discovered resource >> test
     27218:37:00 INFO  OmfEc: Event triggered: 'ALL_UP'
     27318:37:03 INFO  Object: TEST - allGroups
     27418:37:03 INFO  OmfEc: Subscribed to 249bf4cd-f799-4fe3-aee6-72f92af002db_application
     27518:37:03 INFO  OmfEc: Resource xmpp://ccce4bf3-c8f7-4984-8e8e-1ade28d132a6@norbit.npc.nicta.com.au created
     27618:37:03 INFO  OmfEc: Newly discovered resource >> ccce4bf3-c8f7-4984-8e8e-1ade28d132a6
     27718:37:03 INFO  OmfEc: Event triggered: 'Actor_application_/bin/date_created_ba8b4fad-8d47-4782-b12b-9c93dd215bf2'
     27818:37:03 INFO  OmfEc: APP_EVENT STARTED from app /bin/date - msg: env -i /bin/date
     27918:37:03 INFO  OmfEc: APP_EVENT STDOUT from app /bin/date - msg: Thu Mar  7 18:37:03 EST 2013
     28018:37:03 INFO  OmfEc: APP_EVENT DONE.OK from app /bin/date - msg: status: pid 35135 exit 0
     28118:37:06 INFO  Object: TEST - group
     28218:37:06 INFO  OmfEc: Subscribed to 249bf4cd-f799-4fe3-aee6-72f92af002db_application
     28318:37:06 INFO  OmfEc: Newly discovered resource >> d3416b01-51d9-48d4-b6b5-442454e8e7fa
     28418:37:06 INFO  OmfEc: Resource xmpp://d3416b01-51d9-48d4-b6b5-442454e8e7fa@norbit.npc.nicta.com.au created
     28518:37:06 INFO  OmfEc: Event triggered: 'Actor_application_/bin/hostname -f_created_50da62ba-c8b5-49b1-8182-7632d68f312a'
     28618:37:06 INFO  OmfEc: APP_EVENT STARTED from app /bin/hostname -f - msg: env -i /bin/hostname -f
     28718:37:06 INFO  OmfEc: APP_EVENT STDOUT from app /bin/hostname -f - msg: y68.dynhost.nicta.com.au
     28818:37:06 INFO  OmfEc: APP_EVENT DONE.OK from app /bin/hostname -f - msg: status: pid 35136 exit 0
     28918:37:09 INFO  OmfEc: Exit in up to 15 seconds...
     29018:37:19 INFO  OmfEc: Release applications and network interfaces
     29118:37:19 INFO  OmfEc: Subscribed to ccce4bf3-c8f7-4984-8e8e-1ade28d132a6
     29218:37:19 INFO  OmfEc: Subscribed to 249bf4cd-f799-4fe3-aee6-72f92af002db
     29318:37:19 INFO  OmfEc: Subscribed to d3416b01-51d9-48d4-b6b5-442454e8e7fa
     29418:37:19 INFO  OmfEc: Subscribed to 249bf4cd-f799-4fe3-aee6-72f92af002db
     29518:37:24 INFO  XMPP::Communicator: Disconnecting ...
     296}}}
     297
     298==== Gaining access to an OMF testbed ====
     299
     300Contact an OMF testbed operator for an account. Make a resource reservation if required and gather the HRNs of the resources you'd like to use. Also find out what the testbed's PubSub server hostname is.
     301
     302