[Hyper-V] [Open Stack] [Controller Node] [๋ถ€๊ฐ€ ๊ธฐ๋Šฅ] โ‘ก Gnocchi & Ceilometer - ํ…”๋ ˆ๋ฏธํ„ฐ ์„ค์น˜ ๋ฐ ๊ตฌ์„ฑ

2023. 9. 17. 01:00ใ†System ์ž‘์—…์‹ค/Server ๊ด€๋ จ

728x90
๋ฐ˜์‘ํ˜•

 

 

 

 

 

 

 

 

 

OpenStack for Architects - Second Edition Paperback

COUPANG

www.coupang.com

"์ด ํฌ์ŠคํŒ…์€ ์ฟ ํŒก ํŒŒํŠธ๋„ˆ์Šค ํ™œ๋™์˜ ์ผํ™˜์œผ๋กœ, ์ด์— ๋”ฐ๋ฅธ ์ผ์ •์•ก์˜ ์ˆ˜์ˆ˜๋ฃŒ๋ฅผ ์ œ๊ณต๋ฐ›์Šต๋‹ˆ๋‹ค."

 




๐Ÿ—‚ ๋ชฉ์ฐจ

1. [Hyper-V] [Open Stack] Open Stack์ด๋ž€?
2. [Hyper-V] [Open Stack] [Controller Node] Hyper-V ๊ตฌ์„ฑ ๋ฐ Ubuntu 22.04.3 LTS Server ์„ค์น˜
3. [Hyper-V] [Open Stack] [Controller Node] โ‘  ์˜คํ”ˆ์Šคํƒ ํŒจํ‚ค์ง€ ์„ค์น˜
4. [Hyper-V] [Open Stack] [Controller Node] โ‘ก NTP Server ๊ตฌ์„ฑ
5. [Hyper-V] [Open Stack] [Controller Node] โ‘ข RabbitMQ - Message Queue ์„ค์น˜ ๋ฐ ๊ตฌ์„ฑ
6. [Hyper-V] [Open Stack] [Controller Node] โ‘ฃ Memcached ์„ค์น˜ ๋ฐ ๊ตฌ์„ฑ
7. [Hyper-V] [Open Stack] [Controller Node] โ‘ค Etcd ์„ค์น˜ ๋ฐ ๊ตฌ์„ฑ
8. [Hyper-V] [Open Stack] [Controller Node] โ‘ฅ Keystone - Identity ์„ค์น˜ ๋ฐ ๊ตฌ์„ฑ
9. [Hyper-V] [Open Stack] [Controller Node] โ‘ฆ Image Service - Glance ์„ค์น˜ ๋ฐ ๊ตฌ์„ฑ  
10. [Hyper-V] [Open Stack] [Controller Node] โ‘ง Compute Service - Nova ์„ค์น˜ ๋ฐ ๊ตฌ์„ฑ
11. [Hyper-V] [Open Stack] [Contoller Node] โ‘จ Neutron - Network ์„œ๋น„์Šค ์„ค์น˜ ๋ฐ ๊ตฌ์„ฑ
12. [Hyper-V] [Open Stack] [Controller Node] โ‘ โ“ช Horizon - Dashboard ์„œ๋น„์Šค ์„ค์น˜ ๋ฐ ๊ตฌ์„ฑ

13. [Hyper-V] [Open Stack] [Compute Node] Hyper-V ๊ตฌ์„ฑ ๋ฐ Ubuntu 22.04.3 LTS Server ์„ค์น˜ ๋ฐ ์ดˆ๊ธฐ ๊ตฌ์„ฑ
14. [Hyper-V] [Open Stack] [Compute Node] โ‘  ์˜คํ”ˆ์Šคํƒ ํŒจํ‚ค์ง€ ์„ค์น˜
15. [Hyper-V] [Open Stack] [Compute Node] โ‘ก Nova ์„ค์น˜ ๋ฐ ๊ตฌ์„ฑ
16. [Hyper-V] [Open Stack] [Compute Node] โ‘ข Neutron - Network ์„œ๋น„์Šค ์„ค์น˜ ๋ฐ ๊ตฌ์„ฑ

 

 

 

 

๐Ÿš€ Controller Node ๊ตฌ์„ฑ

    ๐Ÿ”ฝ ๊ฐœ์š”

์ฃผ๋‹ˆ์˜ ์˜คํ”ˆ์Šคํƒ ๊ตฌ์„ฑ๋„

 

 

 

 

 

       ๐Ÿ“ฆ ์†Œ๊ฐœ - Ceilometer

ํ…”๋ ˆ๋ฏธํ„ฐ ์„œ๋น„์Šค Ceilometer๋Š” ํด๋ผ์šฐ๋“œ์—์„œ ๋ฐฐํฌ๋œ ์ž์›์˜ ์‚ฌ์šฉ๋Ÿ‰ ๋ฐ ์„ฑ๋Šฅ ์ธก์ •์„ ํ•˜์—ฌ ์‚ฌ์šฉ์ž๊ฐ€ ์ž์›์˜ ์ƒํƒœ๋ฅผ ๋ชจ๋‹ˆํ„ฐ๋ง ํ•  ์ˆ˜ ์žˆ๋„๋ก ๋„์™€์ฃผ๋Š” ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•˜๊ณ  ์žˆ์–ด์š”.

๋˜ํ•œ, ์—ฌ๋Ÿฌ ๋ถ„์‚ฐ๋œ ํด๋ผ์šฐ๋“œ ์‹œ์Šคํ…œ์˜ ์ž์› ์ƒํƒœ๋ฅผ ๋ชจ๋‹ˆํ„ฐ๋งํ•จ์œผ๋กœ ๊ฐ€์‹œ์„ฑ๊ณผ ํ†ต์ฐฐ๋ ฅ์„ ์ œ๊ณตํ•˜๊ณ , ์ž์›์˜ ํ†ต๊ณ„๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ต๋‹ˆ๋‹ค.
์ด๋Š” ์ปดํ“จํŒ…, ๋„คํŠธ์›Œํฌ, ์Šคํ† ๋ฆฌ์ง€ ๋“ฑ ๋‹ค์–‘ํ•œ ์ž์› ์œ ํ˜•์— ๋Œ€ํ•œ ๋ฐ์ดํ„ฐ ์ˆ˜์ง‘ ๋ฐ ์ฒ˜๋ฆฌ๋ฅผ ์ œ๊ณตํ•˜๊ณ  ์žˆ์–ด์š”.

Ceilometer๋Š” ํด๋ผ์šฐ๋“œ ํ™˜๊ฒฝ์—์„œ ์ž์› ๊ด€๋ฆฌ ๋ฐ ์‚ฌ์šฉ ์ถ”์ ์„ ํ–ฅ์ƒ์‹œํ‚ฌ ์ˆ˜ ์žˆ๊ณ , ์ด ์ •๋ณด๋Š” ํด๋ผ์šฐ๋“œ ์šด์˜์ž ๋ฐ ์‚ฌ์šฉ์ž์—๊ฒŒ ์ž์› ์‚ฌ์šฉ์— ๋Œ€ํ•œ ํˆฌ๋ช…์„ฑ์„ ์ œ๊ณตํ•˜๊ณ , ์˜คํ†  ์Šค์ผ€์ผ๋ง, ์ •์ฑ… ๊ด€๋ฆฌ ๋ฐ ๋น„์šฉ ๋ถ„์„๊ณผ ๊ฐ™์€ ํด๋ผ์šฐ๋“œ ๊ด€๋ฆฌ ์ž‘์—… ์ง€์›์— ์‚ฌ์šฉ๋  ์ˆ˜ ์žˆ์–ด์š”.

Ceilometer๋Š” ์˜คํ”ˆ์Šคํƒ์˜ ์ปดํฌ๋„ŒํŠธ ์ค‘ ํ•˜๋‚˜๋กœ ํด๋ผ์šฐ๋“œ ํ™˜๊ฒฝ์—์„œ ์ž์› ๋ชจ๋‹ˆํ„ฐ๋ง๊ณผ ๊ด€๋ฆฌ๋ฅผ ๊ฐœ์„ ํ•˜๋Š”๋ฐ ์ค‘์š”ํ•œ ์—ญํ• ์„ ํ•˜๊ณ  ์žˆ์–ด์š”.

Ceilometer๋Š” ์—์ด์ „ํŠธ, ์ปฌ๋ ‰ํ„ฐ, ์•Œ๋ฆผ๊ณผ ๋ฐ์ดํ„ฐ ์ „์†ก์„ ์œ„ํ•œ ๋ฒ„์Šค๋“ค, ์ €์žฅ์†Œ, API๋กœ ๊ตฌ์„ฑ๋˜๋ฉฐ, ์•„๋ž˜์™€ ๊ฐ™์ด ๋™์ž‘ํ•ด์š”.

 

๊ตฌ์„ฑ ์š”์†Œ ์ƒ์„ธ ๋‚ด์šฉ
ceilometer-agent-comput ๊ฐ๊ฐ์˜ ์ปดํ“จํŒ… ๋…ธ๋“œ์— ์„ค์น˜๋˜์–ด ์‹คํ–‰๋˜๋ฉฐ, ์ž์› ํ™œ์šฉ ํ†ต๊ณ„๋กœ ์‚ฌ์šฉ.
ceilometer-agent-central ์ค‘์•™ ๊ด€๋ฆฌ ์„œ๋ฒ„์—์„œ ์‹คํ–‰๋˜๋ฉฐ, ์ธ์Šคํ„ด์Šค์— ์—ฐ๊ฒฐ๋˜์ง€ ์•Š์€ ์ž์›์ด๋‚˜ ์ปดํ“จํŠธ ๋…ธ๋“œ์— ๋Œ€ํ•œ ํ™œ์šฉ ๊ฐ€๋Šฅ ์ž์› ํ†ต๊ณ„ ํด๋ง.
ceilometer-collector ์ค‘์•™ ๊ด€๋ฆฌ ์„œ๋ฒ„์—์„œ ์‹คํ–‰๋˜๋ฉฐ, ๋ฉ”์‹œ์ง€ ํ(์—์ด์ „ํŠธ์—์„œ ์˜ค๋Š” ๋ฏธํ„ฐ๋ง ๋ฐ์ดํ„ฐ์— ๋Œ€ํ•œ ์•Œ๋ฆผ)๋ฅผ ๋ชจ๋‹ˆํ„ฐ๋ง.

์•Œ๋ฆผ ๋ฉ”์‹œ์ง€ ์ฒ˜๋ฆฌ ๋’ค ํ•ด๋‹น ๋ฉ”์‹œ์ง€๋ฅผ ๋ฏธํ„ฐ๋ง์œผ๋กœ ์ „ํ™˜ํ•˜๊ณ , ํ•ด๋‹น ํ•ญ๋ชฉ์„ ์‚ฌ์šฉํ•˜์—ฌ ๋ฉ”์‹œ์ง€ ๋ฒ„์Šค๋ฅผ ํ†ตํ•ด ์™ธ๋ถ€๋กœ ๋‹ค์‹œ ์ „์†ก.
ํ…”๋ ˆ๋ฏธํ„ฐ ๋ฉ”์‹œ์ง€๋Š” ์ˆ˜์ • ์—†์ด ๋ฐ์ดํ„ฐ ์ €์žฅ์†Œ์— ๊ธฐ๋ก.
ceilometer-alarm-notifier ํ•˜๋‚˜ ์ด์ƒ์˜ ์ค‘์•™ ๊ด€๋ฆฌ ์„œ๋ฒ„์—์„œ ์‹คํ–‰๋˜๋ฉฐ, ์ƒ˜ํ”” ์ˆ˜์ง‘์„ ์œ„ํ•œ ์ž„๊ณ„ ๊ฐ’์˜ ํ‰๊ฐ€์— ๋”ฐ๋ผ ์•Œ๋ฆผ ์„ค์ •.
๋ฐ์ดํ„ฐ ์ €์žฅ์†Œ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๋™์‹œ ์ฒ˜๋ฆฌ๋Šฅ๋ ฅ์„ ์ฝ๊ณ  ์ €์žฅ.
ceilometer-api ํ•˜๋‚˜ ์ด์ƒ์˜ ์ค‘์•™ ๊ด€๋ฆฌ ์„œ๋ฒ„์—์„œ ์‹คํ–‰๋˜๋ฉฐ, ๋ฐ์ดํ„ฐ ์ €์žฅ์†Œ๋กœ๋ถ€ํ„ฐ ๋ฐ์ดํ„ฐ ์ ‘๊ทผ ์ œ๊ณต.



 

 

       ๐Ÿ“ฆ ์†Œ๊ฐœ - Gnocchi

Gnocchi๋Š” ๋ฉ€ํ‹ฐํ…Œ๋„ŒํŠธ ์‹œ๊ณ„์—ด, ๋ฉ”ํŠธ๋ฆญ, ๋ฆฌ์†Œ๋“œ ๋ฐ์ดํ„ฐ ๋ฒ ์ด์Šค์—์š”.
์ดํ„ฐ ๊ด€๋ฆฌ์— HTTP REST ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ์ œ๊ณตํ•˜๊ณ  ์žˆ๊ณ , ๋Œ€์šฉ๋Ÿ‰ ๋ฉ”ํŠธ๋ฆญ์„ ์ €์žฅํ•  ์ˆ˜ ์žˆ๋„๋ก ๋งŒ๋“ค์–ด์กŒ์–ด์š”.

Ceilometer๋ฅผ ๋งŒ๋“ค๋˜ Julien Danjou๊ฐ€ MongoDB๋‚˜, RDB๋กœ๋Š” ๋ฐ์ดํ„ฐ ๊ด€๋ฆฌ์— ํ•œ๊ณ„๋ฅผ ๋Š๊ปด ๋งŒ๋“ค์—ˆ๋‹ค๊ณ  ํ•ด์š”.
๋˜ํ•œ, ์•Œ๊ณ ๋ฆฌ์ฆ˜ ๋ณต์žก๋„๋ฅผ O(n)์—์„œ O(1)๋กœ ๋ณ€๊ฒฝํ•˜๊ณ  ์‹ถ์–ด์„œ ๋งŒ๋“ค์—ˆ๋‹ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค.

์ฒ˜์Œ์—๋Š” Graphite์—์„œ ์‚ฌ์šฉํ•˜๋Š” whisper ๊ธฐ๋ฐ˜์œผ๋กœ ๋งŒ๋“ค๋ ค๊ณ  ํ•˜์˜€๋Š”๋ฐ, whisper์— ํ•„์š”ํ•œ ๊ธฐ๋Šฅ์„ ํŒจ์น˜ํ•˜๋ ค๊ณ  ํ•˜๋‹ˆ ์ฝ”๋“œ์— ๋‹จ์œ„ ํ…Œ์ŠคํŠธ๋„ ์—†๊ณ , ์ˆ˜์ •๋„ ์–ด๋ ค์›Œ์„œ ํฌ๊ธฐํ•˜๊ณ , Python ํ†ต๊ณ„ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์ธ Pandas(Python Data Analysis Library)๋ฅผ ์ด์šฉํ•ด ์ง์ ‘ ๋งŒ๋“ค์—ˆ๋‹ค๊ณ  ํ•ด์š”.

์ด๋ ‡๊ฒŒ ํ•ด์„œ carbonara๋ผ๋Š” ์‹œ๊ณ„์—ด์šฉ ํŒŒ์ผ ํฌ๋งท์ด ํƒ„์ƒํ–ˆ๋‹ค๊ณ  ํ•ด์š”.
์‹ค์ œ ๋ฉ”ํŠธ๋ฆญ ๋ฐ์ดํ„ฐ๋Š” carbonara ํฌ๋งท์œผ๋กœ ์ €์žฅ์†Œ(file, ceph, swift, S3)์— ์ €์žฅํ•˜๊ณ , ๋ฉ”ํŠธ๋ฆญ ํƒ€์ž…์ด๋‚˜, ์ž์›์€ RDB์— ์ €์žฅํ•ด์„œ ๊ด€๋ฆฌํ•œ๋‹ค๊ณ  ํ•ด์š”. ์ด ๋ฐฉ์‹์„ gnocchi์—์„œ๋Š” indexer๋ผ๊ณ  ๋ถ€๋ฅด๊ณ  ์žˆ์–ด์š”.

 

 

 

 

    ๐Ÿ”ฝ ๊ตฌ์„ฑ ์š”์†Œ ์„ค์น˜ ๋ฐ ๊ตฌ์„ฑ

       ๐Ÿ“ฆ Gnocchi ์ดˆ๊ธฐ ๊ตฌ์„ฑ - ์ปจํŠธ๋กค๋Ÿฌ ๋…ธ๋“œ

์ตœ์ดˆ Keystone์— Gnocchi ๊ด€๋ จ ์‚ฌ์šฉ์ž์™€ ์„œ๋น„์Šค, ์—”๋“œํฌ์ธํŠธ๋ฅผ ๋งŒ๋“ค์–ด ์ค„๊ฒŒ์š”.

openstack user create --domain default --project service --password servicepassword gnocchi

 

 

์œ„ servicepassword์—๋Š” gnocchi ๊ณ„์ •์ด ์‚ฌ์šฉํ•  ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์ž…๋ ฅํ•ด ์ฃผ๊ณ ,
๋˜๋„๋ก ํŠน์ˆ˜๋ฌธ์ž๋Š” ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š”๊ฑธ ๊ถŒ์žฅํ•ด์š”.

 

openstack role add --project service --user gnocchi admin


๊ทธ๋Ÿฐ ๋’ค ์œ„์™€ ๊ฐ™์ด ๊ด€๋ฆฌ์ž ๊ถŒํ•œ์„ ๋ถ€์—ฌํ•ด ์ฃผ์—ˆ์–ด์š”.



openstack service create --name gnocchi --description "Metric Service" metric


์œ„์™€ ๊ฐ™์ด ์„œ๋น„์Šค๋ฅผ ๋งŒ๋“ค์–ด ์ฃผ์—ˆ์–ด์š”.



export controller=private-controller; openstack endpoint create --region RegionOne metric public http://$controller:8041; openstack endpoint create --region RegionOne metric internal http://$controller:8041

 

openstack endpoint create --region RegionOne metric admin http://$controller:8041



๊ทธ๋ฆฌ๊ณ  ์œ„์™€ ๊ฐ™์ด ์—”๋“œํฌ์ธํŠธ๋ฅผ ๋งŒ๋“ค์–ด ์ฃผ์—ˆ์–ด์š”.


DB ๋ฐ ๊ณ„์ • ์ƒ์„ฑ


๊ทธ๋ฆฌ๊ณ  ์œ„์™€ ๊ฐ™์ด DB์™€ ๊ณ„์ •์„ ๋งŒ๋“ค์–ด ์ฃผ์—ˆ์–ด์š”.

 

 

์ด์ œ ํŒจํ‚ค์ง€๋ฅผ ๋ฐ›๊ณ , ์ดˆ๊ธฐ ์„ค์ • ํ•ด ์ฃผ๋„๋กํ• ๊ฒŒ์š”.

apt install gnocchi-api gnocchi-metricd python3-gnocchiclient apache2 libapache2-mod-wsgi-py3




์œ„ ํ™”๋ฉด์ด ๋‚˜์˜ค๋ฉด NO๋ฅผ ์„ ํƒํ•˜๊ณ  ๋„˜์–ด๊ฐ‘๋‹ˆ๋‹ค.

 




์œ„ ํ™”๋ฉด์ด ๋‚˜์˜ค๋ฉด NO๋ฅผ ์„ ํƒํ•˜๊ณ  ๋„˜์–ด๊ฐ‘๋‹ˆ๋‹ค.






์œ„ ํ™”๋ฉด์ด ๋‚˜์˜ค๋ฉด NO๋ฅผ ์„ ํƒํ•˜๊ณ  ๋„˜์–ด๊ฐ‘๋‹ˆ๋‹ค.



 

[DEFAULT]
log_dir = /var/log/gnocchi

[api]
auth_mode = keystone

[database]
backend = sqlalchemy

# MariaDB connection info
[indexer]
url = mysql+pymysql://gnocchi:password@192.168.20.254/gnocchi

[storage]
driver = file
file_basepath = /var/lib/gnocchi

# Keystone auth info
[keystone_authtoken]
www_authenticate_uri = http://private-controller:5000
auth_url = http://private-controller:5000
memcached_servers = private-controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = gnocchi
password = servicepassword
service_token_roles_required = true
# if using self-signed certs on Apache2 Keystone, turn to [true]
insecure = false


์œ„์™€ ๊ฐ™์ด ์„ค์ •ํ•˜๊ณ , ์ €์žฅํ•˜๊ณ  ๋‚˜์˜ต๋‹ˆ๋‹ค.



vim /etc/apache2/sites-available/gnocchi-api.conf



์œ„์™€ ๊ฐ™์ด ๋ณ€๊ฒฝํ•˜๊ณ , ์ €์žฅํ•˜๊ณ , ๋‚˜์˜ต๋‹ˆ๋‹ค.


{
    "admin_or_creator": "role:admin or user:%(creator)s or project_id:%(created_by_project_id)s",
    "resource_owner": "project_id:%(project_id)s",
    "metric_owner": "project_id:%(resource.project_id)s",

    "get status": "role:admin",

    "create resource": "",
    "get resource": "rule:admin_or_creator or rule:resource_owner",
    "update resource": "rule:admin_or_creator",
    "delete resource": "rule:admin_or_creator",
    "delete resources": "rule:admin_or_creator",
    "list resource": "rule:admin_or_creator or rule:resource_owner",
    "search resource": "rule:admin_or_creator or rule:resource_owner",

    "create resource type": "role:admin",
    "delete resource type": "role:admin",
    "update resource type": "role:admin",
    "list resource type": "",
    "get resource type": "",

    "get archive policy": "",
    "list archive policy": "",
    "create archive policy": "role:admin",
    "update archive policy": "role:admin",
    "delete archive policy": "role:admin",

    "create archive policy rule": "role:admin",
    "get archive policy rule": "",
    "list archive policy rule": "",
    "update archive policy rule": "role:admin",
    "delete archive policy rule": "role:admin",

    "create metric": "",
    "delete metric": "rule:admin_or_creator",
    "get metric": "rule:admin_or_creator or rule:metric_owner",
    "search metric": "rule:admin_or_creator or rule:metric_owner",
    "list metric": "rule:admin_or_creator or rule:metric_owner",

    "get measures":  "rule:admin_or_creator or rule:metric_owner",
    "post measures":  "rule:admin_or_creator"
}

vim /etc/gnocchi/policy.json

๊ทธ๋ฆฌ๊ณ  ์œ„ ๋‚ด์šฉ์„ ์ถ”๊ฐ€ํ•˜๊ณ , ์ €์žฅํ•˜๊ณ , ๋‚˜์˜ต๋‹ˆ๋‹ค.



chmod 640 /etc/gnocchi/gnocchi.conf; chgrp gnocchi /etc/gnocchi/gnocchi.conf


์„ค์ • ํŒŒ์ผ์— ๊ถŒํ•œ๊ณผ ์†Œ์œ  ๊ทธ๋ฃน์„ ๋ณ€๊ฒฝํ•ด ์ฃผ์—ˆ์–ด์š”.



vim /etc/nginx/nginx.conf

 

    upstream gnocchi-api {
        server 127.0.0.1:8041;
    }
    server {
        #listen 192.168.20.3:8041 ssl;
        listen 192.168.20.3:8041;
        proxy_pass gnocchi-api;
    }

 

๊ทธ๋ฆฌ๊ณ  ์œ„ ๋‚ด์šฉ์„ ์ถ”๊ฐ€ํ•ด ์ฃผ์—ˆ์–ด์š”.




su -s /bin/bash gnocchi -c "gnocchi-upgrade"



์œ„์™€ ๊ฐ™์ด DB์— ๋ฐ์ดํ„ฐ๋ฅผ ์ž…๋ ฅํ•ด ์ฃผ์—ˆ์–ด์š”.



a2enmod wsgi; a2ensite gnocchi-api; systemctl restart gnocchi-metricd apache2 nginx; systemctl enable gnocchi-metricd


๊ทธ๋ฆฌ๊ณ  ์œ„์™€ ๊ฐ™์ด ๊ด€๋ จ ์„œ๋น„์Šค๋ฅผ ์žฌ๊ธฐ๋™ํ•˜๊ณ , ์„œ๋น„์Šค์— ๋“ฑ๋กํ•ด ์ฃผ์—ˆ์–ด์š”.



 

 

       ๐Ÿ“ฆ ์ž˜ ๊ตฌ์„ฑ ๋˜์—ˆ๋‚˜? ๐Ÿค”

apt install -y python3-gnocchiclient


์ตœ์ดˆ ์œ„์™€ ๊ฐ™์ด gnocchi client๋ฅผ ๋‚ด๋ ค ๋ฐ›์•„ ์ฃผ์—ˆ์–ด์š”.

 

export OS_AUTH_TYPE=password; gnocchi resource list


์œ„์™€ ๊ฐ™์ด Error ๊ด€๋ จ ๋‚ด์šฉ์ด ๋ณด์ด์ง€ ์•Š์œผ๋ฉด ์ •์ƒ์œผ๋กœ ๊ตฌ์„ฑ๋œ ๊ฒƒ์ด์—์š”.

 

 

 

    ๐Ÿ”ฝ ๊ตฌ์„ฑ ์š”์†Œ ์„ค์น˜ ๋ฐ ๊ตฌ์„ฑ

       ๐Ÿ“ฆ Celiometer ์ดˆ๊ธฐ ๊ตฌ์„ฑ - ์ปจํŠธ๋กค๋Ÿฌ ๋…ธ๋“œ (๋„คํŠธ์›Œํฌ ๋…ธ๋“œ)

๋งŒ์•ฝ ๋„คํŠธ์›Œํฌ ๋…ธ๋“œ๋ฅผ ๋”ฐ๋กœ ๊ตฌ์„ฑํ–ˆ๋‹ค๋ฉด ์ด ๋ถ€๋ถ„์€ ๋„คํŠธ์›Œํฌ ๋…ธ๋“œ์—์„œ ์ง„ํ–‰ํ•ด์•ผ ํ•ด์š”.

์ฃผ๋‹ˆ๋Š” ์ปจํŠธ๋กค๋Ÿฌ ๋…ธ๋“œ์—์„œ ์ง„ํ–‰ํ•ฉ๋‹ˆ๋‹ค.

์ตœ์ดˆ Keystone์— Ceilometer ๊ด€๋ จ ์‚ฌ์šฉ์ž์™€ ์„œ๋น„์Šค๋ฅผ ๋งŒ๋“ค์–ด ์ค„๊ฒŒ์š”.

openstack user create --domain default --project service --password servicepassword ceilometer

 




์œ„ servicepassword์—๋Š” ceilometer ๊ณ„์ •์ด ์‚ฌ์šฉํ•  ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์ž…๋ ฅํ•ด ์ฃผ๊ณ ,
๋˜๋„๋ก ํŠน์ˆ˜๋ฌธ์ž๋Š” ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š”๊ฑธ ๊ถŒ์žฅํ•ด์š”.


openstack role add --project service --user ceilometer admin


๊ทธ๋Ÿฐ ๋’ค ์œ„์™€ ๊ฐ™์ด ๊ด€๋ฆฌ์ž ๊ถŒํ•œ์„ ๋ถ€์—ฌํ•ด ์ฃผ์—ˆ์–ด์š”.



openstack service create --name ceilometer --description "OpenStack Telemetry Service" metering


๊ทธ๋ฆฌ๊ณ  ์œ„์™€ ๊ฐ™์ด ์„œ๋น„์Šค๋ฅผ ๋งŒ๋“ค์–ด ์ฃผ์—ˆ์–ด์š”.


apt install ceilometer-agent-central ceilometer-agent-notification


์ด์ œ ํŒจํ‚ค์ง€๋ฅผ ์„ค์น˜ํ•˜๊ณ , ์„ค์ • ํŒŒ์ผ์„ ์ˆ˜์ •ํ•ด ๋ณผ๊ฒŒ์š”.


vim /etc/ceilometer/ceilometer.conf [DEFAULT], [api], [dispatcher_gnocchi] ์ถ”๊ฐ€

๋ฐ˜์‘ํ˜•
[DEFAULT]
# RabbitMQ connection info
transport_url = rabbit://openstack:password@private-controller

[api]
auth_mode = keystone

[dispatcher_gnocchi]
filter_service_activity = False

[keystone_authtoken]
www_authenticate_uri = http://private-controller:5000
auth_url = http://private-controller:5000
memcached_servers = private-controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = gnocchi
password = servicepassword
# if using self-signed certs on Apache2 Keystone, turn to [true]
insecure = false



vim /etc/ceilometer/ceilometer.conf [service_credentials] ์ถ”๊ฐ€

 

[service_credentials]
auth_url = http://private-controller:5000
memcached_servers = private-controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = ceilometer
password = servicepassword
# if using self-signed certs on Apache2 Keystone, turn to [true]
insecure = false



์—ฌ๊ธฐ๊นŒ์ง€ ๋˜์—ˆ๋‹ค๋ฉด ์ €์žฅํ•˜๊ณ , ๋‚˜์˜ต๋‹ˆ๋‹ค.



chmod 640 /etc/ceilometer/ceilometer.conf; chgrp ceilometer /etc/ceilometer/ceilometer.conf


๊ทธ๋Ÿฐ ๋’ค ์„ค์ • ํŒŒ์ผ์— ๋Œ€ํ•ด ์œ„์™€ ๊ฐ™์ด ๊ถŒํ•œ๊ณผ ์†Œ์œ  ๊ทธ๋ฃน์„ ๋ณ€๊ฒฝํ•ด ์ค๋‹ˆ๋‹ค.



su -s /bin/bash ceilometer -c "ceilometer-upgrade"

 

 

su -s /bin/bash ceilometer -c "ceilometer-upgrade"; systemctl restart ceilometer-agent-central ceilometer-agent-notification; systemctl enable ceilometer-agent-central ceilometer-agent-notification



๊ทธ๋Ÿฐ ๋’ค ์œ„์™€ ๊ฐ™์ด ceilometer ์ •๋ณด๋ฅผ ์—…๋ฐ์ดํŠธ ํ•˜๊ณ , ๊ฐ ๋ฐ๋ชฌ์„ ์žฌ๊ธฐ๋™ํ•˜๊ณ , ์„œ๋น„์Šค์— ๋“ฑ๋กํ•ด ์ฃผ์—ˆ์–ด์š”.

 

 

 

 

       ๐Ÿ“ฆ Celiometer ์ดˆ๊ธฐ ๊ตฌ์„ฑ - ์ปดํ“จํŠธ ๋…ธ๋“œ

์ด๋ฒˆ์—” ์ปดํ“จํŠธ ๋…ธ๋“œ์—์„œ ์„ค์ •์„ ์ง„ํ–‰ํ•ด ์ค„๊ฒŒ์š”.

์ตœ์ดˆ ํ•„์š” ํŒจํ‚ค์ง€๋ฅผ ์„ค์น˜ํ• ๊ฒŒ์š”.

apt install -y ceilometer-agent-compute




vim /etc/ceilometer/ceilometer.conf [DEFAULT]

 

[DEFAULT]
# RabbitMQ connection info
transport_url = rabbit://openstack:password@private-controller

 

 

vim /etc/ceilometer/ceilometer.conf [service_credentials]

728x90
[service_credentials]
auth_url = http://private-controller:5000
memcached_servers = private-controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = ceilometer
password = servicepassword

 

์—ฌ๊ธฐ๊นŒ์ง€ ๋˜์—ˆ๋‹ค๋ฉด ์ €์žฅํ•˜๊ณ , ๋‚˜์˜ต๋‹ˆ๋‹ค.

 

 

 

chmod 640 /etc/ceilometer/ceilometer.conf; chgrp ceilometer /etc/ceilometer/ceilometer.conf



๊ทธ๋ฆฌ๊ณ  ์œ„์™€ ๊ฐ™์ด ์„ค์ • ํŒŒ์ผ์— ๊ถŒํ•œ๊ณผ ์†Œ์œ  ๊ทธ๋ฃน์„ ๋ณ€๊ฒฝํ•ด ์ฃผ์„ธ์š”.




systemctl restart ceilometer-agent-compute; systemctl enable ceilometer-agent-compute



์œ„์™€ ๊ฐ™์ด ๋ฐ๋ชฌ์„ ์žฌ๊ธฐ๋™ํ•˜๊ณ , ์„œ๋น„์Šค์— ๋“ฑ๋กํ•ด ์ฃผ์—ˆ์–ด์š”.



vim /etc/nova/nova.conf [DEFAULT] ์ถ”๊ฐ€

 

instance_usage_audit = True
instance_usage_audit_period = hour



์œ„์˜ ๋‚ด์šฉ์„ ๊ธฐ์กด ๋‚ด์šฉ [DEFAULT] ์„น์…˜ ๋งจ ๋ฐ‘์— ์ถ”๊ฐ€ํ•ด ์ฃผ์—ˆ์–ด์š”.


vim /etc/nova/nova.conf [oslo_messaging_notifications] ์ถ”๊ฐ€



[oslo_messaging_notifications]
driver = messagingv2

 

 

 

 

vim /etc/nova/nova.conf [notifications] ์ถ”๊ฐ€

 

[notifications]
notify_on_state_change = vm_and_task_state


๋งˆ์ง€๋ง‰์œผ๋กœ ์„ค์ • ํŒŒ์ผ ๋งจ ๋ฐ‘์— ์œ„ ๋‚ด์šฉ์„ ์ถ”๊ฐ€ํ•ด ์ฃผ์—ˆ์–ด์š”.


์—ฌ๊ธฐ๊นŒ์ง€ ๋˜์—ˆ๋‹ค๋ฉด ์ €์žฅํ•˜๊ณ , ๋‚˜์˜ต๋‹ˆ๋‹ค.


systemctl restart nova-compute


๊ทธ๋ฆฌ๊ณ , nova-compute ๋ฐ๋ชฌ์„ ์žฌ๊ธฐ๋™ ํ•ด ์ฃผ์—ˆ์–ด์š”.

 

 

 

       ๐Ÿ“ฆ glance ์ถ”๊ฐ€ ๊ตฌ์„ฑ - ์ปจํŠธ๋กค๋Ÿฌ ๋…ธ๋“œ (์ด๋ฏธ์ง€ ์Šคํ† ๋ฆฌ์ง€ ๋…ธ๋“œ)

์ด๋ฒˆ์—๋Š” ์ด๋ฏธ์ง€ ์Šคํ† ๋ฆฌ์ง€๊ฐ€ ๊ตฌ์„ฑ๋œ ๋…ธ๋“œ์—์„œ ์ง„ํ–‰ํ•ด์•ผํ•ด์š”.

์ฃผ๋‹ˆ๋Š” ์ปจํŠธ๋กค๋Ÿฌ ๋…ธ๋“œ์— ๊ตฌ์„ฑ๋˜์–ด ์žˆ๊ธฐ ๋•Œ๋ฌธ์— ์ปจํŠธ๋กค๋Ÿฌ ๋…ธ๋“œ์—์„œ ์ง„ํ–‰ํ•ฉ๋‹ˆ๋‹ค.


vim /etc/glance/glance-api.conf [oslo_messaging_notifications] ์ถ”๊ฐ€

 

[oslo_messaging_notifications]
driver = messagingv2
# RabbitMQ connection info
transport_url = rabbit://openstack:password@private-controller


์ถ”๊ฐ€ํ•ด ์ฃผ์—ˆ๋‹ค๋ฉด ์ €์žฅํ•˜๊ณ , ๋‚˜์˜ต๋‹ˆ๋‹ค.



systemctl restart glance-api



๊ทธ๋Ÿฐ ๋’ค glance-api ๋ฐ๋ชฌ์„ ์žฌ ๊ธฐ๋™ํ•ด ์ฃผ์—ˆ์–ด์š”.

 

 

 

 

       ๐Ÿ“ฆ Cinder ์ถ”๊ฐ€ ๊ตฌ์„ฑ - ์ปดํ“จํŠธ ๋…ธ๋“œ (๋ธ”๋ก ์Šคํ† ๋ฆฌ์ง€ ๋…ธ๋“œ)

์ด๋ฒˆ์—๋Š” ๋ธ”๋ก ์Šคํ† ๋ฆฌ์ง€๊ฐ€ ๊ตฌ์„ฑ๋œ ๋…ธ๋“œ์—์„œ ์ง„ํ–‰ํ•ด์•ผํ•ด์š”.

์ฃผ๋‹ˆ๋Š” ์ปดํ“จํŠธ ๋…ธ๋“œ์— ๊ตฌ์„ฑ๋˜์–ด ์žˆ๊ธฐ ๋•Œ๋ฌธ์— ์ปดํ“จํŠธ ๋…ธ๋“œ์—์„œ ์ง„ํ–‰ํ•ฉ๋‹ˆ๋‹ค.

 

vim /etc/cinder/cinder.conf [oslo_messaging_notifications] ์ถ”๊ฐ€

 

[oslo_messaging_notifications]
driver = messagingv2
transport_url = rabbit://openstack:password@private-controller



์œ„ ๋‚ด์šฉ์„ ์„ค์ • ํŒŒ์ผ ๋งจ ์•„๋ž˜์ค„์— ์ถ”๊ฐ€ํ•˜๊ณ , ์ €์žฅํ•˜๊ณ , ๋‚˜์™€์ค๋‹ˆ๋‹ค.


systemctl restart cinder-volume.service



๊ทธ๋ฆฌ๊ณ , ์œ„์™€ ๊ฐ™์ด ๋ฐ๋ชฌ์„ ์žฌ ๊ธฐ๋™ํ•ด ์ฃผ์—ˆ์–ด์š”.


systemctl restart apache2 cinder-scheduler


์ด๋ฒˆ์—” ์ปจํŠธ๋กค๋Ÿฌ ๋…ธ๋“œ์—์„œ ๋‘ ๋ฐ๋ชฌ์„ ์žฌ ๊ธฐ๋™ํ•ด ์ฃผ์—ˆ์–ด์š”.

 

 

 

 

 

 

Openstack Essentials Second Edition Paperback

COUPANG

www.coupang.com

"์ด ํฌ์ŠคํŒ…์€ ์ฟ ํŒก ํŒŒํŠธ๋„ˆ์Šค ํ™œ๋™์˜ ์ผํ™˜์œผ๋กœ, ์ด์— ๋”ฐ๋ฅธ ์ผ์ •์•ก์˜ ์ˆ˜์ˆ˜๋ฃŒ๋ฅผ ์ œ๊ณต๋ฐ›์Šต๋‹ˆ๋‹ค."

 

 

 

๐Ÿง ์ฐธ๊ณ  ์ž๋ฃŒ

 

Ubuntu 22.04 LTS : OpenStack Zed : Configure Gnocchi : Server World

root@network:~# mv /etc/gnocchi/gnocchi.conf /etc/gnocchi/gnocchi.conf.org root@network:~# vi /etc/gnocchi/gnocchi.conf # create new [DEFAULT] log_dir = /var/log/gnocchi [api] auth_mode = keystone [database] backend = sqlalchemy # MariaDB connection info [

www.server-world.info

 

Ubuntu 22.04 LTS : OpenStack Zed : Configure Ceilometer (Network Node) : Server World

openstack user create --domain default --project service --password servicepassword ceilometer # add [ceilometer] user in [admin] role root@dlp ~(keystone)# openstack role add --project service --user ceilometer admin openstack service create --name ceilom

www.server-world.info

 

 

 

 

 

728x90
๋ฐ˜์‘ํ˜•