mirror of
https://github.com/viq/NewsBlur.git
synced 2025-04-13 09:38:09 +00:00
Adding postgres and elasticsearch to hetzner. Updating redis flask metrics.
This commit is contained in:
parent
4d9b0161e7
commit
1ed3c9f40a
6 changed files with 14 additions and 9 deletions
|
@ -8,7 +8,7 @@
|
|||
- ../env_vars/base.yml
|
||||
roles:
|
||||
- {role: 'base', tags: 'base'}
|
||||
- {role: 'ufw', tags: 'ufw'}
|
||||
# - {role: 'ufw', tags: 'ufw'}
|
||||
- {role: 'docker', tags: 'docker'}
|
||||
- {role: 'repo', tags: ['repo', 'pull']}
|
||||
- {role: 'dnsmasq', tags: 'dnsmasq'}
|
||||
|
|
|
@ -15,6 +15,5 @@
|
|||
- {role: 'consul', tags: 'consul'}
|
||||
- {role: 'consul-client', tags: 'consul'}
|
||||
- {role: 'apns', tags: 'apns'}
|
||||
# - {role: 'netdata', tags: 'netdata'}
|
||||
- {role: 'node-exporter', tags: ['node-exporter', 'metrics']}
|
||||
- {role: 'celery_task', tags: 'celery'}
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
- name: newsblurnet
|
||||
aliases:
|
||||
- elasticsearch
|
||||
user: "{{ ansible_effective_user_id|int }}:{{ ansible_effective_group_id|int }}"
|
||||
volumes:
|
||||
- /srv/newsblur/docker/volumes/elasticsearch:/usr/share/elasticsearch/data
|
||||
- /var/log/elasticsearch/:/var/log/elasticsearch/
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
{
|
||||
"service": {
|
||||
{% if inventory_hostname in ["db-elasticsearch"] %}
|
||||
"name": "db-elasticsearch",
|
||||
{% else %}
|
||||
"name": "db-elasticsearch-staging",
|
||||
{% endif %}
|
||||
"tags": [
|
||||
"db"
|
||||
],
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
- /srv/newsblur/docker/postgres/postgres_hba-13.conf:/etc/postgresql/pg_hba.conf
|
||||
- /srv/newsblur/docker/postgres/postgres_ident-13.conf:/etc/postgresql/pg_ident.conf
|
||||
restart_policy: unless-stopped
|
||||
when: (inventory_hostname | regex_replace('[0-9]+', '')) in ['db-postgres-primary', 'db-postgres']
|
||||
when: (inventory_hostname | regex_replace('\-?[0-9]+', '')) in ['db-postgres-primary', 'db-postgres', 'hdb-postgres']
|
||||
|
||||
- name: Change ownership in postgres docker container
|
||||
become: yes
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
from flask import Flask, render_template, Response
|
||||
from newsblur_web import settings
|
||||
import sentry_sdk
|
||||
from sentry_sdk.integrations.flask import FlaskIntegration
|
||||
import redis
|
||||
import sentry_sdk
|
||||
from flask import Flask, Response, render_template
|
||||
from sentry_sdk.integrations.flask import FlaskIntegration
|
||||
|
||||
from newsblur_web import settings
|
||||
|
||||
if settings.FLASK_SENTRY_DSN is not None:
|
||||
sentry_sdk.init(
|
||||
|
@ -32,9 +33,9 @@ class RedisMetric(object):
|
|||
|
||||
def redis_servers_stats(self):
|
||||
for instance, redis_config in INSTANCES.items():
|
||||
if not settings.DOCKERBUILD and settings.SERVER_NAME != instance:
|
||||
if not settings.DOCKERBUILD and instance not in settings.SERVER_NAME:
|
||||
continue
|
||||
self.host = redis_config['host']
|
||||
self.host = f"{settings.SERVER_NAME}.node.nyc1.consul"
|
||||
self.port = redis_config.get('port', settings.REDIS_PORT)
|
||||
stats = self.get_info()
|
||||
yield instance, stats
|
||||
|
|
Loading…
Add table
Reference in a new issue