daddy 0.3.13 → 0.3.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/daddy/http_client.rb +2 -2
- data/lib/daddy/version.rb +1 -1
- data/lib/tasks/elasticsearch.rake +23 -0
- data/lib/tasks/elasticsearch/elasticsearch.conf.erb +128 -0
- data/lib/tasks/elasticsearch/elasticsearch.yml.erb +388 -0
- data/lib/tasks/elasticsearch/install.sh +36 -0
- data/lib/tasks/fluentd.rake +0 -3
- data/lib/tasks/kibana.rake +8 -4
- data/lib/tasks/kibana/{config.js → config.js.erb} +3 -3
- data/lib/tasks/kibana/configure.sh +16 -0
- data/lib/tasks/kibana/install.sh +6 -15
- data/lib/tasks/kibana/nginx.conf.erb +57 -0
- data/lib/tasks/task_helper.rb +6 -1
- data/{lib/ssl → ssl}/cert.pem +0 -0
- metadata +9 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d5150f9cbfc05fcf8b3a01de805b9f58135a8ef
|
4
|
+
data.tar.gz: c845fadd5f6d4768dfa53d9d8e9e5bc2b4a42e1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d695d73e2745db21c216b40956f66efaaaadddb70d1840303be204a9cb873469875630c04768269b673e3a34b9ab3783be294883c77e6e184ec6c6fef3c26b01
|
7
|
+
data.tar.gz: 4b15658091e9b62019324fb1456870574d4fe3ea84f6e249e80a372d5c991ae08dc5e67a82e8ddf8219ad0731a0a9e7e4e455074e8bf703102f5b1dc964a4cce
|
data/lib/daddy/http_client.rb
CHANGED
@@ -49,8 +49,8 @@ module Daddy
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def ssl_options
|
52
|
-
|
53
|
-
ca_path = File.join(
|
52
|
+
daddy_dir = File.expand_path('../../..', __FILE__)
|
53
|
+
ca_path = File.join(daddy_dir, 'ssl')
|
54
54
|
|
55
55
|
ret = {
|
56
56
|
:ca_path => ca_path,
|
data/lib/daddy/version.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
require_relative 'task_helper'
|
2
|
+
|
3
|
+
namespace :dad do
|
4
|
+
namespace :es do
|
5
|
+
|
6
|
+
desc "Elasticsearchをインストールします。"
|
7
|
+
task :install do
|
8
|
+
@options = {
|
9
|
+
:path_data => ask('path.data', :default => '/opt/elasticsearch/data')
|
10
|
+
}
|
11
|
+
|
12
|
+
template = File.join(File.dirname(__FILE__), 'elasticsearch', 'elasticsearch.yml.erb')
|
13
|
+
render(template, :to => File.join('tmp', 'elasticsearch.yml'))
|
14
|
+
|
15
|
+
template = File.join(File.dirname(__FILE__), 'elasticsearch', 'elasticsearch.conf.erb')
|
16
|
+
render(template, :to => File.join('tmp', 'elasticsearch.conf'))
|
17
|
+
|
18
|
+
script = File.join(File.dirname(__FILE__), 'elasticsearch', 'install.sh')
|
19
|
+
run "bash -ex #{script}"
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,128 @@
|
|
1
|
+
set.default.ES_HOME=/opt/elasticsearch
|
2
|
+
set.default.ES_HEAP_SIZE=1024
|
3
|
+
|
4
|
+
#********************************************************************
|
5
|
+
# Wrapper Timeout Properties
|
6
|
+
#********************************************************************
|
7
|
+
# How long to wait for the JVM to start (in seconds)
|
8
|
+
wrapper.startup.timeout=300
|
9
|
+
# How long to wait for the JVM to stop (in seconds)
|
10
|
+
wrapper.shutdown.timeout=300
|
11
|
+
# When a ping will timeout to consider the JVM hung (in seconds)
|
12
|
+
wrapper.ping.timeout=300
|
13
|
+
|
14
|
+
#********************************************************************
|
15
|
+
# Wrapper Java Properties
|
16
|
+
#********************************************************************
|
17
|
+
# Java Application
|
18
|
+
wrapper.java.command=java
|
19
|
+
|
20
|
+
# Tell the Wrapper to log the full generated Java command line.
|
21
|
+
#wrapper.java.command.loglevel=INFO
|
22
|
+
|
23
|
+
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
|
24
|
+
|
25
|
+
wrapper.working.dir=%ES_HOME%
|
26
|
+
|
27
|
+
# Java Classpath (include wrapper.jar) Add class path elements as
|
28
|
+
# needed starting from 1
|
29
|
+
wrapper.java.classpath.1=%ES_HOME%/bin/service/lib/wrapper.jar
|
30
|
+
wrapper.java.classpath.2=%ES_HOME%/lib/elasticsearch*.jar
|
31
|
+
wrapper.java.classpath.3=%ES_HOME%/lib/*.jar
|
32
|
+
wrapper.java.classpath.4=%ES_HOME%/lib/sigar/*.jar
|
33
|
+
|
34
|
+
# Java Library Path (location of Wrapper.DLL or libwrapper.so)
|
35
|
+
wrapper.java.library.path.1=%ES_HOME%/bin/service/lib
|
36
|
+
|
37
|
+
# Java Bits. On applicable platforms, tells the JVM to run in 32 or 64-bit mode.
|
38
|
+
wrapper.java.additional.auto_bits=TRUE
|
39
|
+
|
40
|
+
# Java Additional Parameters
|
41
|
+
wrapper.java.additional.1=-Delasticsearch-service
|
42
|
+
wrapper.java.additional.2=-Des.path.home=%ES_HOME%
|
43
|
+
wrapper.java.additional.3=-Xss256k
|
44
|
+
wrapper.java.additional.4=-XX:+UseParNewGC
|
45
|
+
wrapper.java.additional.5=-XX:+UseConcMarkSweepGC
|
46
|
+
wrapper.java.additional.6=-XX:CMSInitiatingOccupancyFraction=75
|
47
|
+
wrapper.java.additional.7=-XX:+UseCMSInitiatingOccupancyOnly
|
48
|
+
wrapper.java.additional.8=-XX:+HeapDumpOnOutOfMemoryError
|
49
|
+
wrapper.java.additional.9=-Djava.awt.headless=true
|
50
|
+
|
51
|
+
# Initial Java Heap Size (in MB)
|
52
|
+
wrapper.java.initmemory=%ES_HEAP_SIZE%
|
53
|
+
|
54
|
+
# Maximum Java Heap Size (in MB)
|
55
|
+
wrapper.java.maxmemory=%ES_HEAP_SIZE%
|
56
|
+
|
57
|
+
# Application parameters. Add parameters as needed starting from 1
|
58
|
+
wrapper.app.parameter.1=org.elasticsearch.bootstrap.ElasticsearchF
|
59
|
+
|
60
|
+
#********************************************************************
|
61
|
+
# Wrapper Logging Properties
|
62
|
+
#********************************************************************
|
63
|
+
# Enables Debug output from the Wrapper.
|
64
|
+
# wrapper.debug=TRUE
|
65
|
+
|
66
|
+
# Format of output for the console. (See docs for formats)
|
67
|
+
wrapper.console.format=PM
|
68
|
+
|
69
|
+
# Log Level for console output. (See docs for log levels)
|
70
|
+
wrapper.console.loglevel=INFO
|
71
|
+
|
72
|
+
# Log file to use for wrapper output logging.
|
73
|
+
wrapper.logfile=%ES_HOME%/logs/service.log
|
74
|
+
|
75
|
+
# Format of output for the log file. (See docs for formats)
|
76
|
+
wrapper.logfile.format=LPTM
|
77
|
+
|
78
|
+
# Log Level for log file output. (See docs for log levels)
|
79
|
+
wrapper.logfile.loglevel=INFO
|
80
|
+
|
81
|
+
# Maximum size that the log file will be allowed to grow to before
|
82
|
+
# the log is rolled. Size is specified in bytes. The default value
|
83
|
+
# of 0, disables log rolling. May abbreviate with the 'k' (kb) or
|
84
|
+
# 'm' (mb) suffix. For example: 10m = 10 megabytes.
|
85
|
+
wrapper.logfile.maxsize=0
|
86
|
+
|
87
|
+
# Maximum number of rolled log files which will be allowed before old
|
88
|
+
# files are deleted. The default value of 0 implies no limit.
|
89
|
+
wrapper.logfile.maxfiles=0
|
90
|
+
|
91
|
+
# Log Level for sys/event log output. (See docs for log levels)
|
92
|
+
wrapper.syslog.loglevel=NONE
|
93
|
+
|
94
|
+
#********************************************************************
|
95
|
+
# Wrapper General Properties
|
96
|
+
#********************************************************************
|
97
|
+
# Allow for the use of non-contiguous numbered properties
|
98
|
+
wrapper.ignore_sequence_gaps=TRUE
|
99
|
+
|
100
|
+
# Title to use when running as a console
|
101
|
+
wrapper.console.title=Elasticsearch
|
102
|
+
|
103
|
+
#********************************************************************
|
104
|
+
# Wrapper Windows NT/2000/XP Service Properties
|
105
|
+
#********************************************************************
|
106
|
+
# WARNING - Do not modify any of these properties when an application
|
107
|
+
# using this configuration file has been installed as a service.
|
108
|
+
# Please uninstall the service before modifying this section. The
|
109
|
+
# service can then be reinstalled.
|
110
|
+
|
111
|
+
# Name of the service
|
112
|
+
wrapper.name=Elasticsearch
|
113
|
+
|
114
|
+
# Display name of the service
|
115
|
+
wrapper.displayname=Elasticsearch
|
116
|
+
|
117
|
+
# Description of the service
|
118
|
+
wrapper.description=Open Source, Distributed, RESTful Search Engine
|
119
|
+
|
120
|
+
# Service dependencies. Add dependencies as needed starting from 1
|
121
|
+
wrapper.ntservice.dependency.1=
|
122
|
+
|
123
|
+
# Mode in which the service is installed. AUTO_START, DELAY_START or DEMAND_START
|
124
|
+
wrapper.ntservice.starttype=AUTO_START
|
125
|
+
|
126
|
+
# Allow the service to interact with the desktop.
|
127
|
+
wrapper.ntservice.interactive=false
|
128
|
+
|
@@ -0,0 +1,388 @@
|
|
1
|
+
##################### Elasticsearch Configuration Example #####################
|
2
|
+
|
3
|
+
# This file contains an overview of various configuration settings,
|
4
|
+
# targeted at operations staff. Application developers should
|
5
|
+
# consult the guide at <http://elasticsearch.org/guide>.
|
6
|
+
#
|
7
|
+
# The installation procedure is covered at
|
8
|
+
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup.html>.
|
9
|
+
#
|
10
|
+
# Elasticsearch comes with reasonable defaults for most settings,
|
11
|
+
# so you can try it out without bothering with configuration.
|
12
|
+
#
|
13
|
+
# Most of the time, these defaults are just fine for running a production
|
14
|
+
# cluster. If you're fine-tuning your cluster, or wondering about the
|
15
|
+
# effect of certain configuration option, please _do ask_ on the
|
16
|
+
# mailing list or IRC channel [http://elasticsearch.org/community].
|
17
|
+
|
18
|
+
# Any element in the configuration can be replaced with environment variables
|
19
|
+
# by placing them in ${...} notation. For example:
|
20
|
+
#
|
21
|
+
#node.rack: ${RACK_ENV_VAR}
|
22
|
+
|
23
|
+
# For information on supported formats and syntax for the config file, see
|
24
|
+
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup-configuration.html>
|
25
|
+
|
26
|
+
|
27
|
+
################################### Cluster ###################################
|
28
|
+
|
29
|
+
# Cluster name identifies your cluster for auto-discovery. If you're running
|
30
|
+
# multiple clusters on the same network, make sure you're using unique names.
|
31
|
+
#
|
32
|
+
#cluster.name: elasticsearch
|
33
|
+
|
34
|
+
|
35
|
+
#################################### Node #####################################
|
36
|
+
|
37
|
+
# Node names are generated dynamically on startup, so you're relieved
|
38
|
+
# from configuring them manually. You can tie this node to a specific name:
|
39
|
+
#
|
40
|
+
#node.name: "Franz Kafka"
|
41
|
+
|
42
|
+
# Every node can be configured to allow or deny being eligible as the master,
|
43
|
+
# and to allow or deny to store the data.
|
44
|
+
#
|
45
|
+
# Allow this node to be eligible as a master node (enabled by default):
|
46
|
+
#
|
47
|
+
#node.master: true
|
48
|
+
#
|
49
|
+
# Allow this node to store data (enabled by default):
|
50
|
+
#
|
51
|
+
#node.data: true
|
52
|
+
|
53
|
+
# You can exploit these settings to design advanced cluster topologies.
|
54
|
+
#
|
55
|
+
# 1. You want this node to never become a master node, only to hold data.
|
56
|
+
# This will be the "workhorse" of your cluster.
|
57
|
+
#
|
58
|
+
#node.master: false
|
59
|
+
#node.data: true
|
60
|
+
#
|
61
|
+
# 2. You want this node to only serve as a master: to not store any data and
|
62
|
+
# to have free resources. This will be the "coordinator" of your cluster.
|
63
|
+
#
|
64
|
+
#node.master: true
|
65
|
+
#node.data: false
|
66
|
+
#
|
67
|
+
# 3. You want this node to be neither master nor data node, but
|
68
|
+
# to act as a "search load balancer" (fetching data from nodes,
|
69
|
+
# aggregating results, etc.)
|
70
|
+
#
|
71
|
+
#node.master: false
|
72
|
+
#node.data: false
|
73
|
+
|
74
|
+
# Use the Cluster Health API [http://localhost:9200/_cluster/health], the
|
75
|
+
# Node Info API [http://localhost:9200/_nodes] or GUI tools
|
76
|
+
# such as <http://www.elasticsearch.org/overview/marvel/>,
|
77
|
+
# <http://github.com/karmi/elasticsearch-paramedic>,
|
78
|
+
# <http://github.com/lukas-vlcek/bigdesk> and
|
79
|
+
# <http://mobz.github.com/elasticsearch-head> to inspect the cluster state.
|
80
|
+
|
81
|
+
# A node can have generic attributes associated with it, which can later be used
|
82
|
+
# for customized shard allocation filtering, or allocation awareness. An attribute
|
83
|
+
# is a simple key value pair, similar to node.key: value, here is an example:
|
84
|
+
#
|
85
|
+
#node.rack: rack314
|
86
|
+
|
87
|
+
# By default, multiple nodes are allowed to start from the same installation location
|
88
|
+
# to disable it, set the following:
|
89
|
+
#node.max_local_storage_nodes: 1
|
90
|
+
|
91
|
+
|
92
|
+
#################################### Index ####################################
|
93
|
+
|
94
|
+
# You can set a number of options (such as shard/replica options, mapping
|
95
|
+
# or analyzer definitions, translog settings, ...) for indices globally,
|
96
|
+
# in this file.
|
97
|
+
#
|
98
|
+
# Note, that it makes more sense to configure index settings specifically for
|
99
|
+
# a certain index, either when creating it or by using the index templates API.
|
100
|
+
#
|
101
|
+
# See <http://elasticsearch.org/guide/en/elasticsearch/reference/current/index-modules.html> and
|
102
|
+
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/indices-create-index.html>
|
103
|
+
# for more information.
|
104
|
+
|
105
|
+
# Set the number of shards (splits) of an index (5 by default):
|
106
|
+
#
|
107
|
+
#index.number_of_shards: 5
|
108
|
+
|
109
|
+
# Set the number of replicas (additional copies) of an index (1 by default):
|
110
|
+
#
|
111
|
+
#index.number_of_replicas: 1
|
112
|
+
|
113
|
+
# Note, that for development on a local machine, with small indices, it usually
|
114
|
+
# makes sense to "disable" the distributed features:
|
115
|
+
#
|
116
|
+
#index.number_of_shards: 1
|
117
|
+
#index.number_of_replicas: 0
|
118
|
+
|
119
|
+
# These settings directly affect the performance of index and search operations
|
120
|
+
# in your cluster. Assuming you have enough machines to hold shards and
|
121
|
+
# replicas, the rule of thumb is:
|
122
|
+
#
|
123
|
+
# 1. Having more *shards* enhances the _indexing_ performance and allows to
|
124
|
+
# _distribute_ a big index across machines.
|
125
|
+
# 2. Having more *replicas* enhances the _search_ performance and improves the
|
126
|
+
# cluster _availability_.
|
127
|
+
#
|
128
|
+
# The "number_of_shards" is a one-time setting for an index.
|
129
|
+
#
|
130
|
+
# The "number_of_replicas" can be increased or decreased anytime,
|
131
|
+
# by using the Index Update Settings API.
|
132
|
+
#
|
133
|
+
# Elasticsearch takes care about load balancing, relocating, gathering the
|
134
|
+
# results from nodes, etc. Experiment with different settings to fine-tune
|
135
|
+
# your setup.
|
136
|
+
|
137
|
+
# Use the Index Status API (<http://localhost:9200/A/_status>) to inspect
|
138
|
+
# the index status.
|
139
|
+
|
140
|
+
|
141
|
+
#################################### Paths ####################################
|
142
|
+
|
143
|
+
# Path to directory containing configuration (this file and logging.yml):
|
144
|
+
#
|
145
|
+
#path.conf: /path/to/conf
|
146
|
+
|
147
|
+
# Path to directory where to store index data allocated for this node.
|
148
|
+
#
|
149
|
+
#path.data: /path/to/data
|
150
|
+
#
|
151
|
+
# Can optionally include more than one location, causing data to be striped across
|
152
|
+
# the locations (a la RAID 0) on a file level, favouring locations with most free
|
153
|
+
# space on creation. For example:
|
154
|
+
#
|
155
|
+
#path.data: /path/to/data1,/path/to/data2
|
156
|
+
<%- unless @options[:path_data].empty? -%>
|
157
|
+
path.data: <%= @options[:path_data] %>
|
158
|
+
<%- end -%>
|
159
|
+
|
160
|
+
# Path to temporary files:
|
161
|
+
#
|
162
|
+
#path.work: /path/to/work
|
163
|
+
|
164
|
+
# Path to log files:
|
165
|
+
#
|
166
|
+
#path.logs: /path/to/logs
|
167
|
+
|
168
|
+
# Path to where plugins are installed:
|
169
|
+
#
|
170
|
+
#path.plugins: /path/to/plugins
|
171
|
+
|
172
|
+
|
173
|
+
#################################### Plugin ###################################
|
174
|
+
|
175
|
+
# If a plugin listed here is not installed for current node, the node will not start.
|
176
|
+
#
|
177
|
+
#plugin.mandatory: mapper-attachments,lang-groovy
|
178
|
+
|
179
|
+
|
180
|
+
################################### Memory ####################################
|
181
|
+
|
182
|
+
# Elasticsearch performs poorly when JVM starts swapping: you should ensure that
|
183
|
+
# it _never_ swaps.
|
184
|
+
#
|
185
|
+
# Set this property to true to lock the memory:
|
186
|
+
#
|
187
|
+
#bootstrap.mlockall: true
|
188
|
+
|
189
|
+
# Make sure that the ES_MIN_MEM and ES_MAX_MEM environment variables are set
|
190
|
+
# to the same value, and that the machine has enough memory to allocate
|
191
|
+
# for Elasticsearch, leaving enough memory for the operating system itself.
|
192
|
+
#
|
193
|
+
# You should also make sure that the Elasticsearch process is allowed to lock
|
194
|
+
# the memory, eg. by using `ulimit -l unlimited`.
|
195
|
+
|
196
|
+
|
197
|
+
############################## Network And HTTP ###############################
|
198
|
+
|
199
|
+
# Elasticsearch, by default, binds itself to the 0.0.0.0 address, and listens
|
200
|
+
# on port [9200-9300] for HTTP traffic and on port [9300-9400] for node-to-node
|
201
|
+
# communication. (the range means that if the port is busy, it will automatically
|
202
|
+
# try the next port).
|
203
|
+
|
204
|
+
# Set the bind address specifically (IPv4 or IPv6):
|
205
|
+
#
|
206
|
+
#network.bind_host: 192.168.0.1
|
207
|
+
|
208
|
+
# Set the address other nodes will use to communicate with this node. If not
|
209
|
+
# set, it is automatically derived. It must point to an actual IP address.
|
210
|
+
#
|
211
|
+
#network.publish_host: 192.168.0.1
|
212
|
+
|
213
|
+
# Set both 'bind_host' and 'publish_host':
|
214
|
+
#
|
215
|
+
#network.host: 192.168.0.1
|
216
|
+
|
217
|
+
# Set a custom port for the node to node communication (9300 by default):
|
218
|
+
#
|
219
|
+
#transport.tcp.port: 9300
|
220
|
+
|
221
|
+
# Enable compression for all communication between nodes (disabled by default):
|
222
|
+
#
|
223
|
+
#transport.tcp.compress: true
|
224
|
+
|
225
|
+
# Set a custom port to listen for HTTP traffic:
|
226
|
+
#
|
227
|
+
#http.port: 9200
|
228
|
+
|
229
|
+
# Set a custom allowed content length:
|
230
|
+
#
|
231
|
+
#http.max_content_length: 100mb
|
232
|
+
|
233
|
+
# Disable HTTP completely:
|
234
|
+
#
|
235
|
+
#http.enabled: false
|
236
|
+
|
237
|
+
|
238
|
+
################################### Gateway ###################################
|
239
|
+
|
240
|
+
# The gateway allows for persisting the cluster state between full cluster
|
241
|
+
# restarts. Every change to the state (such as adding an index) will be stored
|
242
|
+
# in the gateway, and when the cluster starts up for the first time,
|
243
|
+
# it will read its state from the gateway.
|
244
|
+
|
245
|
+
# There are several types of gateway implementations. For more information, see
|
246
|
+
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/modules-gateway.html>.
|
247
|
+
|
248
|
+
# The default gateway type is the "local" gateway (recommended):
|
249
|
+
#
|
250
|
+
#gateway.type: local
|
251
|
+
|
252
|
+
# Settings below control how and when to start the initial recovery process on
|
253
|
+
# a full cluster restart (to reuse as much local data as possible when using shared
|
254
|
+
# gateway).
|
255
|
+
|
256
|
+
# Allow recovery process after N nodes in a cluster are up:
|
257
|
+
#
|
258
|
+
#gateway.recover_after_nodes: 1
|
259
|
+
|
260
|
+
# Set the timeout to initiate the recovery process, once the N nodes
|
261
|
+
# from previous setting are up (accepts time value):
|
262
|
+
#
|
263
|
+
#gateway.recover_after_time: 5m
|
264
|
+
|
265
|
+
# Set how many nodes are expected in this cluster. Once these N nodes
|
266
|
+
# are up (and recover_after_nodes is met), begin recovery process immediately
|
267
|
+
# (without waiting for recover_after_time to expire):
|
268
|
+
#
|
269
|
+
#gateway.expected_nodes: 2
|
270
|
+
|
271
|
+
|
272
|
+
############################# Recovery Throttling #############################
|
273
|
+
|
274
|
+
# These settings allow to control the process of shards allocation between
|
275
|
+
# nodes during initial recovery, replica allocation, rebalancing,
|
276
|
+
# or when adding and removing nodes.
|
277
|
+
|
278
|
+
# Set the number of concurrent recoveries happening on a node:
|
279
|
+
#
|
280
|
+
# 1. During the initial recovery
|
281
|
+
#
|
282
|
+
#cluster.routing.allocation.node_initial_primaries_recoveries: 4
|
283
|
+
#
|
284
|
+
# 2. During adding/removing nodes, rebalancing, etc
|
285
|
+
#
|
286
|
+
#cluster.routing.allocation.node_concurrent_recoveries: 2
|
287
|
+
|
288
|
+
# Set to throttle throughput when recovering (eg. 100mb, by default 20mb):
|
289
|
+
#
|
290
|
+
#indices.recovery.max_bytes_per_sec: 20mb
|
291
|
+
|
292
|
+
# Set to limit the number of open concurrent streams when
|
293
|
+
# recovering a shard from a peer:
|
294
|
+
#
|
295
|
+
#indices.recovery.concurrent_streams: 5
|
296
|
+
|
297
|
+
|
298
|
+
################################## Discovery ##################################
|
299
|
+
|
300
|
+
# Discovery infrastructure ensures nodes can be found within a cluster
|
301
|
+
# and master node is elected. Multicast discovery is the default.
|
302
|
+
|
303
|
+
# Set to ensure a node sees N other master eligible nodes to be considered
|
304
|
+
# operational within the cluster. This should be set to a quorum/majority of
|
305
|
+
# the master-eligible nodes in the cluster.
|
306
|
+
#
|
307
|
+
#discovery.zen.minimum_master_nodes: 1
|
308
|
+
|
309
|
+
# Set the time to wait for ping responses from other nodes when discovering.
|
310
|
+
# Set this option to a higher value on a slow or congested network
|
311
|
+
# to minimize discovery failures:
|
312
|
+
#
|
313
|
+
#discovery.zen.ping.timeout: 3s
|
314
|
+
|
315
|
+
# For more information, see
|
316
|
+
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/modules-discovery-zen.html>
|
317
|
+
|
318
|
+
# Unicast discovery allows to explicitly control which nodes will be used
|
319
|
+
# to discover the cluster. It can be used when multicast is not present,
|
320
|
+
# or to restrict the cluster communication-wise.
|
321
|
+
#
|
322
|
+
# 1. Disable multicast discovery (enabled by default):
|
323
|
+
#
|
324
|
+
#discovery.zen.ping.multicast.enabled: false
|
325
|
+
#
|
326
|
+
# 2. Configure an initial list of master nodes in the cluster
|
327
|
+
# to perform discovery when new nodes (master or data) are started:
|
328
|
+
#
|
329
|
+
#discovery.zen.ping.unicast.hosts: ["host1", "host2:port"]
|
330
|
+
|
331
|
+
# EC2 discovery allows to use AWS EC2 API in order to perform discovery.
|
332
|
+
#
|
333
|
+
# You have to install the cloud-aws plugin for enabling the EC2 discovery.
|
334
|
+
#
|
335
|
+
# For more information, see
|
336
|
+
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/modules-discovery-ec2.html>
|
337
|
+
#
|
338
|
+
# See <http://elasticsearch.org/tutorials/elasticsearch-on-ec2/>
|
339
|
+
# for a step-by-step tutorial.
|
340
|
+
|
341
|
+
# GCE discovery allows to use Google Compute Engine API in order to perform discovery.
|
342
|
+
#
|
343
|
+
# You have to install the cloud-gce plugin for enabling the GCE discovery.
|
344
|
+
#
|
345
|
+
# For more information, see <https://github.com/elasticsearch/elasticsearch-cloud-gce>.
|
346
|
+
|
347
|
+
# Azure discovery allows to use Azure API in order to perform discovery.
|
348
|
+
#
|
349
|
+
# You have to install the cloud-azure plugin for enabling the Azure discovery.
|
350
|
+
#
|
351
|
+
# For more information, see <https://github.com/elasticsearch/elasticsearch-cloud-azure>.
|
352
|
+
|
353
|
+
################################## Slow Log ##################################
|
354
|
+
|
355
|
+
# Shard level query and fetch threshold logging.
|
356
|
+
|
357
|
+
#index.search.slowlog.threshold.query.warn: 10s
|
358
|
+
#index.search.slowlog.threshold.query.info: 5s
|
359
|
+
#index.search.slowlog.threshold.query.debug: 2s
|
360
|
+
#index.search.slowlog.threshold.query.trace: 500ms
|
361
|
+
|
362
|
+
#index.search.slowlog.threshold.fetch.warn: 1s
|
363
|
+
#index.search.slowlog.threshold.fetch.info: 800ms
|
364
|
+
#index.search.slowlog.threshold.fetch.debug: 500ms
|
365
|
+
#index.search.slowlog.threshold.fetch.trace: 200ms
|
366
|
+
|
367
|
+
#index.indexing.slowlog.threshold.index.warn: 10s
|
368
|
+
#index.indexing.slowlog.threshold.index.info: 5s
|
369
|
+
#index.indexing.slowlog.threshold.index.debug: 2s
|
370
|
+
#index.indexing.slowlog.threshold.index.trace: 500ms
|
371
|
+
|
372
|
+
################################## GC Logging ################################
|
373
|
+
|
374
|
+
#monitor.jvm.gc.young.warn: 1000ms
|
375
|
+
#monitor.jvm.gc.young.info: 700ms
|
376
|
+
#monitor.jvm.gc.young.debug: 400ms
|
377
|
+
|
378
|
+
#monitor.jvm.gc.old.warn: 10s
|
379
|
+
#monitor.jvm.gc.old.info: 5s
|
380
|
+
#monitor.jvm.gc.old.debug: 2s
|
381
|
+
|
382
|
+
################################## Security ################################
|
383
|
+
|
384
|
+
# Uncomment if you want to enable JSONP as a valid return transport on the
|
385
|
+
# http server. With this enabled, it may pose a security risk, so disabling
|
386
|
+
# it unless you need it is recommended (it is disabled by default).
|
387
|
+
#
|
388
|
+
#http.jsonp.enable: true
|
@@ -0,0 +1,36 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
SCRIPT_BASE=`dirname $0`
|
4
|
+
VERSION="1.4.0"
|
5
|
+
URL=https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-${VERSION}.tar.gz
|
6
|
+
URL_SW=https://github.com/elasticsearch/elasticsearch-servicewrapper/tarball/master
|
7
|
+
|
8
|
+
mkdir -p tmp
|
9
|
+
pushd tmp
|
10
|
+
if [ -e elasticsearch-${VERSION}.tar.gz ]; then
|
11
|
+
echo "elasticsearch-${VERSION}.tar.gz はダウンロード済みです。"
|
12
|
+
else
|
13
|
+
wget ${URL}
|
14
|
+
fi
|
15
|
+
|
16
|
+
if [ -e elasticsearch-servicewrapper.tar.gz ]; then
|
17
|
+
echo "elasticsearch-servicewrapper.tar.gz はダウンロード済みです。"
|
18
|
+
else
|
19
|
+
wget ${URL_SW} -O elasticsearch-servicewrapper.tar.gz
|
20
|
+
fi
|
21
|
+
|
22
|
+
rm -Rf elasticsearch-${VERSION}
|
23
|
+
tar zxf elasticsearch-${VERSION}.tar.gz
|
24
|
+
sudo rm -Rf /opt/elasticsearch-${VERSION}
|
25
|
+
sudo mv elasticsearch-${VERSION} /opt/
|
26
|
+
sudo ln -snf /opt/elasticsearch-${VERSION} /opt/elasticsearch
|
27
|
+
sudo cp -f elasticsearch.yml /opt/elasticsearch/config/
|
28
|
+
|
29
|
+
rm -Rf elasticsearch-elasticsearch-servicewrapper*
|
30
|
+
tar zxf elasticsearch-servicewrapper.tar.gz
|
31
|
+
sudo mv elasticsearch-elasticsearch-servicewrapper*/service /opt/elasticsearch/bin/
|
32
|
+
sudo cp -f elasticsearch.conf /opt/elasticsearch/bin/service
|
33
|
+
sudo /opt/elasticsearch/bin/service/elasticsearch remove
|
34
|
+
sudo /opt/elasticsearch/bin/service/elasticsearch install
|
35
|
+
sudo chkconfig elasticsearch on
|
36
|
+
popd
|
data/lib/tasks/fluentd.rake
CHANGED
data/lib/tasks/kibana.rake
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'rake'
|
2
1
|
require_relative 'task_helper'
|
3
2
|
|
4
3
|
namespace :dad do
|
@@ -6,10 +5,15 @@ namespace :dad do
|
|
6
5
|
|
7
6
|
desc "Kibanaをインストールします。"
|
8
7
|
task :install do
|
9
|
-
|
8
|
+
@options = {
|
9
|
+
:version => ask('version', :default => '3.1.2'),
|
10
|
+
:server => ask('server', :default => 'localhost')
|
11
|
+
}
|
12
|
+
render(task_file('kibana', 'config.js.erb'), :to => 'tmp/config.js')
|
13
|
+
render(task_file('kibana', 'nginx.conf.erb'), :to => 'tmp/nginx/kibana.conf')
|
10
14
|
|
11
|
-
|
12
|
-
|
15
|
+
run "bash -ex #{task_file('kibana', 'configure.sh')} #{@options[:version]}"
|
16
|
+
run "bash -ex #{task_file('kibana', 'install.sh')} #{@options[:version]}" unless ENV['DRY_RUN']
|
13
17
|
end
|
14
18
|
|
15
19
|
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
*/
|
7
7
|
define(['settings'],
|
8
8
|
function (Settings) {
|
9
|
-
|
9
|
+
|
10
10
|
|
11
11
|
/** @scratch /configuration/config.js/2
|
12
12
|
*
|
@@ -29,7 +29,7 @@ function (Settings) {
|
|
29
29
|
* +elasticsearch: {server: "http://localhost:9200", withCredentials: true}+
|
30
30
|
*
|
31
31
|
*/
|
32
|
-
elasticsearch: "https
|
32
|
+
elasticsearch: "https://<%= @options[:server] %>",
|
33
33
|
|
34
34
|
/** @scratch /configuration/config.js/5
|
35
35
|
*
|
@@ -77,4 +77,4 @@ function (Settings) {
|
|
77
77
|
'sparklines'
|
78
78
|
]
|
79
79
|
});
|
80
|
-
});
|
80
|
+
});
|
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
SCRIPT_BASE=`dirname $0`
|
4
|
+
VERSION=$1
|
5
|
+
|
6
|
+
mkdir -p tmp
|
7
|
+
pushd tmp
|
8
|
+
if [ -e kibana-${VERSION}.tar.gz ]; then
|
9
|
+
echo "kibana-${VERSION}.tar.gz はダウンロード済みです。"
|
10
|
+
else
|
11
|
+
wget https://download.elasticsearch.org/kibana/kibana/kibana-${VERSION}.tar.gz
|
12
|
+
fi
|
13
|
+
|
14
|
+
rm -Rf kibana-${VERSION}
|
15
|
+
tar zxf kibana-${VERSION}.tar.gz
|
16
|
+
popd
|
data/lib/tasks/kibana/install.sh
CHANGED
@@ -1,20 +1,11 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
|
3
3
|
SCRIPT_BASE=`dirname $0`
|
4
|
-
VERSION
|
4
|
+
VERSION=$1
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
echo "kibana-${VERSION}.tar.gz はダウンロード済みです。"
|
10
|
-
else
|
11
|
-
wget https://download.elasticsearch.org/kibana/kibana/kibana-${VERSION}.tar.gz
|
12
|
-
fi
|
6
|
+
sudo rm -Rf /opt/kibana-${VERSION}
|
7
|
+
sudo mv tmp/kibana-${VERSION} /opt/
|
8
|
+
sudo ln -snf /opt/kibana-${VERSION} /opt/kibana
|
13
9
|
|
14
|
-
|
15
|
-
|
16
|
-
sudo mv kibana-${VERSION} /opt/
|
17
|
-
sudo ln -snf /opt/kibana-${VERSION} /opt/kibana
|
18
|
-
popd
|
19
|
-
|
20
|
-
cp -f ${SCRIPT_BASE}/config.js /opt/kibana/
|
10
|
+
cp -f tmp/config.js /opt/kibana/
|
11
|
+
sudo cp -f tmp/nginx/kibana.conf /etc/nginx/conf.d/servers/
|
@@ -0,0 +1,57 @@
|
|
1
|
+
#
|
2
|
+
# Nginx proxy for Elasticsearch + Kibana
|
3
|
+
#
|
4
|
+
# In this setup, we are password protecting the saving of dashboards. You may
|
5
|
+
# wish to extend the password protection to all paths.
|
6
|
+
#
|
7
|
+
# Even though these paths are being called as the result of an ajax request, the
|
8
|
+
# browser will prompt for a username/password on the first request
|
9
|
+
#
|
10
|
+
# If you use this, you'll want to point config.js at http://FQDN:80/ instead of
|
11
|
+
# http://FQDN:9200
|
12
|
+
#
|
13
|
+
server {
|
14
|
+
listen 443;
|
15
|
+
server_name <%= @options[:server] %>;
|
16
|
+
#access_log /var/log/nginx/kibana.access.log ltsv;
|
17
|
+
ssl_certificate /etc/pki/tls/certs/nginx.pem;
|
18
|
+
ssl_certificate_key /etc/pki/tls/certs/nginx.pem;
|
19
|
+
|
20
|
+
auth_basic "<%= @options[:server] %>";
|
21
|
+
auth_basic_user_file conf.d/.htpasswd;
|
22
|
+
|
23
|
+
location / {
|
24
|
+
root /opt/kibana;
|
25
|
+
index index.html index.htm;
|
26
|
+
}
|
27
|
+
|
28
|
+
location ~ ^/_aliases$ {
|
29
|
+
proxy_pass http://127.0.0.1:9200;
|
30
|
+
proxy_read_timeout 90;
|
31
|
+
}
|
32
|
+
location ~ ^/.*/_aliases$ {
|
33
|
+
proxy_pass http://127.0.0.1:9200;
|
34
|
+
proxy_read_timeout 90;
|
35
|
+
}
|
36
|
+
location ~ ^/_nodes$ {
|
37
|
+
proxy_pass http://127.0.0.1:9200;
|
38
|
+
proxy_read_timeout 90;
|
39
|
+
}
|
40
|
+
location ~ ^/.*/_search$ {
|
41
|
+
proxy_pass http://127.0.0.1:9200;
|
42
|
+
proxy_read_timeout 90;
|
43
|
+
}
|
44
|
+
location ~ ^/.*/_mapping {
|
45
|
+
proxy_pass http://127.0.0.1:9200;
|
46
|
+
proxy_read_timeout 90;
|
47
|
+
}
|
48
|
+
|
49
|
+
location ~ ^/kibana-int/dashboard/.*$ {
|
50
|
+
proxy_pass http://127.0.0.1:9200;
|
51
|
+
proxy_read_timeout 90;
|
52
|
+
}
|
53
|
+
location ~ ^/kibana-int/temp.*$ {
|
54
|
+
proxy_pass http://127.0.0.1:9200;
|
55
|
+
proxy_read_timeout 90;
|
56
|
+
}
|
57
|
+
}
|
data/lib/tasks/task_helper.rb
CHANGED
@@ -18,13 +18,18 @@ def self.template_dir
|
|
18
18
|
File.join(File.dirname(File.dirname(File.dirname(__FILE__))), 'templates')
|
19
19
|
end
|
20
20
|
|
21
|
+
def self.task_file(*path)
|
22
|
+
File.join(File.dirname(__FILE__), *path)
|
23
|
+
end
|
24
|
+
|
21
25
|
def self.render(template, options = {})
|
26
|
+
FileUtils.mkdir_p(File.dirname(options[:to]))
|
22
27
|
File.write(options[:to], ERB.new(File.read(template), 0, '-').result)
|
23
28
|
end
|
24
29
|
|
25
30
|
def self.ask(prompt, options = {})
|
26
31
|
if options[:default]
|
27
|
-
print prompt + "[#{options[:default]}]: "
|
32
|
+
print prompt + " [#{options[:default]}]: "
|
28
33
|
else
|
29
34
|
print prompt + ": "
|
30
35
|
end
|
data/{lib/ssl → ssl}/cert.pem
RENAMED
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: daddy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ichy
|
@@ -313,7 +313,6 @@ files:
|
|
313
313
|
- lib/daddy/version.rb
|
314
314
|
- lib/prefecture.rb
|
315
315
|
- lib/sql_builder.rb
|
316
|
-
- lib/ssl/cert.pem
|
317
316
|
- lib/tasks/app_base_dir.rake
|
318
317
|
- lib/tasks/cucumber.rake
|
319
318
|
- lib/tasks/cucumber_install.rake
|
@@ -324,6 +323,10 @@ files:
|
|
324
323
|
- lib/tasks/db_create.rake
|
325
324
|
- lib/tasks/db_fixtures.rake
|
326
325
|
- lib/tasks/diary.rake
|
326
|
+
- lib/tasks/elasticsearch.rake
|
327
|
+
- lib/tasks/elasticsearch/elasticsearch.conf.erb
|
328
|
+
- lib/tasks/elasticsearch/elasticsearch.yml.erb
|
329
|
+
- lib/tasks/elasticsearch/install.sh
|
327
330
|
- lib/tasks/fluentd.conf
|
328
331
|
- lib/tasks/fluentd.rake
|
329
332
|
- lib/tasks/fluentd.repo
|
@@ -340,8 +343,10 @@ files:
|
|
340
343
|
- lib/tasks/jenkins/jenkins
|
341
344
|
- lib/tasks/jenkins/nginx.conf.erb
|
342
345
|
- lib/tasks/kibana.rake
|
343
|
-
- lib/tasks/kibana/config.js
|
346
|
+
- lib/tasks/kibana/config.js.erb
|
347
|
+
- lib/tasks/kibana/configure.sh
|
344
348
|
- lib/tasks/kibana/install.sh
|
349
|
+
- lib/tasks/kibana/nginx.conf.erb
|
345
350
|
- lib/tasks/nginx.app.conf.erb
|
346
351
|
- lib/tasks/nginx.rake
|
347
352
|
- lib/tasks/nginx/nginx.conf.erb
|
@@ -358,6 +363,7 @@ files:
|
|
358
363
|
- lib/tasks/unicorn.erb
|
359
364
|
- lib/tasks/unicorn.rake
|
360
365
|
- lib/tasks/unicorn.rb.erb
|
366
|
+
- ssl/cert.pem
|
361
367
|
- templates/Gemfile.erb
|
362
368
|
- templates/app/controllers/controller.rb.erb
|
363
369
|
- templates/app/views/_form.html.erb
|