mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-31 21:41:33 +00:00
Mongo analytics is its own server, with authentication.
This commit is contained in:
parent
bc69e859eb
commit
4a81611b01
5 changed files with 16 additions and 16 deletions
|
@ -29,7 +29,7 @@ groups:
|
||||||
elasticsearch: inventory_hostname.startswith('db-elasticsearch')
|
elasticsearch: inventory_hostname.startswith('db-elasticsearch')
|
||||||
redis: inventory_hostname.startswith('db-redis')
|
redis: inventory_hostname.startswith('db-redis')
|
||||||
postgres: inventory_hostname.startswith('db-postgres')
|
postgres: inventory_hostname.startswith('db-postgres')
|
||||||
mongo: inventory_hostname.startswith('db-mongo')
|
mongo: inventory_hostname.startswith('db-mongo') and not inventory_hostname.startswith('db-mongo-analytics')
|
||||||
mongo_analytics: inventory_hostname.startswith('db-mongo-analytics')
|
mongo_analytics: inventory_hostname.startswith('db-mongo-analytics')
|
||||||
consul: inventory_hostname.startswith('db-consul')
|
consul: inventory_hostname.startswith('db-consul')
|
||||||
metrics: inventory_hostname.startswith('db-metrics')
|
metrics: inventory_hostname.startswith('db-metrics')
|
||||||
|
|
|
@ -91,14 +91,14 @@
|
||||||
hostname: "{{ inventory_hostname }}"
|
hostname: "{{ inventory_hostname }}"
|
||||||
restart_policy: unless-stopped
|
restart_policy: unless-stopped
|
||||||
networks_cli_compatible: yes
|
networks_cli_compatible: yes
|
||||||
network_mode: host
|
# network_mode: host
|
||||||
# network_mode: default
|
network_mode: default
|
||||||
# networks:
|
networks:
|
||||||
# - name: newsblurnet
|
- name: newsblurnet
|
||||||
# aliases:
|
aliases:
|
||||||
# - mongo
|
- mongo
|
||||||
# ports:
|
ports:
|
||||||
# - "27017:27017"
|
- "27017:27017"
|
||||||
command: --config /etc/mongod.conf
|
command: --config /etc/mongod.conf
|
||||||
volumes:
|
volumes:
|
||||||
- /mnt/{{ inventory_hostname | regex_replace('db-|-', '') }}:/data/db
|
- /mnt/{{ inventory_hostname | regex_replace('db-|-', '') }}:/data/db
|
||||||
|
|
|
@ -27,9 +27,9 @@ net:
|
||||||
processManagement:
|
processManagement:
|
||||||
timeZoneInfo: /usr/share/zoneinfo
|
timeZoneInfo: /usr/share/zoneinfo
|
||||||
|
|
||||||
# security:
|
security:
|
||||||
# keyFile: /srv/newsblur/config/mongodb_keyfile.key
|
keyFile: /srv/newsblur/config/mongodb_keyfile.key
|
||||||
# authorization: enabled
|
authorization: enabled
|
||||||
# transitionToAuth: true
|
# transitionToAuth: true
|
||||||
|
|
||||||
operationProfiling:
|
operationProfiling:
|
||||||
|
|
|
@ -172,14 +172,14 @@ backend mongo
|
||||||
{% for host in groups.mongo %}
|
{% for host in groups.mongo %}
|
||||||
server {{host}} {{host}}.node.nyc1.consul:5579
|
server {{host}} {{host}}.node.nyc1.consul:5579
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{#
|
|
||||||
backend mongo_analytics
|
backend mongo_analytics
|
||||||
option httpchk GET /db_check/mongo
|
option httpchk GET /db_check/mongo_analytics
|
||||||
default-server check inter 2000ms resolvers consul resolve-prefer ipv4 resolve-opts allow-dup-ip init-addr none
|
default-server check inter 2000ms resolvers consul resolve-prefer ipv4 resolve-opts allow-dup-ip init-addr none
|
||||||
{% for host in groups.mongo_analytics %}
|
{% for host in groups.mongo_analytics %}
|
||||||
server {{host}} {{host}}.node.nyc1.consul:5579
|
server {{host}} {{host}}.node.nyc1.consul:5579
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
#}
|
|
||||||
backend db_redis_user
|
backend db_redis_user
|
||||||
option httpchk GET /db_check/redis
|
option httpchk GET /db_check/redis
|
||||||
server db-redis-user db-redis-user.node.nyc1.consul:5579 check inter 2000ms resolvers consul resolve-opts allow-dup-ip init-addr none
|
server db-redis-user db-redis-user.node.nyc1.consul:5579 check inter 2000ms resolvers consul resolve-opts allow-dup-ip init-addr none
|
||||||
|
|
|
@ -109,7 +109,7 @@ def db_check_mongo():
|
||||||
@app.route("/db_check/mongo_analytics")
|
@app.route("/db_check/mongo_analytics")
|
||||||
def db_check_mongo_analytics():
|
def db_check_mongo_analytics():
|
||||||
try:
|
try:
|
||||||
client = pymongo.MongoClient(f"mongodb://{settings.MONGO_DB['username']}:{settings.MONGO_DB['password']}@{settings.SERVER_NAME}/?authSource=admin")
|
client = pymongo.MongoClient(f"mongodb://{settings.MONGO_ANALYTICS_DB['username']}:{settings.MONGO_ANALYTICS_DB['password']}@{settings.SERVER_NAME}/?authSource=admin")
|
||||||
db = client.nbanalytics
|
db = client.nbanalytics
|
||||||
except:
|
except:
|
||||||
abort(503)
|
abort(503)
|
||||||
|
|
Loading…
Add table
Reference in a new issue