Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not use auto_expand_replicas #3580

Merged
merged 1 commit into from
Mar 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions roles/openshift_logging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ When both `openshift_logging_install_logging` and `openshift_logging_upgrade_log
- `openshift_logging_es_recover_after_time`: The amount of time ES will wait before it tries to recover. Defaults to '5m'.
- `openshift_logging_es_storage_group`: The storage group used for ES. Defaults to '65534'.
- `openshift_logging_es_nodeselector`: A map of labels (e.g. {"node":"infra","region":"west"} to select the nodes where the pod will land.
- `openshift_logging_es_number_of_shards`: The number of primary shards for every new index created in ES. Defaults to '1'.
- `openshift_logging_es_number_of_replicas`: The number of replica shards per primary shard for every new index. Defaults to '0'.

When `openshift_logging_use_ops` is `True`, there are some additional vars. These work the
same as above for their non-ops counterparts, but apply to the OPS cluster instance:
Expand All @@ -88,6 +90,8 @@ same as above for their non-ops counterparts, but apply to the OPS cluster insta
- `openshift_logging_es_ops_pvc_prefix`: logging-es-ops
- `openshift_logging_es_ops_recover_after_time`: 5m
- `openshift_logging_es_ops_storage_group`: 65534
- `openshift_logging_es_ops_number_of_shards`: The number of primary shards for every new index created in ES. Defaults to '1'.
- `openshift_logging_es_ops_number_of_replicas`: The number of replica shards per primary shard for every new index. Defaults to '0'.
- `openshift_logging_kibana_ops_hostname`: The Operations Kibana hostname. Defaults to 'kibana-ops.example.com'.
- `openshift_logging_kibana_ops_cpu_limit`: The amount of CPU to allocate to Kibana or unset if not specified.
- `openshift_logging_kibana_ops_memory_limit`: The amount of memory to allocate to Kibana or unset if not specified.
Expand Down
4 changes: 4 additions & 0 deletions roles/openshift_logging/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ openshift_logging_es_storage_group: "{{ openshift_hosted_logging_elasticsearch_s
openshift_logging_es_nodeselector: "{{ openshift_hosted_logging_elasticsearch_nodeselector | default('') | map_from_pairs }}"
# openshift_logging_es_config is a hash to be merged into the defaults for the elasticsearch.yaml
openshift_logging_es_config: {}
openshift_logging_es_number_of_shards: 1
openshift_logging_es_number_of_replicas: 0

# allow cluster-admin or cluster-reader to view operations index
openshift_logging_es_ops_allow_cluster_reader: False
Expand All @@ -111,6 +113,8 @@ openshift_logging_es_ops_pvc_prefix: "{{ openshift_hosted_logging_elasticsearch_
openshift_logging_es_ops_recover_after_time: 5m
openshift_logging_es_ops_storage_group: "{{ openshift_hosted_logging_elasticsearch_storage_group | default('65534') }}"
openshift_logging_es_ops_nodeselector: "{{ openshift_hosted_logging_elasticsearch_ops_nodeselector | default('') | map_from_pairs }}"
openshift_logging_es_ops_number_of_shards: 1
openshift_logging_es_ops_number_of_replicas: 0

# storage related defaults
openshift_logging_storage_access_modes: "{{ openshift_hosted_logging_storage_access_modes | default(['ReadWriteOnce']) }}"
Expand Down
4 changes: 4 additions & 0 deletions roles/openshift_logging/tasks/install_elasticsearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
deploy_name: "{{item.1}}"
es_node_selector: "{{openshift_logging_es_nodeselector | default({}) }}"
es_storage: "{{openshift_logging_facts|es_storage(deploy_name, pvc_claim)}}"
es_number_of_shards: "{{ openshift_logging_es_number_of_shards }}"
es_number_of_replicas: "{{ openshift_logging_es_number_of_replicas }}"
with_indexed_items:
- "{{ es_dc_pool }}"
check_mode: no
Expand Down Expand Up @@ -134,6 +136,8 @@
openshift_logging_es_recover_after_time: "{{openshift_logging_es_ops_recover_after_time}}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be openshift_logging_es_recover_after_time? Or should that be openshift_logging_es_ops_recover_after_time?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@portante It can make sense, I will look at this tomorrow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@portante I think it is correct.

There is {{openshift_logging_es_recover_after_time}} value set to ${RECOVER_AFTER_TIME} env variable in roles/openshift_logging/templates/es.j2 which is then used in elasticsearch.yml.j2 template.

//cc @ewolinetz (Erik see below please)

However, I do not understand why this value is set only for DeploymentConfig for Ops in tasks/install_elasticsearch.yaml script. Please compare vars sections for Ops vs vars section for Non-Ops.

Why the following four vars are set only for Ops DeploymentConfig?

  • es_node_quorum
  • es_recover_after_nodes
  • es_recover_expected_nodes
  • openshift_logging_es_recover_after_time

Apart from this if there is any issue with openshift_logging_es_recover_after_time usage and configuration then I suggest to address it in separated ticket/PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per my IRC comment, the difference is when running the 'ops' tasks, we update the variables to be the 'ops' variables. Technically, we should have written these tasks to run twice with a single set of tasks: once with non-ops and the other with ops. The four variables in question are found in the vars/main.yaml

es_node_selector: "{{openshift_logging_es_ops_nodeselector | default({}) }}"
es_storage: "{{openshift_logging_facts|es_storage(deploy_name, pvc_claim,root='elasticsearch_ops')}}"
es_number_of_shards: "{{ openshift_logging_es_ops_number_of_shards }}"
es_number_of_replicas: "{{ openshift_logging_es_ops_number_of_replicas }}"
with_indexed_items:
- "{{ es_ops_dc_pool | default([]) }}"
when:
Expand Down
5 changes: 2 additions & 3 deletions roles/openshift_logging/templates/elasticsearch.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ script:
indexed: on

index:
number_of_shards: 1
number_of_replicas: 0
auto_expand_replicas: 0-2
number_of_shards: {{ es_number_of_shards | default ('1') }}
number_of_replicas: {{ es_number_of_replicas | default ('0') }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not exactly sure why, but because of the way we use this template, the values have to be quoted. Please change this to be:

   number_of_shards: "{{ es_number_of_shards | default ('1') }}"
   number_of_replicas: "{{ es_number_of_replicas | default ('0') }}"

You'll have to submit a new PR since this one was merged.

Copy link
Contributor Author

@lukas-vlcek lukas-vlcek Mar 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @richm! I opened new PR #3763 and #3764

unassigned.node_left.delayed_timeout: 2m
translog:
flush_threshold_size: 256mb
Expand Down