-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.rb
61 lines (49 loc) · 2.09 KB
/
default.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Copyright 2014 N3TWORK, Inc.
#
# Licensed under Apache 2.0 - see the LICENSE file
include_recipe "apt"
# Install zookeeper
node.set[:exhibitor][:opts][:port] = 8000
include_recipe "zookeeper::default"
node.set['mysql']['server_root_password'] = ''
include_recipe "mysql::server"
# Create the druid db
include_recipe "database::mysql"
mysql_database 'druid' do
connection(
:host => 'localhost',
:username => 'root',
:password => node['mysql']['server_root_password']
)
action :create
end
# Configure Druid
node.set[:druid][:properties]['druid.zk.service.host'] = 'localhost'
node.set[:druid][:properties]['druid.db.connector.connectURI'] = 'jdbc:mysql://localhost/druid'
node.set[:druid][:properties]['druid.db.connector.user'] = 'root'
node.set[:druid][:properties]['druid.db.connector.password'] = node['mysql']['server_root_password']
node.set[:druid][:properties]['druid.computation.buffer.size'] = 10 * 1024 * 1024
# From Historical node quickstart http://druid.io/docs/latest/Historical-Config.html
node.set[:druid][:properties]['druid.server.maxSize'] = 10000000000
node.set[:druid][:properties]['druid.processing.buffer.sizeBytes'] = 100000000
node.set[:druid][:properties]['druid.processing.numThreads'] = 1
node.set[:druid][:properties]['druid.segmentCache.locations'] =
'[{"path": "/tmp/druid/indexCache", "maxSize": 10000000000}]'
# Realtime wikipedia example
node.set[:druid][:realtime][:properties]['druid.realtime.specFile'] =
"#{node[:druid][:install_dir]}/current/examples/wikipedia/wikipedia_realtime.spec"
# Install the Druid services
include_recipe "druid::historical"
include_recipe "druid::coordinator"
include_recipe "druid::broker"
include_recipe "druid::realtime"
package "curl" do
action :install
end
# Fix up the example client to point to our broker
execute "fix example client URL" do
command "sed -i 's|localhost:[0-9]*/druid/v2/?w|localhost:8080/druid/v2/?pretty|' #{node[:druid][:install_dir]}/current/run_example_client.sh"
end
execute "fix example client permissions" do
command "chmod 755 #{node[:druid][:install_dir]}/current/run_example_client.sh"
end