User Tools

Site Tools


copper:academy:joid:congress

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
copper:academy:joid:congress [2015/12/08 06:48]
Bryan Sullivan created
copper:academy:joid:congress [2016/02/25 01:22] (current)
Bryan Sullivan
Line 1: Line 1:
-This is a temporary location for a Congress install guide that will be included in the Copper git repo. +Following are instructions for installing Congress on an Ubuntu 14.04 LXC container in the OPNFV Controller node, as installed by the JOID installer. This guide uses instructions from the [[http://​congress.readthedocs.org/​en/​latest/​readme.html#​installing-congress|Congress guide on readthedocs]]. Specific values below will need to be modified if you intend to repeat this procedure in your install environment.
- +
-Following are instructions for installing Congress on an Ubuntu 14.04 LXC container in the OPNFV Controller node, as installed by the JOID installer. This guide uses instructions from the [[http://​congress.readthedocs.org/​en/​latest/​readme.html#​installing-congress|Congress guide on readthedocs]].+
  
 == Prequisite == == Prequisite ==
 OPFNV install per [[https://​wiki.opnfv.org/​copper/​academy/​joid|JOID]] OPFNV install per [[https://​wiki.opnfv.org/​copper/​academy/​joid|JOID]]
  
-== Install ​base VM for congress on controller node == +== Install ​Procedure ​==
-<​code>​ +
-sudo juju ssh ubuntu@192.168.10.21 +
-</​code>​+
  
-== Clone the container == +The install currently occurs via four bash scripts provided in the copper repo. See these files for the detailed steps: 
-<​code>​ +  * [[https://​git.opnfv.org/​cgit/​copper/​tree/​components/​congress/joid/​install_congress_1.sh|install_congress_1.sh]]:​ creates ​the linux container ​for the congress ​server on the controller node, starts ​the congress ​server, copies install_congress_2.sh to the congress server and invokes it via ssh. 
-sudo lxc-clone -o juju-trusty-lxc-template -n juju-trusty-congress +  * [[https://​git.opnfv.org/​cgit/​copper/​tree/​components/​congress/​joid/​install_congress_2.sh|install_congress_2.sh]]:​ installs congress in the congress server.
-</code> +
- +
-== Start the container ​== +
-<​code>​ +
-sudo lxc-start -n juju-trusty-congress ​-d +
-</​code>​ +
- +
-== Get the container IP address == +
-<​code>​ +
-sudo lxc-info -n juju-trusty-congress +
-</code>+
  
 == If you need to start over == == If you need to start over ==
-<​code>​ 
-sudo lxc-destroy --name juju-trusty-congress 
-</​code>​ 
  
-== login to congress container ​==+Shutdown the congress ​server, and on the node1-control machine, delete the container.
 <​code>​ <​code>​
-sudo juju ssh ubuntu@192.168.10.117 +# get the congress server address 
-</​code>​ +juju ssh ubuntu@node1-control 
- +sudo lxc-info --name juju-trusty-congress ​| grep IP | awk "/ / { print \$2 }"
-== Setup environment variables == +
-<​code>​ +
-export CONGRESS_HOST=192.168.10.117 +
-export KEYSTONE_HOST=192.168.10.108 +
-export CEILOMETER_HOST=192.168.10.105 +
-export CINDER_HOST=192.168.10.101 +
-export GLANCE_HOST=192.168.10.106 +
-export NEUTRON_HOST=192.168.10.111 +
-export NOVA_HOST=192.168.10.112 +
-</​code>​ +
- +
-== install pip == +
-<​code>​ +
-sudo apt-get install python-pip -y +
-</​code>​ +
- +
-== install java == +
-<​code>​ +
-sudo apt-get install default-jre -+
-</​code>​ +
- +
-== install other dependencies;​ set mysql root user password = ubuntu == +
-<​code>​ +
-sudo apt-get install git gcc python-dev libxml2 libxslt1-dev libzip-dev mysql-server python-mysqldb -y +
-sudo pip install virtualenv +
-</​code>​ +
- +
-== clone congress ​== +
-<​code>​ +
-git clone https://​github.com/​openstack/​congress.git +
-</​code>​ +
- +
-== Create virtualenv == +
-<​code>​ +
-virtualenv ~/​congress +
-cd congress +
-source bin/​activate +
-</​code>​ +
- +
-== Setup Congress == +
-<​code>​ +
-sudo mkdir -p /​etc/​congress +
-sudo mkdir -p /​etc/​congress/​snapshot +
-sudo mkdir /​var/​log/​congress +
-sudo chown ubuntu /​var/​log/​congress +
-sudo cp etc/​api-paste.ini /​etc/​congress +
-sudo cp etc/​policy.json /​etc/​congress +
-</​code>​ +
- +
-== install requirements.txt and tox dependencies (detected by errors during ​"tox -egenconfig"​) == +
-<​code>​ +
-sudo apt-get install libffi-dev -y +
-sudo apt-get install openssl -y +
-sudo apt-get install libssl-dev -y +
-</code> +
- +
-== install dependencies in virtualenv == +
-<​code>​ +
-pip install -r requirements.txt +
-python setup.py install +
-</code> +
- +
-== install tox == +
-<​code>​ +
-pip install tox +
-</​code>​ +
- +
-== generate congress.conf.sample == +
-<​code>​ +
-tox -egenconfig +
-</​code>​ +
- +
-== edit congress.conf.sample as needed == +
-<​code>​ +
-sed -i -- '​s/#​verbose = true/​verbose = true/​g'​ etc/​congress.conf.sample +
-sed -i -- '​s/#​log_file = <​None>/​log_file = congress.log/​g'​ etc/​congress.conf.sample +
-sed -i -- '​s/#​log_dir = <​None>/​log_dir = \/​var\/​log\/​congress/​g'​ etc/​congress.conf.sample +
-sed -i -- '​s/#​bind_host = 0.0.0.0/​bind_host = 192.168.10.117/​g'​ etc/​congress.conf.sample +
-sed -i -- '​s/#​policy_path = <​None>/​policy_path = \/​etc\/​congress\/​snapshot/​g'​ etc/​congress.conf.sample +
-sed -i -- '​s/#​auth_strategy = keystone/​auth_strategy = noauth/​g'​ etc/​congress.conf.sample +
-sed -i -- '​s/#​drivers =/drivers = congress.datasources.neutronv2_driver.NeutronV2Driver,​congress.datasources.glancev2_driver.GlanceV2Driver,​congress.datasources.nova_driver.NovaDriver,​congress.datasources.keystone_driver.KeystoneDriver,​congress.datasources.ceilometer_driver.CeilometerDriver,​congress.datasources.cinder_driver.CinderDriver/​g'​ etc/​congress.conf.sample +
-sed -i -- '​s/#​auth_host = 127.0.0.1/​auth_host = 192.168.10.108/​g'​ etc/​congress.conf.sample +
-sed -i -- '​s/#​auth_port = 35357/​auth_port = 35357/​g'​ etc/​congress.conf.sample +
-sed -i -- '​s/#​auth_protocol = https/​auth_protocol = http/​g'​ etc/​congress.conf.sample +
-sed -i -- '​s/#​admin_tenant_name = admin/​admin_tenant_name = admin/​g'​ etc/​congress.conf.sample +
-sed -i -- '​s/#​admin_user = <​None>/​admin_user = congress/​g'​ etc/​congress.conf.sample +
-sed -i -- '​s/#​admin_password = <​None>/​admin_password = congress/​g'​ etc/​congress.conf.sample +
-sed -i -- '​s/#​connection = <​None>/​connection = mysql:​\/​\/​ubuntu:​ubuntu@localhost:​3306\/​congress/​g'​ etc/​congress.conf.sample +
-</​code>​ +
- +
-== copy congress.conf.sample to /​etc/​congress == +
-<​code>​ +
-sudo cp etc/​congress.conf.sample /​etc/​congress/​congress.conf +
-</​code>​ +
- +
-== create congress database == +
-<​code>​ +
-sudo mysql -u root -p +
-CREATE DATABASE congress; +
-GRANT ALL PRIVILEGES ON congress.* TO '​ubuntu'​@'​localhost'​ IDENTIFIED BY '​ubuntu';​ +
-GRANT ALL PRIVILEGES ON congress.* TO '​ubuntu'​@'​%'​ IDENTIFIED BY '​ubuntu';​+
 exit exit
 +juju ssh ubuntu@<​congress server address>
 +sudo shutdown -P 0;  exit
 +juju ssh ubuntu@node1-control
 +sudo lxc-destroy --name juju-trusty-congress
 </​code>​ </​code>​
  
-== install congress-db-manage dependencies ​ (detected by errors) ​== +== Restarting after server power loss etc == 
-<​code>​ +Currently this install ​procedure is manualAutomated install and restoral after host recovery is TBD. For nowthis procedure will get the Congress ​service running again.
-sudo apt-get build-dep python-mysqldb +
-pip install ​MySQL-python +
-</​code>​ +
- +
-== create database schema == +
-<​code>​ +
-congress-db-manage --config-file /​etc/​congress/​congress.conf upgrade head +
-</​code>​ +
- +
-== Dependencies of OpenStack, Congress, Keystone related client operations == +
-<​code>​ +
-pip install python-openstackclient +
-pip install python-congressclient +
-pip install python-keystoneclient +
-</​code>​ +
- +
-== download admin-openrc.sh from Horizon and save in ~ ==+
 <​code>​ <​code>​
 +# On jumphost, SSH to Congress server
 +juju ssh ubuntu@<​congress server address>
 +# If that fails
 +  # On jumphost, SSH to controller node
 +  juju ssh ubuntu@node1-control
 +  # Start the Congress container
 +  sudo lxc-start -n juju-trusty-congress -d
 +  # Verify the Congress container status
 +  sudo lxc-ls -f juju-trusty-congress
 +  NAME                  STATE    IPV4            IPV6  GROUPS ​ AUTOSTART  ​
 +  ----------------------------------------------------------------------
 +  juju-trusty-congress ​ RUNNING ​ 192.168.10.117 ​ -     ​- ​      ​NO ​      
 +  # exit back to the Jumphost, wait a minute, and go back to the "SSH to Congress server"​ step above
 +# On the Congress server that you have logged into
 source ~/​admin-openrc.sh source ~/​admin-openrc.sh
 +cd ~/​git/​congress
 +source bin/​activate
 +bin/​congress-server &
 +disown -h  %1
 </​code>​ </​code>​
- 
-== setup Congress user. TODO: needs update in http://​congress.readthedocs.org/​en/​latest/​readme.html#​installing-congress == 
-<​code>​ 
-pip install cliff --upgrade 
-export ADMIN_ROLE=$(openstack role list | awk "/ Admin / { print \$2 }") 
-export SERVICE_TENANT=$(openstack project list | awk "/ admin / { print \$2 }") 
-openstack user create --password congress --project admin --email "​congress@example.com"​ congress 
-export CONGRESS_USER=$(openstack user list | awk "/ congress / { print \$2 }") 
-openstack role add $ADMIN_ROLE --user $CONGRESS_USER --project $SERVICE_TENANT 
-</​code>​ 
- 
-== Create Congress service == 
-<​code>​ 
-openstack service create congress --type "​policy"​ --description "​Congress Service"​ 
-export CONGRESS_SERVICE=$(openstack service list | awk "/ congress / { print \$2 }") 
-</​code>​ 
- 
-== Create Congress endpoint == 
-<​code>​ 
-openstack endpoint create $CONGRESS_SERVICE \ 
-  --region $OS_REGION_NAME \ 
-  --publicurl http://​$CONGRESS_HOST:​1789/​ \ 
-  --adminurl http://​$CONGRESS_HOST:​1789/​ \ 
-  --internalurl http://​$CONGRESS_HOST:​1789/​ 
-</​code>​ 
- 
-== Start the Congress service == 
-<​code>​ 
-bin/​congress-server 
-</​code>​ 
- 
-== Create data sources == 
-To remove: openstack congress datasource delete nova == 
-<​code>​ 
-openstack congress datasource create nova "​nova"​ \ 
-  --config username=$OS_USERNAME \ 
-  --config tenant_name=$OS_TENANT_NAME \ 
-  --config password=$OS_PASSWORD \ 
-  --config auth_url=http://​$KEYSTONE_HOST:​5000/​v2.0 
-openstack congress datasource create neutronv2 "​neutronv2"​ \ 
-  --config username=$OS_USERNAME \ 
-  --config tenant_name=$OS_TENANT_NAME \ 
-  --config password=$OS_PASSWORD \ 
-  --config auth_url=http://​$KEYSTONE_HOST:​5000/​v2.0 
-openstack congress datasource create ceilometer "​ceilometer"​ \ 
-  --config username=$OS_USERNAME \ 
-  --config tenant_name=$OS_TENANT_NAME \ 
-  --config password=$OS_PASSWORD \ 
-  --config auth_url=http://​$KEYSTONE_HOST:​5000/​v2.0 
-openstack congress datasource create cinder "​cinder"​ \ 
-  --config username=$OS_USERNAME \ 
-  --config tenant_name=$OS_TENANT_NAME \ 
-  --config password=$OS_PASSWORD \ 
-  --config auth_url=http://​$KEYSTONE_HOST:​5000/​v2.0 
-openstack congress datasource create glancev2 "​glancev2"​ \ 
-  --config username=$OS_USERNAME \ 
-  --config tenant_name=$OS_TENANT_NAME \ 
-  --config password=$OS_PASSWORD \ 
-  --config auth_url=http://​$KEYSTONE_HOST:​5000/​v2.0 
-openstack congress datasource create keystone "​keystone"​ \ 
-  --config username=$OS_USERNAME \ 
-  --config tenant_name=$OS_TENANT_NAME \ 
-  --config password=$OS_PASSWORD \ 
-  --config auth_url=http://​$KEYSTONE_HOST:​5000/​v2.0 ​ 
-</​code>​ 
- 
copper/academy/joid/congress.1449557283.txt.gz · Last modified: 2015/12/08 06:48 by Bryan Sullivan