mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Attempting to fix resolve issues.
This commit is contained in:
parent
b210868955
commit
a900a46b68
9 changed files with 55 additions and 58 deletions
|
@ -16,4 +16,4 @@
|
|||
- name: Reload gunicorn
|
||||
become: yes
|
||||
command: "docker kill --signal=HUP newsblur_web"
|
||||
when: pulled.changed
|
||||
# when: pulled.changed
|
||||
|
|
|
@ -4,5 +4,5 @@
|
|||
"enable_syslog": false,
|
||||
"start_join": ["{{ consul_manager_ip.stdout|trim }}"],
|
||||
"bind_addr": "{% raw %}{{ GetAllInterfaces | include \"name\" \"^eth\" | include \"flags\" \"forwardable|up\" | attr \"address\" }}{% endraw %}",
|
||||
"ui": true
|
||||
"ui_config": {"enabled": true}
|
||||
}
|
||||
|
|
|
@ -33,11 +33,19 @@
|
|||
network_mode: host # This exposes port 80
|
||||
restart_policy: unless-stopped
|
||||
container_default_behavior: no_defaults
|
||||
volumes:
|
||||
- /srv/newsblur:/srv/newsblur
|
||||
- /srv/newsblur/docker/haproxy/haproxy.consul.cfg:/usr/local/etc/haproxy/haproxy.cfg
|
||||
- /etc/letsencrypt/live/newsblur.com:/etc/letsencrypt/live/newsblur.com
|
||||
- /etc/letsencrypt/archive/newsblur.com:/etc/letsencrypt/archive/newsblur.com
|
||||
mounts:
|
||||
- source: /srv/newsblur
|
||||
target: /srv/newsblur
|
||||
type: bind
|
||||
- source: /srv/newsblur/docker/haproxy/haproxy.consul.cfg
|
||||
target: /usr/local/etc/haproxy/haproxy.cfg
|
||||
type: bind
|
||||
- source: /etc/letsencrypt/live/newsblur.com
|
||||
target: /etc/letsencrypt/live/newsblur.com
|
||||
type: bind
|
||||
- source: /etc/letsencrypt/archive/newsblur.com
|
||||
target: /etc/letsencrypt/archive/newsblur.com
|
||||
type: bind
|
||||
|
||||
- name: Reload HAProxy configuration
|
||||
debug:
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
template:
|
||||
src: consul_service.json
|
||||
dest: /etc/consul.d/mongo.json
|
||||
when: (inventory_hostname | regex_replace('[0-9]+', '')) == 'db-mongo'
|
||||
when: (inventory_hostname | regex_replace('[0-9]+', '')) == 'db-mongo' or inventory_hostname.startswith('db2')
|
||||
notify:
|
||||
- reload consul
|
||||
|
||||
|
@ -27,6 +27,6 @@
|
|||
template:
|
||||
src: consul_service.analytics.json
|
||||
dest: /etc/consul.d/mongo.json
|
||||
when: (inventory_hostname | regex_replace('[0-9]+', '')) == 'db-mongo-analytics'
|
||||
when: (inventory_hostname | regex_replace('[0-9]+', '')) == 'db-mongo-analytics' or inventory_hostname.startswith('db3')
|
||||
notify:
|
||||
- reload consul
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
{
|
||||
"service": {
|
||||
"name": "nginx",
|
||||
"name": "app-nginx",
|
||||
"id": "{{ inventory_hostname }}",
|
||||
"tags": [
|
||||
"web"
|
||||
],
|
||||
"port": 80
|
||||
"port": 80,
|
||||
"checks": [{
|
||||
"id": "{{inventory_hostname}}-nginx-ping",
|
||||
"http": "http://localhost:80/_nginxchk",
|
||||
"interval": "15s"
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
become: yes
|
||||
docker_container:
|
||||
name: redis
|
||||
image: redis:3.2.6
|
||||
image: redis:6.2.1
|
||||
state: started
|
||||
ports:
|
||||
- 6379:6379
|
||||
|
|
|
@ -5,6 +5,11 @@
|
|||
"tags": [
|
||||
"web"
|
||||
],
|
||||
"port": 8000
|
||||
"port": 8000,
|
||||
"checks": [{
|
||||
"id": "{{inventory_hostname}}-web-ping",
|
||||
"http": "http://localhost:8000/_haproxychk",
|
||||
"interval": "15s"
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ backend nginx
|
|||
balance roundrobin
|
||||
option httpchk GET /_nginxchk
|
||||
http-check expect rstatus 200|503
|
||||
server-template nginx 5 _nginx._tcp.service.nyc1.consul:80 check inter 3000ms resolvers consul resolve-opts allow-dup-ip
|
||||
server-template app-nginx 5 _app-nginx._tcp.service.nyc1.consul:80 check inter 3000ms resolvers consul resolve-opts allow-dup-ip
|
||||
|
||||
backend app_django
|
||||
balance roundrobin
|
||||
|
@ -127,32 +127,40 @@ backend node_page
|
|||
server-template node-page 1 _node-page._tcp.service.nyc1.consul:3060 check inter 3000ms resolvers consul resolve-opts allow-dup-ip
|
||||
|
||||
backend postgres
|
||||
option httpchk GET http://monitor.service.nyc1.consul:5000/db_check/postgres
|
||||
server-template postgresql 1 _db-postgres._tcp.service.nyc1.consul:5432 check inter 30000ms resolvers consul resolve-opts allow-dup-ip init-addr none
|
||||
option httpchk GET /db_check/postgres
|
||||
server db-postgres db-postgres.node.nyc1.consul:5579 check inter 30000ms resolvers consul resolve-opts allow-dup-ip init-addr none
|
||||
|
||||
backend mongo
|
||||
option httpchk GET http://monitor.service.nyc1.consul:5000/db_check/mongo
|
||||
server-template mongo 4 _db-mongo._tcp.service.nyc1.consul:27017 check inter 2000ms resolvers consul resolve-opts allow-dup-ip init-addr none
|
||||
option httpchk GET /db_check/mongo
|
||||
server-template db-mongo 6 _db-mongo._tcp.service.nyc1.consul:5579 check inter 2000ms resolvers consul resolve-prefer ipv4 resolve-opts allow-dup-ip init-addr none
|
||||
|
||||
backend mongo5000
|
||||
option httpchk GET /db_check/mongo
|
||||
server-template mongo-db2x 6 _db-mongo._tcp.service.nyc1.consul:5000 check inter 2000ms resolvers consul resolve-prefer ipv4 resolve-opts allow-dup-ip init-addr none
|
||||
|
||||
backend mongo_analytics
|
||||
option httpchk GET /db_check/mongo
|
||||
server db-mongo-analytics db-mongo-analytics.node.nyc1.consul:5579 check inter 2000ms resolvers consul resolve-opts allow-dup-ip init-addr none
|
||||
|
||||
backend db_redis_user
|
||||
option httpchk GET http://monitor.service.nyc1.consul:5000/db_check/redis
|
||||
server-template db-redis-user 1 _db-redis-user._tcp.service.nyc1.consul:6379 check inter 2000ms resolvers consul resolve-opts allow-dup-ip init-addr none
|
||||
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
|
||||
|
||||
backend db_redis_story
|
||||
option httpchk GET http://monitor.service.nyc1.consul:5000/db_check/redis_story
|
||||
server-template db-redis-story 1 _db-redis-story._tcp.service.nyc1.consul:6379 check inter 2000ms resolvers consul resolve-opts allow-dup-ip init-addr none
|
||||
option httpchk GET /db_check/redis_story
|
||||
server db-redis-story db-redis-story.node.nyc1.consul:5579 check inter 2000ms resolvers consul resolve-opts allow-dup-ip init-addr none
|
||||
|
||||
backend db_redis_sessions
|
||||
option httpchk GET http://monitor.service.nyc1.consul:5000/db_check/redis_sessions
|
||||
server-template db-redis-sessions 1 _db-redis-sessions._tcp.service.nyc1.consul:6379 check inter 2000ms resolvers consul resolve-opts allow-dup-ip init-addr none
|
||||
option httpchk GET /db_check/redis_sessions
|
||||
server db-redis-sessions db-redis-sessions.node.nyc1.consul:5579 check inter 2000ms resolvers consul resolve-opts allow-dup-ip init-addr none
|
||||
|
||||
backend db_redis_pubsub
|
||||
option httpchk GET http://monitor.service.nyc1.consul:5000/db_check/redis_pubsub
|
||||
server-template db-redis-pubsub 1 _db-redis-pubsub._tcp.service.nyc1.consul:6379 check inter 2000ms resolvers consul resolve-opts allow-dup-ip init-addr none
|
||||
option httpchk GET /db_check/redis_pubsub
|
||||
server db-redis-pubsub db-redis-pubsub.node.nyc1.consul:5579 check inter 2000ms resolvers consul resolve-opts allow-dup-ip init-addr none
|
||||
|
||||
backend db_elasticsearch
|
||||
option httpchk GET http://monitor.service.nyc1.consul:5000/db_check/elasticsearch
|
||||
server-template elasticsearch 1 _db-elasticsearch._tcp.service.nyc1.consul:9300 check inter 2000ms resolvers consul resolve-opts allow-dup-ip init-addr none
|
||||
option httpchk GET /db_check/elasticsearch
|
||||
server elasticsearch db-elasticsearch.node.nyc1.consul:5579 check inter 2000ms resolvers consul resolve-opts allow-dup-ip init-addr none
|
||||
|
||||
backend maintenance
|
||||
option httpchk HEAD /maintenance
|
||||
|
|
|
@ -1,13 +1,3 @@
|
|||
upstream app_server {
|
||||
server app-django.service.nyc1.consul:8000 fail_timeout=10 max_fails=3 ;
|
||||
}
|
||||
|
||||
upstream icon_server {
|
||||
# this is node favicons
|
||||
server node-favicons.service.nyc1.consul:3030 fail_timeout=2 max_fails=3;
|
||||
server app-django.service.nyc1.consul:8000 backup;
|
||||
}
|
||||
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
|
@ -115,24 +105,4 @@ server {
|
|||
include fastcgi_params;
|
||||
}
|
||||
|
||||
location ^~ /rss_feeds/icon/ {
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_redirect off;
|
||||
|
||||
proxy_pass http://icon_server;
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_redirect off;
|
||||
|
||||
if (!-f $request_filename) {
|
||||
proxy_pass http://app_server;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue