Ports configuration refactoring

Ports configuration has been changed:

before:

  port: 123:3333

after:

  port:
    cont: 123
    node: 3333

Change-Id: I76642c407fd4ca00f711212b916f8cc4fbc285e2
Depends-On: I54ab8dd02fc88b821a1f0d05c08f98b618730150
This commit is contained in:
Andrey Pavlov 2016-10-19 18:21:23 +00:00
parent 50b30be50c
commit 5d9cbfb7c7
9 changed files with 24 additions and 18 deletions

View File

@ -4,7 +4,7 @@
client: client:
hosts: hosts:
- localhost - localhost
port: {{ elasticsearch.port }} port: {{ elasticsearch.port.cont }}
url_prefix: url_prefix:
use_ssl: False use_ssl: False
certificate: certificate:

View File

@ -1,24 +1,30 @@
configs: configs:
elasticsearch: elasticsearch:
port: 9200 port:
cluster_port: 9300 cont: 9200
cluster_port:
cont: 9300
retention_period: 30 retention_period: 30
kibana: kibana:
port: 5601 port:
cont: 5601
heka: heka:
max_procs: 2 max_procs: 2
service_pattern: "^k8s_(.-)%..*" service_pattern: "^k8s_(.-)%..*"
hindsight_heka_tcp_port: 5565 hindsight_heka_tcp_port:
cont: 5565
grafana: grafana:
host: "grafana" host: "grafana"
port: 3000 port:
cont: 3000
user: "admin" user: "admin"
password: "admin" password: "admin"
influxdb: influxdb:
database: "ccp" database: "ccp"
host: "influxdb" host: "influxdb"
password: "" password: ""
port: 8086 port:
cont: 8086
user: "" user: ""
snap: snap:
log_level: 3 log_level: 3

View File

@ -1,20 +1,20 @@
#!/bin/bash #!/bin/bash
echo "Waiting for Grafana to come up..." echo "Waiting for Grafana to come up..."
until $(curl --fail --output /dev/null --silent http://{{ grafana.user }}:{{ grafana.password }}@localhost:{{ grafana.port }}/api/org); do until $(curl --fail --output /dev/null --silent http://{{ grafana.user }}:{{ grafana.password }}@localhost:{{ grafana.port.cont }}/api/org); do
printf "." printf "."
sleep 2 sleep 2
done done
echo -e "Grafana is up and running.\n" echo -e "Grafana is up and running.\n"
echo "Creating InfluxDB datasource..." echo "Creating InfluxDB datasource..."
curl -i -XPOST -H "Accept: application/json" -H "Content-Type: application/json" "http://{{ grafana.user }}:{{ grafana.password }}@localhost:{{ grafana.port }}/api/datasources" -d ' curl -i -XPOST -H "Accept: application/json" -H "Content-Type: application/json" "http://{{ grafana.user }}:{{ grafana.password }}@localhost:{{ grafana.port.cont }}/api/datasources" -d '
{ {
"name": "CCP InfluxDB", "name": "CCP InfluxDB",
"type": "influxdb", "type": "influxdb",
"access": "proxy", "access": "proxy",
"isDefault": true, "isDefault": true,
"url": "'"http://{{ influxdb.host }}:{{ influxdb.port }}"'", "url": "'"http://{{ influxdb.host }}:{{ influxdb.port.cont }}"'",
"password": "'"{{ influxdb.password }}"'", "password": "'"{{ influxdb.password }}"'",
"user": "'"{{ influxdb.user }}"'", "user": "'"{{ influxdb.user }}"'",
"database": "'"{{ influxdb.database }}"'" "database": "'"{{ influxdb.database }}"'"
@ -28,7 +28,7 @@ echo -e "InfluxDB datasource was successfully created.\n"
echo "Importing default dashboards..." echo "Importing default dashboards..."
for dashboard in /dashboards/*.json; do for dashboard in /dashboards/*.json; do
echo -e "\tImporting ${dashboard}..." echo -e "\tImporting ${dashboard}..."
curl -i -XPOST --data "@${dashboard}" -H "Accept: application/json" -H "Content-Type: application/json" "http://{{ grafana.user }}:{{ grafana.password}}@localhost:{{ grafana.port }}/api/dashboards/db" curl -i -XPOST --data "@${dashboard}" -H "Accept: application/json" -H "Content-Type: application/json" "http://{{ grafana.user }}:{{ grafana.password}}@localhost:{{ grafana.port.cont }}/api/dashboards/db"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Error importing ${dashboard}" echo "Error importing ${dashboard}"
exit 1 exit 1

View File

@ -6,7 +6,7 @@ fields = ["Timestamp", "Type", "Logger", "Severity", "Payload", "Pid", "Hostname
[elasticsearch_output] [elasticsearch_output]
type = "ElasticSearchOutput" type = "ElasticSearchOutput"
server = "http://elasticsearch:{{ elasticsearch.port }}" server = "http://elasticsearch:{{ elasticsearch.port.cont }}"
message_matcher = "Type == 'log'" message_matcher = "Type == 'log'"
encoder = "elasticsearch_json_encoder" encoder = "elasticsearch_json_encoder"
use_buffering = true use_buffering = true

View File

@ -1,6 +1,6 @@
filename = "heka_tcp.lua" filename = "heka_tcp.lua"
address = "localhost" address = "localhost"
port = {{ hindsight_heka_tcp_port }} port = {{ hindsight_heka_tcp_port.cont }}
-- the heka_tcp plugin is a "Continuous" plugin, so instruction_limit -- the heka_tcp plugin is a "Continuous" plugin, so instruction_limit
-- must be set to zero -- must be set to zero
instruction_limit = 0 instruction_limit = 0

View File

@ -1,6 +1,6 @@
filename = "influxdb_tcp.lua" filename = "influxdb_tcp.lua"
host = "influxdb" host = "influxdb"
port = {{ influxdb.port }} port = {{ influxdb.port.cont }}
database = "{{ influxdb.database }}" database = "{{ influxdb.database }}"
batch_max_lines = 3000 batch_max_lines = 3000
message_matcher = "TRUE" message_matcher = "TRUE"

View File

@ -13,5 +13,5 @@ reporting-disabled = true
[http] [http]
auth-enabled = false # FIXME(elemoine) auth-enabled = false # FIXME(elemoine)
bind-address = "{{ network_topology["private"]["address"] }}:{{ influxdb.port }}" bind-address = "{{ network_topology["private"]["address"] }}:{{ influxdb.port.cont }}"
log-enabled = false log-enabled = false

View File

@ -1,11 +1,11 @@
# Kibana is served by a back end server. This controls which port to use. # Kibana is served by a back end server. This controls which port to use.
port: {{ kibana.port }} port: {{ kibana.port.cont }}
# The host to bind the server to. # The host to bind the server to.
host: "{{ network_topology["private"]["address"] }}" host: "{{ network_topology["private"]["address"] }}"
# The Elasticsearch instance to use for all your queries. # The Elasticsearch instance to use for all your queries.
elasticsearch_url: "http://elasticsearch:{{ elasticsearch.port }}" elasticsearch_url: "http://elasticsearch:{{ elasticsearch.port.cont }}"
# preserve_elasticsearch_host true will send the hostname specified in `elasticsearch`. If you set it to false, # preserve_elasticsearch_host true will send the hostname specified in `elasticsearch`. If you set it to false,
# then the host you use to connect to *this* Kibana instance will be sent. # then the host you use to connect to *this* Kibana instance will be sent.

View File

@ -100,7 +100,7 @@
"plugin_name": "heka", "plugin_name": "heka",
"config": { "config": {
"host": "localhost", "host": "localhost",
"port": {{ hindsight_heka_tcp_port }} "port": {{ hindsight_heka_tcp_port.cont }}
} }
}] }]
} }