Gnocchi用于将采集数据进行计算合并和存储并提供rest api方式接收和查询监控数据。请在控制节点安装Gnocchi。
mysql -u root -p
CREATE DATABASE gnocchi; GRANT ALL PRIVILEGES ON gnocchi.* TO 'gnocchi'@'localhost' IDENTIFIED BY 'GNOCCHI_DBPASS'; GRANT ALL PRIVILEGES ON gnocchi.* TO 'gnocchi'@'%' IDENTIFIED BY 'GNOCCHI_DBPASS';
将GNOCCHI_DBPASS替换为Gnocchi数据库用户的密码,请根据实际进行设置。密码中请勿包含字符“#@$”,支持特殊字符“&=- _ . + ! * ()”。
exit
openstack user create --domain default --password-prompt gnocchi openstack role add --project service --user gnocchi admin openstack service create --name gnocchi --description "Metric Service" metric 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
密码中请勿包含字符“#@$”,支持特殊字符“&=- _ . + ! * ()”
yum install python3-uWSGI.aarch64 yum install openstack-gnocchi-api openstack-gnocchi-metricd python3-gnocchiclient
vi /etc/gnocchi/gnocchi.conf
[api] auth_mode = keystone port = 8041 uwsgi_mode = http-socket # 配置Keystone认证信息,配置文件中默认没有[keystone_authtoken]模块参数,需要新增。 [keystone_authtoken] www_authenticate_uri = http://controller:5000 auth_type = password auth_url = http://controller:5000/v3 memcached_servers = controller:11211 project_domain_name = Default user_domain_name = Default project_name = service username = gnocchi password = GNOCCHI_PASSWORD interface = internalURL region_name = RegionOne service_token_roles_required = true [indexer] url = mysql+pymysql://gnocchi:GNOCCHI_DBPASS@controller/gnocchi [storage] # coordination_url is not required but specifying one will improve # performance with better workload division across workers. # coordination_url = redis://controller:6379 file_basepath = /var/lib/gnocchi driver = file
将GNOCCHI_DBPASS替换为Gnocchi数据库的密码,将GNOCCHI_PASSWORD替换为Gnocchi用户的密码,请根据实际需求进行设置。密码中请勿包含字符“#@$”,支持特殊字符“&=- _ . + ! * ()”。
gnocchi-upgrade
chmod -R 777 /var/lib/gnocchi
systemctl enable openstack-gnocchi-api.service openstack-gnocchi-metricd.service systemctl start openstack-gnocchi-api.service openstack-gnocchi-metricd.service