)]}'
{"ansible/roles/monasca/templates/monasca-persister/persister.conf.j2":[{"author":{"_account_id":30491,"name":"Radosław Piliszek","display_name":"Radek","email":"radek@piliszek.it","username":"yoctozepto","status":"self-employed techologist, collaborating mostly with 7bulls.com"},"change_message_id":"7e50a5e4d80a62636d4853fc41616651e3e03a15","unresolved":false,"context_lines":[{"line_number":6,"context_line":"[influxdb]"},{"line_number":7,"context_line":"database_name \u003d {{ monasca_influxdb_name }}"},{"line_number":8,"context_line":"# It is assumed that InfluxDB will be deployed on the same host"},{"line_number":9,"context_line":"ip_address \u003d {{ \u0027api\u0027 | kolla_address | put_address_in_context(\u0027url\u0027) }}"},{"line_number":10,"context_line":"port \u003d {{ monasca_influxdb_http_port }}"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"[kafka_alarm_history]"}],"source_content_type":"text/x-jinja2","patch_set":1,"id":"bf51134e_7fa8c0da","line":9,"range":{"start_line":9,"start_character":40,"end_line":9,"end_character":69},"updated":"2020-06-30 12:31:27.000000000","message":"sure, sure?","commit_id":"8313d83dd21ee6cf96c993069d8e2ce33b376898"},{"author":{"_account_id":31806,"name":"Nikolaos Parasyris","email":"nik.parasyr@protonmail.com","username":"nikparasyr"},"change_message_id":"b47e54d84c13ac2d7aca3d51b7be2f1a7cffcbbd","unresolved":false,"context_lines":[{"line_number":6,"context_line":"[influxdb]"},{"line_number":7,"context_line":"database_name \u003d {{ monasca_influxdb_name }}"},{"line_number":8,"context_line":"# It is assumed that InfluxDB will be deployed on the same host"},{"line_number":9,"context_line":"ip_address \u003d {{ \u0027api\u0027 | kolla_address | put_address_in_context(\u0027url\u0027) }}"},{"line_number":10,"context_line":"port \u003d {{ monasca_influxdb_http_port }}"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"[kafka_alarm_history]"}],"source_content_type":"text/x-jinja2","patch_set":2,"id":"bf51134e_02032b11","line":9,"updated":"2020-06-30 14:12:30.000000000","message":"I would propose something like this:\nStart of file:\n{% set num_nodes \u003d groups[\u0027influxdb\u0027] | length %}\n\nand on this line:\n{% if num_nodes \u003d\u003d 1 %}\nip_address \u003d {{ \u0027api\u0027 | kolla_address | put_address_in_context(\u0027url\u0027) }}\n{% else %}\nip_address \u003d {{ hostvars[inventory_hostname][\u0027ansible_int\u0027][\u0027ipv4\u0027][\u0027address\u0027] }}\n{% endif %}\n\n2 notes: havent tested this, its more of a pseudocode that will automatically pick-up a single or multiple node setup. Also if the else close we probably have to take into account the interface that the user is using. probably from the globals.yaml settings","commit_id":"75c15e95656aff02df7f2923a628617dfeb66447"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"3da13de307214489ce1a498eebe8123edb0b0830","unresolved":false,"context_lines":[{"line_number":6,"context_line":"[influxdb]"},{"line_number":7,"context_line":"database_name \u003d {{ monasca_influxdb_name }}"},{"line_number":8,"context_line":"# It is assumed that InfluxDB will be deployed on the same host"},{"line_number":9,"context_line":"ip_address \u003d {{ \u0027api\u0027 | kolla_address | put_address_in_context(\u0027url\u0027) }}"},{"line_number":10,"context_line":"port \u003d {{ monasca_influxdb_http_port }}"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"[kafka_alarm_history]"}],"source_content_type":"text/x-jinja2","patch_set":2,"id":"bf51134e_9bf18b6e","line":9,"in_reply_to":"bf51134e_02032b11","updated":"2020-07-15 15:57:07.000000000","message":"Thanks Nikolaos - they way I was thinking this should work is that we have monasca-persister on every node that hosts InfluxDB. So at the moment, the IP set here should be the IP of the InfluxDB instance on the same node. Then the Monasca API talks to InfluxDB via HAProxy, eg it has this in all instances of the Monasca API config file:\n\n```\n[influxdb]\ndatabase_name \u003d monasca\nip_address \u003d 192.0.2.10\nport \u003d 8086\n```\n\nThen HAProxy load balances over the replicas, eg:\n\n```\nbind 192.0.2.10:8086\n    server secondary1 192.0.2.2:8086 check inter 2000 rise 2 fall 5 \n    server secondary2 192.0.2.3:8086 check inter 2000 rise 2 fall 5 \n    server primary 192.0.2.1:8086 check inter 2000 rise 2 fall 5 \n```\n\nDoes that make sense, or did I miss something?","commit_id":"75c15e95656aff02df7f2923a628617dfeb66447"}]}
