[ English | 한국어 (대한민국) | English (United Kingdom) | Indonesia | français | русский | Deutsch ]

Telemetry dengan contoh Gnocchi, Ceph dan Redis

Instalasi openstack-ansible default mengkonfigurasi gnocchi untuk menggunakan file sebagai backend penyimpanan. Ketika Anda sudah memiliki ceph pra-instal, Anda dapat menggunakan ini sebagai backend untuk gnocchi. Dokumentasi ini akan memandu Anda cara mengatur gnocchi untuk menggunakan ceph sebagai backend penyimpanan.

Ceph sebagai penyimpanan metrik

gnocchi_storage_driver: ceph

Anda harus menambahkan beberapa paket pip ke pengaturan gnocchi Anda:

gnocchi_pip_packages:
- cryptography
- gnocchiclient
# this is what we want:
#  - "gnocchi[mysql,ceph,ceph_alternative_lib,redis]"
# but as there is no librados >=12.2 pip package we have to first install ceph without alternative support
# after adding the ceph repo to gnocchi container, python-rados>=12.2.0 is installed and linked automatically
# and gnocchi will automatically take up the features present in the used rados lib.
- "gnocchi[mysql,ceph,redis]"
- keystonemiddleware
- python-memcached

Tetapi ketika setup Anda tumbuh, gnocchi mungkin memperlambat atau memblokir instalasi ceph Anda. Anda mungkin mengalami permintaan lambat dan terjebak PG di Ceph Anda. Karena ini mungkin memiliki banyak penyebab, lihat presentasi yang ditautkan di bagian Performance Tests for Gnocchi . Mereka juga menyertakan berbagai parameter yang mungkin Anda tune.

Redis sebagai ukuran penyimpanan

Salah satu solusi untuk masalah kinerja yang mungkin terjadi adalah dengan menggunakan penyimpanan ukuran masuk untuk instalasi gnocchi Anda. The supported storage systems adalah:

  • File (default)

  • Ceph (preferred)

  • OpenStack Swift

  • Amazon S3

  • Redis

Ketika instalasi Swift Anda menggunakan Ceph sebagai backend, satu-satunya yang tersisa untuk pengaturan ini adalah Redis.

Jadi, pertama-tama, atur redis server/cluster, mis. dengan ansible role. ini. Selanjutnya, Anda harus mengkonfigurasi Gnocchi dengan OpenStack-Ansible untuk menggunakan Redis Cluster sebagai penyimpanan yang masuk:

gnocchi_conf_overrides:
  incoming:
    driver: redis
    redis_url: redis://{{ hostvars[groups['redis-master'][0]]['ansible_default_ipv4']['address'] }}:{{ hostvars[groups['redis-master'][0]]['redis_sentinel_port'] }}?sentinel=master01{% for host in groups['redis-slave'] %}&sentinel_fallback={{ hostvars[host]['ansible_default_ipv4']['address'] }}:{{ hostvars[host]['redis_sentinel_port'] }}{% endfor %}

Anda juga harus menginstal paket pip/distro tambahan untuk menggunakan redis cluster:

gnocchi_distro_packages:
- apache2
- apache2-utils
- libapache2-mod-wsgi
- git
- build-essential
- python-dev
- libpq-dev
- python-rados
# additional package for python redis client
- python-redis
gnocchi_pip_packages:
- cryptography
- gnocchiclient
# this is what we want:
#  - "gnocchi[mysql,ceph,ceph_alternative_lib,redis]"
# but as there is no librados >=12.2 pip package we have to first install ceph without alternative support
# after adding the ceph repo to gnocchi container, python-rados>=12.2.0 is installed and linked automatically
# and gnocchi will automatically take up the features present in the used rados lib.
- "gnocchi[mysql,ceph,redis]"
- keystonemiddleware
- python-memcached
- redis

Catatan

Kata hati-hati: nama implementasi lib alternatif Ceph (ceph_alternative_lib) bervariasi antara versi Gnocchi.

Zookeeper untuk koordinasi

Saat Anda menggunakan Gnocchi di beberapa server untuk mendistribusikan pekerjaan, tambahkan Zookeeper sebagai backend koordinasi. Untuk mengatur Zookeeper, Anda dapat menggunakan this ansible role.

Buat container untuk Zookeeper:

## conf.d
zookeeper_hosts:
{% for server in groups['control_nodes'] %}
{{ server }}:
  ip: {{ hostvars[server]['ansible_default_ipv4']['address'] }}
{% endfor%}
## env.d
component_skel:
  zookeeper_server:
    belongs_to:
      - zookeeper_all

container_skel:
  zookeeper_container:
    belongs_to:
      - infra_containers
      - shared-infra_containers
    contains:
      - zookeeper_server
    properties:
      service_name: zookeeper

Sekarang Anda dapat mengatur Zookeeper sebagai backend koordinasi untuk Gnocchi:

gnocchi_coordination_url: "zookeeper://{% for host in groups['zookeeper_all'] %}{{ hostvars[host]['container_address'] }}:2181{% if not loop.last %},{% endif %}{% endfor %}"

Anda juga harus menginstal paket tambahan:

gnocchi_pip_packages:
- cryptography
- gnocchiclient
# this is what we want:
#  - "gnocchi[mysql,ceph,ceph_alternative_lib,redis]"
# but as there is no librados >=12.2 pip package we have to first install ceph without alternative support
# after adding the ceph repo to gnocchi container, python-rados>=12.2.0 is installed and linked automatically
# and gnocchi will automatically take up the features present in the used rados lib.
- "gnocchi[mysql,ceph,redis]"
- keystonemiddleware
- python-memcached
- redis
# addiitional pip packages needed for zookeeper coordination backend
- tooz
- lz4
- kazoo

Tes Kinerja untuk Gnocchi

Untuk lebih banyak ide bagaimana menyetel tumpukan (stack) Gnocchi Anda, lihat presentasi ini: