【openstack】cloudkitty组件,入门级安装(快速)

2023-05-16

文章目录

    • 前言
    • 架构
      • 安装
      • 配置
      • 启动
      • 检索并安装 CloudKitty 的仪表板

前言

什么是CloudKitty?
CloudKitty是OpenStack等的评级即服务项目。该项目旨在成为云的退款和评级的通用解决方案。从历史上看,它只能在OpenStack上下文中运行它,但现在可以在独立模式下运行CloudKitty。

CloudKitty允许进行基于指标的评级:它轮询终端节点以检索有关特定指标的度量值和元数据,将评级规则应用于收集的数据,并将评级数据推送到其存储后端。

CloudKitty是高度模块化的,这使得添加新功能变得容易。

架构

CloudKitty可以分为四大部分:

  • Data retrieval (API) 数据检索
  • Data collection (cloudkitty-processor) 数据收集
  • Data rating 数据评级
  • Data storage 数据存储

这些部分由两个进程处理:和 。数据检索部分由进程处理,其他部分由 处理。cloudkitty-apicloudkitty-processorcloudkitty-apicloudkitty-processor

以下是 CloudKitty 架构的概述:
在这里插入图片描述

安装

yum install openstack-cloudkitty-api openstack-cloudkitty-processor openstack-cloudkitty-ui

配置

编辑/etc/cloudkitty/cloudkitty.conf以配置 CloudKitty

[DEFAULT]
verbose = True
log_dir = /var/log/cloudkitty

[oslo_messaging_rabbit]
rabbit_userid = openstack
rabbit_password = RABBIT_PASSWORD
rabbit_hosts = RABBIT_HOST

[auth]
username = cloudkitty
password = CK_PASSWORD
tenant = service
region = RegionOne
url = http://localhost:5000/v2.0

[keystone_authtoken]
username = cloudkitty
password = CK_PASSWORD
project_name = service
region = RegionOne
auth_url = http://localhost:5000/v2.0
auth_plugin = password

[database]
connection = mysql://cloudkitty:CK_DBPASS@localhost/cloudkitty

[keystone_fetcher]
username = admin
password = ADMIN_PASSWORD
tenant = admin
region = RegionOne
url = http://localhost:5000/v2.0

[ceilometer_collector]
username = cloudkitty
password = CK_PASSWORD
tenant = service
region = RegionOne
url = http://localhost:5000

设置数据库和存储后端

[root@controller ~]# mysql -uroot -p000000
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 374
Server version: 10.1.20-MariaDB MariaDB Server
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> CREATE DATABASE cloudkitty;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON cloudkitty.* TO 'cloudkitty'@'localhost' IDENTIFIED BY '000000';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON cloudkitty.* TO 'cloudkitty'@'%' IDENTIFIED BY '000000';
Query OK, 0 rows affected (0.00 sec)

运行数据库同步脚本

[root@controller ~]# cloudkitty-dbsync upgrade
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade  -> 464e951dc3b8, Initial migration
INFO  [alembic.runtime.migration] Running upgrade 464e951dc3b8 -> 2ac2217dcbd9, Added support for meta collector
INFO  [alembic.runtime.migration] Running upgrade 2ac2217dcbd9 -> 385e33fef139, Added priority to modules_state.
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade  -> 3dd7e13527f3, Initial migration
INFO  [alembic.runtime.migration] Running upgrade 3dd7e13527f3 -> 4fa888fd7eda, Added threshold support.
INFO  [alembic.runtime.migration] Running upgrade 4fa888fd7eda -> 54cc17accf2c, Fixed constraint name.
INFO  [alembic.runtime.migration] Running upgrade 54cc17accf2c -> 10d2738b67df, Rename mapping table to hashmap_mappings.
INFO  [alembic.runtime.migration] Running upgrade 10d2738b67df -> f8c799db4aa0, Fix unnamed constraints.
INFO  [alembic.runtime.migration] Running upgrade f8c799db4aa0 -> c88a06b1cfce, Clean hashmap fields constraints.
/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py:507: Warning: Duplicate index `uniq_field_per_service`. This is deprecated and will be disallowed in a future release.
  cursor.execute(statement, parameters)
INFO  [alembic.runtime.migration] Running upgrade c88a06b1cfce -> 4da82e1c11c8, Add per tenant hashmap support
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade  -> 4f9efa4601c0, Initial migration.

初始化存储后端

[root@controller ~]# cloudkitty-storage-init
No handlers could be found for logger "cloudkitty.utils"
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade  -> 17fd1b237aa3, Initial migration
INFO  [alembic.runtime.migration] Running upgrade 17fd1b237aa3 -> 792b438b663, added tenant informations
INFO  [alembic.runtime.migration] Running upgrade 792b438b663 -> 307430ab38bc, improve qty precision
INFO  [alembic.runtime.migration] Running upgrade 307430ab38bc -> c703a1bad612, improve_qty_digit

CloudKitty 使用 Keystone 进行身份验证,并提供rating服务。

[root@controller ~]# openstack user create --domain demo --password 000000 cloudkitty
+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| domain_id           | d5db5c4ee4a14492b69408f63107d11f |
| enabled             | True                             |
| id                  | f1dea9309b834edba3aa4c1b8607dc16 |
| name                | cloudkitty                       |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+
[root@controller ~]# openstack role add --project service --user cloudkitty admin

对于应由 CloudKitty处理的每个租户,将rating角色赋予 cloudkitty :

[root@controller ~]# openstack role create rating
+-----------+----------------------------------+
| Field     | Value                            |
+-----------+----------------------------------+
| domain_id | None                             |
| id        | ee01d36a397b4b0ebcb579044c32a73c |
| name      | rating                           |
+-----------+----------------------------------+

创建rating服务及其端点:

[root@controller ~]# openstack service create --name cloudkitty --description "OpenStack rating" rating
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack rating                 |
| enabled     | True                             |
| id          | 78f3d51cf74843cd8d325b790e0c2b1c |
| name        | cloudkitty                       |
| type        | rating                           |
+-------------+----------------------------------+
openstack endpoint create --region RegionOne rating public http://controller:9292
openstack endpoint create --region RegionOne rating internal http://controller:9292
openstack endpoint create --region RegionOne rating admin http://controller:9292
[root@controller ~]# openstack endpoint create --region RegionOne rating public http://controller:9292
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 48b75b9d2d764b56a5bee00ff75b03b1 |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 78f3d51cf74843cd8d325b790e0c2b1c |
| service_name | cloudkitty                       |
| service_type | rating                           |
| url          | http://controller:9292           |
+--------------+----------------------------------+
[root@controller ~]# openstack endpoint create --region RegionOne rating internal http://controller:9292
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | b4f7fffa539441a68506db90b3ae89ce |
| interface    | internal                         |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 78f3d51cf74843cd8d325b790e0c2b1c |
| service_name | cloudkitty                       |
| service_type | rating                           |
| url          | http://controller:9292           |
+--------------+----------------------------------+
[root@controller ~]# openstack endpoint create --region RegionOne rating admin http://controller:9292
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | a607a077f119417d9e650c16dcd61f10 |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 78f3d51cf74843cd8d325b790e0c2b1c |
| service_name | cloudkitty                       |
| service_type | rating                           |
| url          | http://controller:9292           |
+--------------+----------------------------------+

启动

[root@controller ~]# systemctl start cloudkitty-processor.service
[root@controller ~]# cloudkitty-api -p 8889  #临时启动API
No handlers could be found for logger "cloudkitty.utils"
/usr/lib/python2.7/site-packages/pecan/__init__.py:122: RuntimeWarning: `static_root` is only used when `debug` is True, ignoring
  RuntimeWarning
********************************************************************************
STARTING test server cloudkitty.api.app.build_wsgi_app
Available at http://controller:8889/
DANGER! For testing only, do not use in production
********************************************************************************
192.168.200.1 - - [29/Apr/2022 15:06:41] "GET / HTTP/1.1" 200 209

检索并安装 CloudKitty 的仪表板

git clone https://opendev.org/openstack/cloudkitty-dashboard.git

python setup.py install
yum install -y wget
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum -y install python-pip
PY_PACKAGES_PATH=`pip --version | cut -d' ' -f4`
ln -s $PY_PACKAGES_PATH/cloudkittydashboard/enabled/_[0-9]*.py /usr/share/openstack-dashboard/openstack_dashboard/enabled/
[root@controller bin]# systemctl restart httpd.service memcached.service
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

【openstack】cloudkitty组件,入门级安装(快速) 的相关文章

随机推荐

  • centos7.6输入正确密码总是提示“Sorry, that didn‘t work. Please try again.”

    跟着老韩的视频顺利安装好了VM16和CentOs7 6 但最后卡在登录上了 xff0c 输入正确的用户名和密码后一直提示 Sorry that didn 39 t work Please try again 网上找了很多方法都没有解决 最后
  • Python 循环语句

    循环语句允许我们执行一个语句或语句组多次 xff0c 下面是在大多数编程语言中的循环语句的一般形式 xff1a While 循环语句 Python 编程中 while 语句用于循环执行程序 xff0c 即在某条件下 xff0c 循环执行某段
  • 关于Maven项目junit依赖出现版本号标红的解决方案

    关于Maven项目junit依赖出现版本号标红的解决方案 使用IDEA创建Maven项目时 xff0c pom里面的junit依赖的版本号出现标红 即版本号错误 xff09 xff0c 之前版本为4 10 解决方案 xff1a 找到本地仓库
  • 【C语言】单链表及插入(头插法、尾插法)

    目录 一 什么是单链表 二 单链表的插入 1 头插法 xff08 1 xff09 空链表情况 xff08 2 xff09 非空链表情况 2 尾插法 一 什么是单链表 链表是一种数据存储结构 xff0c 其存储地址并不连续 xff0c 数据元
  • Debian基础配置

    Debian的安装及基础配置 正文 debian基本介绍debian基本安装debian基本配置 结尾 本文介绍Debian的安装与基础配置 debian基本介绍 debian是一款稳定的基于Linux的操作系统 xff0c 它是由自由和开
  • OpenGL:配置glad

    GLAD库的作用 GLAD是一个开源的库 xff0c 它能解决我们上面提到的那个繁琐的问题 GLAD的配置与大多数的开源库有些许的不同 xff0c GLAD使用了一个在线服务 在这里我们能够告诉GLAD需要定义的OpenGL版本 xff0c
  • MySQL中ENGINE = InnoDB AUTO_INCREMENT = 200 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci的作用

    span class token keyword CREATE span span class token keyword TABLE span span class token punctuation 96 span permission
  • Docker数据管理,镜像创建与分层结构

    Docker数据管理 xff0c 镜像创建与分层结构 一 Docker的数据管理1 数据卷2 数据卷容器 二 容器互联 使用centos镜像 三 Docker 镜像的创建1 基于现有镜像创建2 基于本地模板创建3 基于Dockerfile
  • R语言——数据分析

    R语言 什么是数据分析 数据 数据 xff1a 是指对客观事件进行记录并可以鉴别的符号 xff0c 是对客观事物的性质 状态以及相互关系等进行记载的物理符号或这些物理符合的组合 为什么要做数据分析 我们可以通过数据分析的结果来指导决策 数据
  • CentOS 7 云服务器安装mysql5.7

    将mysql5 7的安装包上传到主机上 解压安装到 opt app 中 tar zxvf mysql 5 7 34 linux glibc2 12 x86 64 tar gz C opt app 修改目录名 mv opt app mysql
  • java求1000以内的完数及分析

    需求 一个数如果恰好等于它的因子之和 这个数就称为 完数 例如 6 61 1 43 2 43 3 编程找出 1000 以内的所有完数 分析 一千个数肯定跑不了循环的使用 xff0c 常用的循环有两个 xff0c 一个是for xff0c 一
  • 数据结构算法设计题汇总

    五 算法设计题 xff08 本题10分 xff09 34 二叉排序树的类型定义如下 xff1a typedef struct BSTNode 二叉排序树的结点结构 int data 数据域 struct BSTNode lchild rch
  • 初学node.js 对app.js的解释

    使用各种模块包 http errors模块包主要功能监视http请求过程的错误 中间件middleware xff0c 中间件本质上就是一个模块包 监听错误的中间件 var createError 61 span class token f
  • 什么是原码、反码和补码

    什么是原码 反码和补码 文章目录 什么是原码 反码和补码1 机器数2 原码3 反码4 补码5 总结 1 机器数 前言 一个数在计算机中的表示形式是二进制的话 xff0c 这个数其实就叫机器数 机器数通常是带有符号的 xff08 指有正数和负
  • ros找不到包的两种原因

    目前遇到的找不到包的两种情况是 没有设置环境变量而找不到包 解决方法1 xff0c 当前终端输入source 加包所在工作空间的devel set bash的绝对路径或相对命令行的路径 解决方法2 xff0c 打开用户目录 xff5e 的
  • Python 设计一个窗口程序,进行多种数学计算

    设计一个窗口程序 xff1a 想要实现四种功能 xff1a 1 设置按钮 x1f518 1 xff1a 点击 弹出三行输入框 输入函数表达式 显示其Latex数学表达式 输入三个函数 分别为 f 1 x f 2 x f 3 x 点击 run
  • OpenGL:如何从缓存中读取颜色、深度信息【转】

    GPU渲染完数据在显存 xff0c 回传内存的唯一方式glReadPixels函数 显存也被叫做显示内存 帧缓存 xff0c 它是用来存储显示芯片处理过或者即将读取的渲染数据 如同计算机的内存一样 xff0c 显存是用来存储图形数据的硬件
  • 字符串的练习

    字符串的练习 1 接受用户输入的字符串 将其中的字符以输入相反的顺序输出 例如 34 abc 39 34 cab 39 39 解法1 用for循环的倒叙 但这样并有改变字符串的值 string str 61 34 werthueyihzii
  • eNSP配置ospf——三台路由器

    文章目录 拓扑配置IP地址配置ospfAR1AR2AR3 总结两路由器之间配置ospf xff0c 需要将接口配置为同一网段再宣告 两路由器之间配置ospf xff0c 需要两边都进行宣告 拓扑 配置IP地址 如拓扑图所示 xff0c 不再
  • 【openstack】cloudkitty组件,入门级安装(快速)

    文章目录 前言架构安装配置启动检索并安装 CloudKitty 的仪表板 前言 什么是CloudKitty xff1f CloudKitty是OpenStack等的评级即服务项目 该项目旨在成为云的退款和评级的通用解决方案 从历史上看 xf