diff --git a/doc/source/installation.rst b/doc/source/installation.rst index 03d361fc..0a48e62f 100644 --- a/doc/source/installation.rst +++ b/doc/source/installation.rst @@ -1,22 +1,23 @@ ######################################### -CloudKitty installation and configuration +Cloudkitty installation and configuration ######################################### +Many method can be followed to install cloudkitty. Install from source =================== -There is no release of CloudKitty as of now, the installation can be done from -the git repository. +Install the services +-------------------- -Retrieve and install CloudKitty:: +Retrieve and install cloudkitty:: git clone https://git.openstack.org/openstack/cloudkitty.git cd cloudkitty python setup.py install -This procedure installs the ``cloudkitty`` python library and a few -executables: +This procedure installs the ``cloudkitty`` python library and the +following executables: * ``cloudkitty-api``: API service * ``cloudkitty-processor``: Processing service (collecting and rating) @@ -32,12 +33,46 @@ Install sample configuration files:: cp etc/cloudkitty/policy.json /etc/cloudkitty cp etc/cloudkitty/api_paste.ini /etc/cloudkitty +Create the log directory:: + + mkdir /var/log/cloudkitty/ + +Install the client +------------------ + Retrieve and install cloudkitty client:: git clone https://git.openstack.org/openstack/python-cloudkittyclient.git cd python-cloudkittyclient python setup.py install +Install the dashboard module +---------------------------- + +#. Retrieve and install cloudkitty's dashboard:: + + git clone https://git.openstack.org/openstack/cloudkitty-dashboard.git + cd cloudkitty-dashboard + python setup.py install + +#. Find where the python packages are installed:: + + PY_PACKAGES_PATH=`pip --version | cut -d' ' -f4` + +#. Add the enabled file to the horizon settings or installation. Depending on +your setup, you might need to add it to ``/usr/share`` or directly in the +horizon python package:: + + # If horizon is installed by packages: + ln -sf $PY_PACKAGES_PATH/cloudkittydashboard/enabled/_[0-9]*.py \ + /usr/share/openstack-dashboard/openstack_dashboard/enabled/ + + # Directly from sources: + ln -sf $PY_PACKAGES_PATH/cloudkittydashboard/enabled/_[0-9]*.py \ + $PY_PACKAGES_PATH/openstack_dashboard/enabled/ + +#. Restart the web server hosting Horizon. + Install from packages ===================== @@ -49,7 +84,7 @@ For RHEL/CentOS 7 #. Install the RDO repositories for Newton:: - yum install -y centos-release-openstack-newton + yum install centos-release-openstack-newton #. Install the packages:: @@ -73,12 +108,16 @@ For Ubuntu 16.04 apt-get install cloudkitty-api cloudkitty-processor cloudkitty-dashboard -Configure CloudKitty +Configure cloudkitty ==================== -Edit :file:`/etc/cloudkitty/cloudkitty.conf` to configure CloudKitty. +Edit :file:`/etc/cloudkitty/cloudkitty.conf` to configure cloudkitty. -The following shows the basic configuration items: +Then you need to know which keystone API version you use (which can be +determined using `openstack endpoint list`) + +For keystone (identity) API v2 (deprecated) +------------------------------------------- .. code-block:: ini @@ -89,7 +128,8 @@ The following shows the basic configuration items: [oslo_messaging_rabbit] rabbit_userid = openstack rabbit_password = RABBIT_PASSWORD - rabbit_hosts = RABBIT_HOST + rabbit_host = RABBIT_HOST + rabbit_port = 5672 [auth] username = cloudkitty @@ -107,21 +147,88 @@ The following shows the basic configuration items: auth_plugin = password [database] - connection = mysql://cloudkitty:CK_DBPASS@localhost/cloudkitty + connection = mysql://cloudkitty:CK_DBPASSWORD@localhost/cloudkitty [keystone_fetcher] - username = admin - password = ADMIN_PASSWORD - tenant = admin + username = cloudkitty + password = CK_PASSWORD + tenant = service region = RegionOne url = http://localhost:5000/v2.0 + [collect] + collector = ceilometer + period = 3600 + services = compute, volume, network.bw.in, network.bw.out, network.floating, image + [ceilometer_collector] username = cloudkitty password = CK_PASSWORD tenant = service region = RegionOne - url = http://localhost:5000 + url = http://localhost:5000/v2.0 + +Please note that: + +* `http://localhost:5000/v2.0`and `http://localhost:35357/v2.0` are your +identity endpoints. +* the tenant named `service` is also commonly called `services` + +For keystone (identity) API v3 +------------------------------ + +The following shows the basic configuration items: + +.. code-block:: ini + + [DEFAULT] + verbose = True + log_dir = /var/log/cloudkitty + + [oslo_messaging_rabbit] + rabbit_userid = openstack + rabbit_password = RABBIT_PASSWORD + rabbit_host = RABBIT_HOST + rabbit_port = 5672 + + [ks_auth] + auth_type = v3password + auth_protocol = http + auth_url = http://localhost:5000/v3 + identity_uri = http://localhost:35357/v3 + username = cloudkitty + password = CK_PASSWORD + project_name = service + user_domain_name = default + project_domain_name = default + debug = True + + [keystone_authtoken] + auth_section = ks_auth + + [database] + connection = mysql://cloudkitty:CK_DBPASSWORD@localhost/cloudkitty + + [keystone_fetcher] + auth_section = ks_auth + keystone_version = 3 + + [tenant_fetcher] + backend = keystone + + [collect] + collector = ceilometer + period = 3600 + services = compute, volume, network.bw.in, network.bw.out, network.floating, image + + [ceilometer_collector] + auth_section = ks_auth + +Please note that: + +* `http://localhost:5000/v3`and `http://localhost:35357/v3` are your identity +endpoints. +* the tenant named `service` is also commonly called `services` Setup the database and storage backend @@ -132,9 +239,11 @@ the ``mysql`` client:: mysql -uroot -p << EOF CREATE DATABASE cloudkitty; - GRANT ALL PRIVILEGES ON cloudkitty.* TO 'cloudkitty'@'localhost' IDENTIFIED BY 'CK_DBPASS'; + GRANT ALL PRIVILEGES ON cloudkitty.* TO 'cloudkitty'@'localhost' IDENTIFIED BY 'CK_DBPASSWORD'; EOF +If you need to authorize the cloudkitty mysql user from another host you have +to change the line accordingly. Run the database synchronisation scripts:: @@ -149,66 +258,50 @@ Init the storage backend:: Setup Keystone ============== -CloudKitty uses Keystone for authentication, and provides a ``rating`` service. +cloudkitty uses Keystone for authentication, and provides a ``rating`` service. -To integrate CloudKitty to Keystone, run the following commands (as OpenStack +To integrate cloudkitty to Keystone, run the following commands (as OpenStack administrator):: - openstack user create cloudkitty --password CK_PASS --email cloudkitty@localhost + openstack user create cloudkitty --password CK_PASSWORD --email cloudkitty@localhost openstack role add --project service --user cloudkitty admin Give the ``rating`` role to ``cloudkitty`` for each project that should be -handled by CloudKitty:: +handled by cloudkitty:: openstack role create rating openstack role add --project XXX --user cloudkitty rating Create the ``rating`` service and its endpoints:: - openstack service create rating --name CloudKitty \ + openstack service create rating --name cloudkitty \ --description "OpenStack Rating Service" openstack endpoint create rating --region RegionOne \ - --publicurl http://localhost:8889 \ - --adminurl http://localhost:8889 \ - --internalurl http://localhost:8889 + public http://localhost:8889 + openstack endpoint create rating --region RegionOne \ + admin http://localhost:8889 + openstack endpoint create rating --region RegionOne \ + internal http://localhost:8889 -Start CloudKitty +Start cloudkitty ================ +If you installed cloudkitty from packages +----------------------------------------- + +Start the API and processing services:: + + systemctl start cloudkitty-api.service + systemctl start cloudkitty-processor.service + +If you installed cloudkitty from sources +----------------------------------------- + Start the API and processing services:: cloudkitty-api --config-file /etc/cloudkitty/cloudkitty.conf cloudkitty-processor --config-file /etc/cloudkitty/cloudkitty.conf -Horizon integration from cloudkitty-dashboard source -==================================================== - -Retrieve and install CloudKitty's dashboard:: - - git clone https://git.openstack.org/openstack/cloudkitty-dashboard.git - cd cloudkitty-dashboard - python setup.py install - - -Find where the python packages are installed:: - - PY_PACKAGES_PATH=`pip --version | cut -d' ' -f4` - - -Then add the enabled file to the horizon settings or installation. Depending on -your setup, you might need to add it to ``/usr/share`` or directly in the -horizon python package:: - - # If horizon is installed by packages: - ln -sf $PY_PACKAGES_PATH/cloudkittydashboard/enabled/_[0-9]*.py \ - /usr/share/openstack-dashboard/openstack_dashboard/enabled/ - - # Directly from sources: - ln -sf $PY_PACKAGES_PATH/cloudkittydashboard/enabled/_[0-9]*.py \ - $PY_PACKAGES_PATH/openstack_dashboard/enabled/ - - -Restart the web server hosting Horizon.