From 95c6b9fa252d104097d540cc9d33b9b391888cd0 Mon Sep 17 00:00:00 2001 From: Bryan Sullivan Date: Fri, 19 Feb 2016 07:45:13 -0800 Subject: Align install guide with latest developments in bash scripts. JIRA: COPPER-7 Change-Id: I68fa9bdb789cb83073560e3352709a6b7fc02a6c Signed-off-by: Bryan Sullivan --- docs/configguide/featureconfig.rst | 359 ++----------------------------------- 1 file changed, 19 insertions(+), 340 deletions(-) (limited to 'docs') diff --git a/docs/configguide/featureconfig.rst b/docs/configguide/featureconfig.rst index 1b3dd5a..d972999 100644 --- a/docs/configguide/featureconfig.rst +++ b/docs/configguide/featureconfig.rst @@ -23,356 +23,35 @@ This guide uses instructions from the `Congress intro guide on readthedocs `_: copies install_congress_2.sh to the controller node and invokes it via ssh. + * `install_congress_2.sh `_: creates the linux container for congress on the controller node. + * `install_congress_3.sh `_: copies install_congress_4.sh to the congress container and invokes it via ssh. Currently requires one parameter which is the congress container IP address (to be scripted when a way to do this is figured out). + * `install_congress_4.sh `_: installs congress in the congress container. -.. code:: - virtualenv ~/congress - source bin/activate - -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 - -Install requirements.txt and tox dependencies -............................................. - -The need for this stepo was 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 - -Install dependencies in virtualenv -.................................. - -.. code:: - - pip install -r requirements.txt - python setup.py install - -Install tox -........... - -.. code:: - - pip install tox - -Generate congress.conf.sample -............................. - -.. code:: - - tox -egenconfig - -Edit congress.conf.sample as needed -................................... - -.. code:: - - sed -i -- 's/#verbose = true/verbose = true/g' etc/congress.conf.sample - sed -i -- 's/#log_file = /log_file = congress.log/g' \ - etc/congress.conf.sample - sed -i -- 's/#log_dir = /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 = /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 = /admin_user = congress/g' \ - etc/congress.conf.sample - sed -i -- 's/#admin_password = /admin_password = congress/g' \ - etc/congress.conf.sample - sed -i -- 's/#connection = /connection = mysql:\/\/ubuntu:\ - @localhost:3306\/congress/g' etc/congress.conf.sample - -Copy congress.conf.sample to /etc/congress -.......................................... - -.. code:: - - sudo cp etc/congress.conf.sample /etc/congress/congress.conf - -Create congress database -........................ - -.. code:: - - sudo mysql -u root -p - CREATE DATABASE congress; - GRANT ALL PRIVILEGES ON congress.* TO 'ubuntu'@'localhost' \ - IDENTIFIED BY ''; - GRANT ALL PRIVILEGES ON congress.* TO 'ubuntu'@'%' IDENTIFIED \ - BY ''; - exit - -Install congress-db-manage dependencies -....................................... - -The need for this step was detected by errors in subsequent steps. - -.. code:: - - sudo apt-get build-dep python-mysqldb -y - pip install MySQL-python - -Create database schema -...................... - -.. code:: - - congress-db-manage --config-file /etc/congress/congress.conf upgrade head - -Install dependencies of OpenStack, Congress, Keystone client operations -....................................................................... - -.. code:: - - pip install python-openstackclient - pip install python-congressclient - pip install python-keystoneclient - -Execute admin-openrc.sh as downloaded from Horizon -.................................................. - -.. code:: - - source ~/admin-openrc.sh - -Setup Congress user -................... - -TODO: needs update in `Congress intro in readthedocs < 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 - -Create Congress service -....................... - -.. code:: - - openstack service create congress --type "policy" \ - --description "Congress Service" - export CONGRESS_SERVICE=$(openstack service list | \ - awk "/ congress / { print \$2 }") - -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/ - -Start the Congress service in the background -............................................ - -.. code:: - - bin/congress-server & - # disown the process (so it keeps running if you get disconnected) - disown -h %1 - -Create data sources -................... - -To remove datasources: openstack congress datasource delete - -It's probably good to do these commands in a new terminal tab, as the -congress server log from the last command will be flooding your original -terminal screen. - -.. 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 - -Run Congress Tempest Tests -.......................... - -.. code:: - - tox -epy27 +Cleanup Procedure +................. +If there is an error during installation, use the bash script +`clean_congress.sh `_ +which stops the congress server if running, and removes the congress user and +service from the controller database. Restarting after server power loss etc ...................................... -Currently this install procedure is manual. Automated install and restoral -after host recovery is TBD. For now, this procedure will get the Congress -service running again. +Currently this install procedure is manual. Automated install and restoral after host recovery is TBD. For now, this procedure will get the Congress service running again. .. code:: # On jumphost, SSH to Congress server - sudo juju ssh ubuntu@192.168.10.117 + source ~/env.sh + juju ssh ubuntu@$CONGRESS_HOST # If that fails # On jumphost, SSH to controller node - sudo juju ssh ubuntu@192.168.10.119 + juju ssh ubuntu@node1-control # Start the Congress container sudo lxc-start -n juju-trusty-congress -d # Verify the Congress container status @@ -380,11 +59,11 @@ service running again. 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 + # 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 - cd congress + cd ~/git/congress source bin/activate bin/congress-server & disown -h %1 + -- cgit 1.2.3-korg