Skip to content
Snippets Groups Projects
Commit 29bb06db authored by Sergey Yakubov's avatar Sergey Yakubov
Browse files

all discovery via nginx

parent 4eda445b
No related branches found
No related tags found
No related merge requests found
{ {
"BrokerDbAddress":"mongo.service.asapo:27017", "BrokerDbAddress":"localhost:8400/mongo",
"MonitorDbAddress":"influxdb.service.asapo:8086", "MonitorDbAddress":"localhost:8400/influxdb",
"MonitorDbName": "asapo_brokers", "MonitorDbName": "asapo_brokers",
"port":{{ env "NOMAD_PORT_broker" }}, "port":{{ env "NOMAD_PORT_broker" }},
"LogLevel":"info", "LogLevel":"info",
......
...@@ -35,8 +35,7 @@ ...@@ -35,8 +35,7 @@
@type copy @type copy
<store> <store>
@type elasticsearch @type elasticsearch
host elasticsearch.service.asapo hosts localhost:8400/elasticsearch
port 9200
flush_interval 5s flush_interval 5s
logstash_format true logstash_format true
time_key_format %Y-%m-%dT%H:%M:%S.%N time_key_format %Y-%m-%dT%H:%M:%S.%N
......
elasticsearch: elasticsearch:
url: "http://elasticsearch.service.asapo:9200" url: "http://localhost:8400/elasticsearch"
server: server:
basePath: "/logsview" basePath: "/logsview"
rewriteBasePath: true rewriteBasePath: true
......
...@@ -18,10 +18,28 @@ http { ...@@ -18,10 +18,28 @@ http {
server { server {
listen {{ env "NOMAD_PORT_nginx" }}; listen {{ env "NOMAD_PORT_nginx" }};
set $discovery_endpoint asapo-discovery.service.asapo; set $discovery_endpoint asapo-discovery.service.asapo;
# set $authorizer_endpoint asapo-authorizer.service.asapo; set $authorizer_endpoint asapo-authorizer.service.asapo;
set $fluentd_endpoint fluentd.service.asapo; set $fluentd_endpoint fluentd.service.asapo;
set $kibana_endpoint kibana.service.asapo; set $kibana_endpoint kibana.service.asapo;
set $grafana_endpoint grafana.service.asapo; set $grafana_endpoint grafana.service.asapo;
set $mongo_endpoint mongo.service.asapo;
set $influxdb_endpoint influxdb.service.asapo;
set $elasticsearch_endpoint elasticsearch.service.asapo;
location /mongo/ {
rewrite ^/mongo(/.*) $1 break;
proxy_pass http://$mongo_endpoint:27017$uri$is_args$args;
}
location /influxdb/ {
rewrite ^/influxdb(/.*) $1 break;
proxy_pass http://$influxdb_endpoint:8086$uri$is_args$args;
}
location /elasticsearch/ {
rewrite ^/elasticsearch(/.*) $1 break;
proxy_pass http://$elasticsearch_endpoint:9200$uri$is_args$args;
}
location /discovery/ { location /discovery/ {
rewrite ^/discovery(/.*) $1 break; rewrite ^/discovery(/.*) $1 break;
...@@ -45,10 +63,10 @@ http { ...@@ -45,10 +63,10 @@ http {
proxy_pass http://$grafana_endpoint:3000$uri$is_args$args; proxy_pass http://$grafana_endpoint:3000$uri$is_args$args;
} }
# location /authorizer/ { location /authorizer/ {
# rewrite ^/authorizer(/.*) $1 break; rewrite ^/authorizer(/.*) $1 break;
# proxy_pass http://$authorizer_endpoint:5007$uri$is_args$args; proxy_pass http://$authorizer_endpoint:5007$uri$is_args$args;
# } }
location /nginx-health { location /nginx-health {
return 200 "healthy\n"; return 200 "healthy\n";
......
{ {
"MonitorDbAddress":"influxdb.service.asapo:8086", "MonitorDbAddress":"localhost:8400/influxdb",
"MonitorDbName": "asapo_receivers", "MonitorDbName": "asapo_receivers",
"BrokerDbAddress":"mongo.service.asapo:27017", "BrokerDbAddress":"localhost:8400/mongo",
"AuthorizationServer": "asapo-authorizer.service.asapo:5007", "AuthorizationServer": "localhost:8400/authorizer",
"AuthorizationInterval": 10000, "AuthorizationInterval": 10000,
"ListenPort": {{ env "NOMAD_PORT_recv" }}, "ListenPort": {{ env "NOMAD_PORT_recv" }},
"DataServer": { "DataServer": {
......
...@@ -7,11 +7,11 @@ trap Cleanup EXIT ...@@ -7,11 +7,11 @@ trap Cleanup EXIT
Cleanup() { Cleanup() {
echo cleanup echo cleanup
kill -9 $authorizeid kill -9 $authorizeid
sleep 1
} }
$@ -config settings.json & $@ -config settings.json &
sleep 1
sleep 0.3
authorizeid=`echo $!` authorizeid=`echo $!`
curl -v --silent --data '{"SourceCredentials":"c20180508-000-COM20181%stream%","OriginHost":"127.0.0.1:5555"}' 127.0.0.1:5007/authorize --stderr - | tee /dev/stderr | grep c20180508-000-COM20181 curl -v --silent --data '{"SourceCredentials":"c20180508-000-COM20181%stream%","OriginHost":"127.0.0.1:5555"}' 127.0.0.1:5007/authorize --stderr - | tee /dev/stderr | grep c20180508-000-COM20181
......
worker_processes 1; worker_processes 1;
daemon off;
events { events {
worker_connections 1024; worker_connections 1024;
...@@ -17,26 +16,61 @@ http { ...@@ -17,26 +16,61 @@ http {
resolver 127.0.0.1:8600 valid=1s; resolver 127.0.0.1:8600 valid=1s;
server { server {
listen {{ env "NOMAD_PORT_nginx" }}; listen {{ env "NOMAD_PORT_nginx" }};
set $discovery_endpoint discovery.service.asapo; set $discovery_endpoint discovery.service.asapo;
set $authorizer_endpoint authorizer.service.asapo; set $authorizer_endpoint authorizer.service.asapo;
# set $fluentd_endpoint localhost; set $fluentd_endpoint fluentd.service.asapo;
set $kibana_endpoint kibana.service.asapo;
set $grafana_endpoint grafana.service.asapo;
set $mongo_endpoint mongo.service.asapo;
set $influxdb_endpoint influxdb.service.asapo;
set $elasticsearch_endpoint elasticsearch.service.asapo;
location /mongo/ {
rewrite ^/mongo(/.*) $1 break;
proxy_pass http://$mongo_endpoint:27017$uri$is_args$args;
}
location /influxdb/ {
rewrite ^/influxdb(/.*) $1 break;
proxy_pass http://$influxdb_endpoint:8086$uri$is_args$args;
}
location /elasticsearch/ {
rewrite ^/elasticsearch(/.*) $1 break;
proxy_pass http://$elasticsearch_endpoint:9200$uri$is_args$args;
}
location /discovery/ { location /discovery/ {
rewrite ^/discovery(/.*) $1 break; rewrite ^/discovery(/.*) $1 break;
proxy_pass http://$discovery_endpoint:5006$uri; proxy_pass http://$discovery_endpoint:5006$uri$is_args$args;
} }
location /logs/ { location /logs/ {
# rewrite ^/logs(/.*) $1 break; rewrite ^/logs(/.*) $1 break;
proxy_pass http://localhost:9880/asapo; proxy_pass http://$fluentd_endpoint:9880$uri$is_args$args;
}
location /logsview/ {
proxy_pass http://$kibana_endpoint:5601$uri$is_args$args;
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;
} }
location /authorizer/ {
rewrite ^/authorizer(/.*) $1 break;
proxy_pass http://$authorizer_endpoint:5007$uri;
}
location /performance/ {
rewrite ^/performance(/.*) $1 break;
proxy_pass http://$grafana_endpoint:3000$uri$is_args$args;
}
location /nginx-health { location /authorizer/ {
return 200 "healthy\n"; rewrite ^/authorizer(/.*) $1 break;
} proxy_pass http://$authorizer_endpoint:5007$uri$is_args$args;
}
location /nginx-health {
return 200 "healthy\n";
}
} }
} }
...@@ -6,7 +6,7 @@ job "authorizer" { ...@@ -6,7 +6,7 @@ job "authorizer" {
group "group" { group "group" {
count = 1 count = 1
task "authorizer" { task "asapo-authorizer" {
driver = "raw_exec" driver = "raw_exec"
config { config {
......
worker_processes 1; worker_processes 1;
daemon off;
events { events {
worker_connections 1024; worker_connections 1024;
...@@ -17,26 +16,76 @@ http { ...@@ -17,26 +16,76 @@ http {
resolver 127.0.0.1:8600 valid=1s; resolver 127.0.0.1:8600 valid=1s;
server { server {
listen {{ env "NOMAD_PORT_nginx" }}; listen {{ env "NOMAD_PORT_nginx" }};
set $discovery_endpoint discovery.service.asapo; set $discovery_endpoint discovery.service.asapo;
set $authorizer_endpoint authorizer.service.asapo; set $authorizer_endpoint authorizer.service.asapo;
# set $fluentd_endpoint localhost; set $fluentd_endpoint fluentd.service.asapo;
set $kibana_endpoint kibana.service.asapo;
set $grafana_endpoint grafana.service.asapo;
set $mongo_endpoint mongo.service.asapo;
set $influxdb_endpoint influxdb.service.asapo;
set $elasticsearch_endpoint elasticsearch.service.asapo;
location /mongo/ {
rewrite ^/mongo(/.*) $1 break;
proxy_pass http://$mongo_endpoint:27017$uri$is_args$args;
}
location /influxdb/ {
rewrite ^/influxdb(/.*) $1 break;
proxy_pass http://$influxdb_endpoint:8086$uri$is_args$args;
}
location /elasticsearch/ {
rewrite ^/elasticsearch(/.*) $1 break;
proxy_pass http://$elasticsearch_endpoint:9200$uri$is_args$args;
}
location /discovery/ { location /discovery/ {
rewrite ^/discovery(/.*) $1 break; rewrite ^/discovery(/.*) $1 break;
proxy_pass http://$discovery_endpoint:5006$uri; proxy_pass http://$discovery_endpoint:5006$uri$is_args$args;
} }
location /logs/ { location /logs/ {
# rewrite ^/logs(/.*) $1 break; rewrite ^/logs(/.*) $1 break;
proxy_pass http://localhost:9880/asapo; proxy_pass http://$fluentd_endpoint:9880$uri$is_args$args;
}
location /logsview/ {
proxy_pass http://$kibana_endpoint:5601$uri$is_args$args;
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;
}
location /performance/ {
rewrite ^/performance(/.*) $1 break;
proxy_pass http://$grafana_endpoint:3000$uri$is_args$args;
} }
location /authorizer/ {
rewrite ^/authorizer(/.*) $1 break;
proxy_pass http://$authorizer_endpoint:5007$uri;
}
location /authorizer/ {
rewrite ^/authorizer(/.*) $1 break;
proxy_pass http://$authorizer_endpoint:5007$uri$is_args$args;
}
location /nginx-health {
return 200 "healthy\n";
}
}
}
stream {
resolver 127.0.0.1:8600 valid=1s;
location /nginx-health { map $remote_addr $upstream {
return 200 "healthy\n"; default fluentd.service.asapo;
} }
server {
listen 9881;
proxy_pass $upstream:24224;
} }
} }
worker_processes 1; worker_processes 1;
daemon off;
events { events {
worker_connections 1024; worker_connections 1024;
...@@ -17,26 +16,76 @@ http { ...@@ -17,26 +16,76 @@ http {
resolver 127.0.0.1:8600 valid=1s; resolver 127.0.0.1:8600 valid=1s;
server { server {
listen {{ env "NOMAD_PORT_nginx" }}; listen {{ env "NOMAD_PORT_nginx" }};
set $discovery_endpoint discovery.service.asapo; set $discovery_endpoint discovery.service.asapo;
set $authorizer_endpoint authorizer.service.asapo; set $authorizer_endpoint authorizer.service.asapo;
# set $fluentd_endpoint localhost; set $fluentd_endpoint fluentd.service.asapo;
set $kibana_endpoint kibana.service.asapo;
set $grafana_endpoint grafana.service.asapo;
set $mongo_endpoint mongo.service.asapo;
set $influxdb_endpoint influxdb.service.asapo;
set $elasticsearch_endpoint elasticsearch.service.asapo;
location /mongo/ {
rewrite ^/mongo(/.*) $1 break;
proxy_pass http://$mongo_endpoint:27017$uri$is_args$args;
}
location /influxdb/ {
rewrite ^/influxdb(/.*) $1 break;
proxy_pass http://$influxdb_endpoint:8086$uri$is_args$args;
}
location /elasticsearch/ {
rewrite ^/elasticsearch(/.*) $1 break;
proxy_pass http://$elasticsearch_endpoint:9200$uri$is_args$args;
}
location /discovery/ { location /discovery/ {
rewrite ^/discovery(/.*) $1 break; rewrite ^/discovery(/.*) $1 break;
proxy_pass http://$discovery_endpoint:5006$uri; proxy_pass http://$discovery_endpoint:5006$uri$is_args$args;
} }
location /logs/ { location /logs/ {
# rewrite ^/logs(/.*) $1 break; rewrite ^/logs(/.*) $1 break;
proxy_pass http://localhost:9880/asapo; proxy_pass http://$fluentd_endpoint:9880$uri$is_args$args;
}
location /logsview/ {
proxy_pass http://$kibana_endpoint:5601$uri$is_args$args;
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;
}
location /performance/ {
rewrite ^/performance(/.*) $1 break;
proxy_pass http://$grafana_endpoint:3000$uri$is_args$args;
} }
location /authorizer/ {
rewrite ^/authorizer(/.*) $1 break;
proxy_pass http://$authorizer_endpoint:5007$uri;
}
location /authorizer/ {
rewrite ^/authorizer(/.*) $1 break;
proxy_pass http://$authorizer_endpoint:5007$uri$is_args$args;
}
location /nginx-health {
return 200 "healthy\n";
}
}
}
stream {
resolver 127.0.0.1:8600 valid=1s;
location /nginx-health { map $remote_addr $upstream {
return 200 "healthy\n"; default fluentd.service.asapo;
} }
server {
listen 9881;
proxy_pass $upstream:24224;
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment