Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
configuration
Commits
a2e41c15
Commit
a2e41c15
authored
Feb 04, 2014
by
e0d
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #738 from edx/e0d/es-cluster
E0d/es cluster
parents
add10296
545d3ebf
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
153 additions
and
17 deletions
+153
-17
playbooks/edx-east/elasticsearch.yml
+10
-0
playbooks/roles/elasticsearch/defaults/main.yml
+14
-3
playbooks/roles/elasticsearch/tasks/main.yml
+47
-14
playbooks/roles/elasticsearch/templates/edx/etc/elasticsearch/elasticsearch.yml.j2
+41
-0
playbooks/roles/elasticsearch/templates/etc/default/elasticsearch.j2
+41
-0
No files found.
playbooks/edx-east/elasticsearch.yml
0 → 100644
View file @
a2e41c15
-
hosts
:
tag_play_elasticsearch:&tag_environment_stage:&tag_deployment_edx
sudo
:
True
vars_files
:
-
"
{{
secure_dir
}}/vars/common/common.yml"
-
"
{{
secure_dir
}}/vars/stage/stage-edx.yml"
roles
:
-
common
-
gh_users
-
oraclejdk
-
elasticsearch
playbooks/roles/elasticsearch/defaults/main.yml
View file @
a2e41c15
---
---
elasticsearch_app_dir
:
"
{{
COMMON_APP_DIR
}}/elasticsearch"
elasticsearch_version
:
"
0.90.2"
elasticsearch_data_dir
:
"
{{
COMMON_DATA_DIR
}}/elasticsearch"
elasticsearch_sha
:
"
397227ce37f616734f39f6e93539c9eaa82bec9"
elasticsearch_log_dir
:
"
{{
COMMON_LOG_DIR
}}/elasticsearch"
elasticsearch_cfg_dir
:
"
{{
COMMON_CFG_DIR
}}/elasticsearch"
elasticsearch_version
:
"
0.90.11"
elasticsearch_sha
:
"
8e81388d0ba7e427b42514d96e25ba6499024c24"
elasticsearch_file
:
"
elasticsearch-{{
elasticsearch_version
}}.deb"
elasticsearch_file
:
"
elasticsearch-{{
elasticsearch_version
}}.deb"
elasticsearch_url
:
"
https://download.elasticsearch.org/elasticsearch/elasticsearch/{{
elasticsearch_file
}}"
elasticsearch_url
:
"
https://download.elasticsearch.org/elasticsearch/elasticsearch/{{
elasticsearch_file
}}"
elasticsearch_user
:
"
elasticsearch"
elasticsearch_group
:
"
elasticsearch"
#
# Defaults for a single server installation.
ELASTICSEARCH_CLUSTERED
:
true
ELASTICSEARCH_HEAP_SIZE
:
"
512m"
\ No newline at end of file
playbooks/roles/elasticsearch/tasks/main.yml
View file @
a2e41c15
...
@@ -8,29 +8,61 @@
...
@@ -8,29 +8,61 @@
# * oraclejdk
# * oraclejdk
#
#
# Example play:
# Example play:
#
# This role can be used to do a single-server or clustered
# installation of the elasticsearch service. When a cluster
# is being installed, there are two important things that
# you must know.
# The ELASTICSEARCH_CLUSTERED var must be true.
# All hosts targeted by your play will be cluster peers.
# Elasticsearch will determine who the master should be.
#
# Ansible provides handy set operators for use in the
# plays host declaration, as seen in the following example.
#
# - hosts: tag_role_elasticsearch:&tag_environment_stage
# roles:
# - common
# - oraclejdk
# - elasticsearch
#
#
# roles:
# - common
# - oraclejdk
# - elasticsearch
-
name
:
download elasticsearch
-
name
:
download elasticsearch
get_url
:
>
get_url
:
>
url={{ elasticsearch_url }}
url={{ elasticsearch_url }}
dest=/var/tmp/{{ elasticsearch_file }}
dest=/var/tmp/{{ elasticsearch_file }}
force=no
force=no
register
:
elasticsearch_reinstall
-
name
:
install elasticsearch from local package
-
name
:
install elasticsearch from local package
shell
:
>
shell
:
>
dpkg -i /var/tmp/elasticsearch-{{ elasticsearch_version }}.deb
dpkg -i --force-confold /var/tmp/elasticsearch-{{ elasticsearch_version }}.deb
executable=/bin/bash
executable=/bin/bash
creates=/usr/share/elasticsearch/bin/elasticsearch
when
:
elasticsearch_reinstall.changed
tags
:
-
elasticsearch
-
name
:
create directories
-
install
file
:
>
path="{{ item }}"
state=directory
owner="{{ elasticsearch_user }}"
group="{{ elasticsearch_group }}"
with_items
:
-
"
{{
elasticsearch_data_dir
}}"
-
"
{{
elasticsearch_log_dir
}}"
-
"
{{
elasticsearch_cfg_dir
}}"
-
name
:
update elasticsearch defaults
template
:
>
src=etc/default/elasticsearch.j2 dest=/etc/default/elasticsearch
when
:
ELASTICSEARCH_CLUSTERED
-
name
:
drop the elasticsearch config
template
:
>
src=edx/etc/elasticsearch/elasticsearch.yml.j2 dest={{ elasticsearch_cfg_dir }}/elasticsearch.yml
mode=0744
when
:
ELASTICSEARCH_CLUSTERED
-
name
:
Ensure elasticsearch is enabled and started
-
name
:
Ensure elasticsearch is enabled and started
service
:
name=elasticsearch state=started enabled=yes
service
:
name=elasticsearch state=restarted enabled=yes
tags
:
\ No newline at end of file
-
elasticsearch
-
install
playbooks/roles/elasticsearch/templates/edx/etc/elasticsearch/elasticsearch.yml.j2
0 → 100644
View file @
a2e41c15
# {{ ansible_managed }}
# Path to directory where to store index data allocated for this node.
#
path.data: {{elasticsearch_data_dir}}
# Path to log files:
#
path.logs: {{elasticsearch_log_dir}}
# ElasticSearch performs poorly when JVM starts swapping: you should ensure that
# it _never_ swaps.
#
# Set this property to true to lock the memory:
#
bootstrap.mlockall: true
# Unicast discovery allows to explicitly control which nodes will be used
# to discover the cluster. It can be used when multicast is not present,
# or to restrict the cluster communication-wise.
#
# 1. Disable multicast discovery (enabled by default):
#
# discovery.zen.ping.multicast.enabled: false
#
# 2. Configure an initial list of master nodes in the cluster
# to perform discovery when new nodes (master or data) are started:
#
# discovery.zen.ping.unicast.hosts: ["host1", "host2:port", "host3[portX-portY]"]
{%- if ELASTICSEARCH_CLUSTERED -%}
{%- set hosts= [] -%}
{%- for host in hostvars.keys() -%}
{% do hosts.append(host) %}
{%- endfor %}
discovery.zen.ping.unicast.hosts: ['{{hosts|join("\',\'") }}']
{% endif -%}
\ No newline at end of file
playbooks/roles/elasticsearch/templates/etc/default/elasticsearch.j2
0 → 100644
View file @
a2e41c15
# {{ ansible_managed }}
# Run ElasticSearch as this user ID and group ID
#ES_USER=elasticsearch
#ES_GROUP=elasticsearch
# Heap Size (defaults to 256m min, 1g max)
ES_HEAP_SIZE={{ ELASTICSEARCH_HEAP_SIZE }}
# Heap new generation
#ES_HEAP_NEWSIZE=
# max direct memory
#ES_DIRECT_SIZE=
# Maximum number of open files, defaults to 65535.
#MAX_OPEN_FILES=65535
# Maximum locked memory size. Set to "unlimited" if you use the
# bootstrap.mlockall option in elasticsearch.yml. You must also set
# ES_HEAP_SIZE.
#MAX_LOCKED_MEMORY=unlimited
# ElasticSearch log directory
LOG_DIR={{ elasticsearch_log_dir }}
# ElasticSearch data directory
DATA_DIR={{ COMMON_DATA_DIR }}
# ElasticSearch work directory
#WORK_DIR=/tmp/elasticsearch
# ElasticSearch configuration directory
CONF_DIR={{ elasticsearch_cfg_dir }}
# ElasticSearch configuration file (elasticsearch.yml)
# CONF_FILE=/etc/elasticsearch/elasticsearch.yml
# Additional Java OPTS
#ES_JAVA_OPTS=
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment