Merge lp:~samuel-cozannet/charms/trusty/hdp-storm/config into lp:~bigdata-dev/charms/trusty/hdp-storm/trunk

Proposed by Samuel Cozannet
Status: Needs review
Proposed branch: lp:~samuel-cozannet/charms/trusty/hdp-storm/config
Merge into: lp:~bigdata-dev/charms/trusty/hdp-storm/trunk
Diff against target: 339 lines (+232/-23)
5 files modified
files/scripts/storm.yaml (+199/-2)
hooks/bdutils.py (+20/-17)
hooks/common.py (+4/-0)
hooks/install (+6/-1)
tests/10-deploy (+3/-3)
To merge this branch: bzr merge lp:~samuel-cozannet/charms/trusty/hdp-storm/config
Reviewer Review Type Date Requested Status
Juju Big Data Development Pending
Review via email: mp+244340@code.launchpad.net

Description of the change

Updated the storm.yaml file provided with the default Apache configuration file.
Commented everything but the required lines, and added netty settings to make them smoother for AWS

To post a comment you must log in.
20. By Samuel Cozannet <email address hidden>

replacing default http java libs by 4.3.2 versions

21. By Samuel Cozannet <email address hidden>

moving java lib installation to a later process for idempotence

22. By Samuel Cozannet <email address hidden>

merging changes for jps

Unmerged revisions

22. By Samuel Cozannet <email address hidden>

merging changes for jps

21. By Samuel Cozannet <email address hidden>

moving java lib installation to a later process for idempotence

20. By Samuel Cozannet <email address hidden>

replacing default http java libs by 4.3.2 versions

19. By Samuel Cozannet <email address hidden>

Reusing previous commit (update to default configuration file)

18. By Samuel Cozannet <email address hidden>

improving the default configuration file provided with the charm

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'files/scripts/storm.yaml'
2--- files/scripts/storm.yaml 2014-09-03 04:10:49 +0000
3+++ files/scripts/storm.yaml 2015-02-26 13:19:33 +0000
4@@ -1,5 +1,202 @@
5+# Licensed to the Apache Software Foundation (ASF) under one
6+# or more contributor license agreements. See the NOTICE file
7+# distributed with this work for additional information
8+# regarding copyright ownership. The ASF licenses this file
9+# to you under the Apache License, Version 2.0 (the
10+# "License"); you may not use this file except in compliance
11+# with the License. You may obtain a copy of the License at
12+#
13+# http://www.apache.org/licenses/LICENSE-2.0
14+#
15+# Unless required by applicable law or agreed to in writing, software
16+# distributed under the License is distributed on an "AS IS" BASIS,
17+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+# See the License for the specific language governing permissions and
19+# limitations under the License.
20+
21+
22+########### These all have default values as shown
23+########### Additional configuration goes into storm.yaml
24+
25+# java.library.path: "/usr/local/lib:/opt/local/lib:/usr/lib"
26+
27+### storm.* configs are general configurations
28+# the local dir is where jars are kept
29+storm.local.dir: $STORM_LOCAL_DIR
30 storm.zookeeper.servers:
31+#storm.zookeeper.port: 2181
32+#storm.zookeeper.root: "/storm"
33+#storm.zookeeper.session.timeout: 20000
34+#storm.zookeeper.connection.timeout: 15000
35+#storm.zookeeper.retry.times: 5
36+#storm.zookeeper.retry.interval: 1000
37+#storm.zookeeper.retry.intervalceiling.millis: 30000
38+#storm.zookeeper.auth.user: null
39+#storm.zookeeper.auth.password: null
40+#storm.cluster.mode: "distributed" # can be distributed or local
41+#storm.local.mode.zmq: false
42+#storm.thrift.transport: "backtype.storm.security.auth.SimpleTransportPlugin"
43+#storm.principal.tolocal: "backtype.storm.security.auth.DefaultPrincipalToLocal"
44+#storm.group.mapping.service: "backtype.storm.security.auth.ShellBasedGroupsMapping"
45+#storm.messaging.transport: "backtype.storm.messaging.netty.Context"
46+#storm.nimbus.retry.times: 5
47+#storm.nimbus.retry.interval.millis: 2000
48+#storm.nimbus.retry.intervalceiling.millis: 60000
49+#storm.auth.simple-white-list.users: []
50+#storm.auth.simple-acl.users: []
51+#storm.auth.simple-acl.users.commands: []
52+#storm.auth.simple-acl.admins: []
53+#storm.meta.serialization.delegate: "backtype.storm.serialization.DefaultSerializationDelegate"
54+
55+### nimbus.* configs are for the master
56 nimbus.host:
57+#nimbus.thrift.port: 6627
58+#nimbus.thrift.threads: 64
59+#nimbus.thrift.max_buffer_size: 1048576
60+#nimbus.childopts: "-Xmx1024m"
61+#nimbus.task.timeout.secs: 30
62+#nimbus.supervisor.timeout.secs: 60
63+#nimbus.monitor.freq.secs: 10
64+#nimbus.cleanup.inbox.freq.secs: 600
65+#nimbus.inbox.jar.expiration.secs: 3600
66+#nimbus.task.launch.secs: 120
67+#nimbus.reassign: true
68+#nimbus.file.copy.expiration.secs: 600
69+#nimbus.topology.validator: "backtype.storm.nimbus.DefaultTopologyValidator"
70+#nimbus.credential.renewers.freq.secs: 600
71+
72+### ui.* configs are for the master
73+#ui.port: 8080
74+#ui.childopts: "-Xmx768m"
75+#ui.actions.enabled: true
76+#ui.filter: null
77+#ui.filter.params: null
78+#ui.users: null
79+#ui.header.buffer.bytes: 4096
80+#ui.http.creds.plugin: backtype.storm.security.auth.DefaultHttpCredentialsPlugin
81+
82+logviewer.port: 8081
83+#logviewer.childopts: "-Xmx128m"
84+#logviewer.cleanup.age.mins: 10080
85+#logviewer.appender.name: "A1"
86+
87+#logs.users: null
88+
89 drpc.servers:
90-storm.local.dir: $STORM_LOCAL_DIR
91-logviewer.port: 8081
92+#drpc.port: 3772
93+#drpc.worker.threads: 64
94+#drpc.max_buffer_size: 1048576
95+#drpc.queue.size: 128
96+#drpc.invocations.port: 3773
97+#drpc.invocations.threads: 64
98+#drpc.request.timeout.secs: 600
99+#drpc.childopts: "-Xmx768m"
100+#drpc.http.port: 3774
101+#drpc.https.port: -1
102+#drpc.https.keystore.password: ""
103+#drpc.https.keystore.type: "JKS"
104+#drpc.http.creds.plugin: backtype.storm.security.auth.DefaultHttpCredentialsPlugin
105+#drpc.authorizer.acl.filename: "drpc-auth-acl.yaml"
106+#drpc.authorizer.acl.strict: false
107+
108+#transactional.zookeeper.root: "/transactional"
109+#transactional.zookeeper.servers: null
110+#transactional.zookeeper.port: null
111+
112+### supervisor.* configs are for node supervisors
113+# Define the amount of workers that can be run on this machine. Each worker is assigned a port to use for communication
114+#supervisor.slots.ports:
115+# - 6700
116+# - 6701
117+# - 6702
118+# - 6703
119+#supervisor.childopts: "-Xmx256m"
120+#supervisor.run.worker.as.user: false
121+#how long supervisor will wait to ensure that a worker process is started
122+#supervisor.worker.start.timeout.secs: 120
123+#how long between heartbeats until supervisor considers that worker dead and tries to restart it
124+#supervisor.worker.timeout.secs: 30
125+#how frequently the supervisor checks on the status of the processes it's monitoring and restarts if necessary
126+#supervisor.monitor.frequency.secs: 3
127+#how frequently the supervisor heartbeats to the cluster state (for nimbus)
128+#supervisor.heartbeat.frequency.secs: 5
129+#supervisor.enable: true
130+#supervisor.supervisors: []
131+#supervisor.supervisors.commands: []
132+
133+
134+### worker.* configs are for task workers
135+#worker.childopts: "-Xmx768m"
136+#worker.gc.childopts: ""
137+#worker.heartbeat.frequency.secs: 1
138+
139+# control how many worker receiver threads we need per worker
140+#topology.worker.receiver.thread.count: 1
141+
142+#task.heartbeat.frequency.secs: 3
143+#task.refresh.poll.secs: 10
144+#task.credentials.poll.secs: 30
145+
146+#zmq.threads: 1
147+#zmq.linger.millis: 5000
148+#zmq.hwm: 0
149+
150+
151+#storm.messaging.netty.server_worker_threads: 1
152+#storm.messaging.netty.client_worker_threads: 1
153+#storm.messaging.netty.buffer_size: 5242880 #5MB buffer
154+# Since nimbus.task.launch.secs and supervisor.worker.start.timeout.secs are 120, other workers should also wait at least that long before giving up on connecting to the other worker.
155+storm.messaging.netty.max_retries: 300
156+storm.messaging.netty.max_wait_ms: 2000
157+storm.messaging.netty.min_wait_ms: 100
158+
159+# If the Netty messaging layer is busy(netty internal buffer not writable), the Netty client will try to batch message as more as possible up to the size of storm.messaging.netty.transfer.batch.size bytes, otherwise it will try to flush message as soon as possible to reduce latency.
160+#storm.messaging.netty.transfer.batch.size: 262144
161+
162+# We check with this interval that whether the Netty channel is writable and try to write pending messages if it is.
163+#storm.messaging.netty.flush.check.interval.ms: 10
164+
165+# By default, the Netty SASL authentication is set to false. Users can override and set it true for a specific topology.
166+#storm.messaging.netty.authentication: false
167+
168+# default number of seconds group mapping service will cache user group
169+#storm.group.mapping.service.cache.duration.secs: 120
170+
171+### topology.* configs are for specific executing storms
172+#topology.enable.message.timeouts: true
173+#topology.debug: false
174+#topology.workers: 1
175+#topology.acker.executors: null
176+#topology.tasks: null
177+# maximum amount of time a message has to complete before it's considered failed
178+#topology.message.timeout.secs: 30
179+#topology.multilang.serializer: "backtype.storm.multilang.JsonSerializer"
180+#topology.skip.missing.kryo.registrations: false
181+#topology.max.task.parallelism: null
182+#topology.max.spout.pending: null
183+#topology.state.synchronization.timeout.secs: 60
184+#topology.stats.sample.rate: 0.05
185+#topology.builtin.metrics.bucket.size.secs: 60
186+#topology.fall.back.on.java.serialization: true
187+#topology.worker.childopts: null
188+#topology.executor.receive.buffer.size: 1024 #batched
189+#topology.executor.send.buffer.size: 1024 #individual messages
190+#topology.receiver.buffer.size: 8 # setting it too high causes a lot of problems (heartbeat thread gets starved, throughput plummets)
191+#topology.transfer.buffer.size: 1024 # batched
192+#topology.tick.tuple.freq.secs: null
193+#topology.worker.shared.thread.pool.size: 4
194+#topology.disruptor.wait.strategy: "com.lmax.disruptor.BlockingWaitStrategy"
195+#topology.spout.wait.strategy: "backtype.storm.spout.SleepSpoutWaitStrategy"
196+#topology.sleep.spout.wait.strategy.time.ms: 1
197+#topology.error.throttle.interval.secs: 10
198+#topology.max.error.report.per.interval: 5
199+#topology.kryo.factory: "backtype.storm.serialization.DefaultKryoFactory"
200+#topology.tuple.serializer: "backtype.storm.serialization.types.ListDelegateSerializer"
201+#topology.trident.batch.emit.interval.millis: 500
202+#topology.testing.always.try.serialize: false
203+#topology.classpath: null
204+#topology.environment: null
205+#topology.bolts.outgoing.overflow.buffer.enable: false
206+
207+#dev.zookeeper.path: "/tmp/dev-storm-zookeeper"
208+
209
210=== added directory 'files/usr'
211=== added directory 'files/usr/lib'
212=== added directory 'files/usr/lib/storm'
213=== added directory 'files/usr/lib/storm/lib'
214=== added file 'files/usr/lib/storm/lib/httpclient-4.3.2.jar'
215Binary files files/usr/lib/storm/lib/httpclient-4.3.2.jar 1970-01-01 00:00:00 +0000 and files/usr/lib/storm/lib/httpclient-4.3.2.jar 2015-02-26 13:19:33 +0000 differ
216=== added file 'files/usr/lib/storm/lib/httpcore-4.3.2.jar'
217Binary files files/usr/lib/storm/lib/httpcore-4.3.2.jar 1970-01-01 00:00:00 +0000 and files/usr/lib/storm/lib/httpcore-4.3.2.jar 2015-02-26 13:19:33 +0000 differ
218=== added directory 'files/usr/lib/zookeeper'
219=== added directory 'files/usr/lib/zookeeper/lib'
220=== added file 'files/usr/lib/zookeeper/lib/httpclient-4.3.2.jar'
221Binary files files/usr/lib/zookeeper/lib/httpclient-4.3.2.jar 1970-01-01 00:00:00 +0000 and files/usr/lib/zookeeper/lib/httpclient-4.3.2.jar 2015-02-26 13:19:33 +0000 differ
222=== added file 'files/usr/lib/zookeeper/lib/httpcore-4.3.2.jar'
223Binary files files/usr/lib/zookeeper/lib/httpcore-4.3.2.jar 1970-01-01 00:00:00 +0000 and files/usr/lib/zookeeper/lib/httpcore-4.3.2.jar 2015-02-26 13:19:33 +0000 differ
224=== modified file 'hooks/bdutils.py'
225--- hooks/bdutils.py 2014-09-03 04:10:49 +0000
226+++ hooks/bdutils.py 2015-02-26 13:19:33 +0000
227@@ -1,4 +1,5 @@
228 #!/usr/bin/python
229+import re
230 import os
231 import pwd
232 import grp
233@@ -133,28 +134,30 @@
234 m = ll[0]+" = "+ll[1].strip().strip(';').strip("\"").strip()
235 #log ("==> {} ".format("\""+m+"\""))
236 os.environ[ll[0]] = ll[1].strip().strip(';').strip("\"").strip()
237-
238+
239+
240+def jps(name):
241+ """
242+ Get PIDs for named Java processes, for any user.
243+ """
244+ pat = re.sub(r'^(.)', r'^[^ ]*java .*[\1]', name)
245+ try:
246+ output = subprocess.check_output(['sudo', 'pgrep', '-f', pat])
247+ except subprocess.CalledProcessError:
248+ return []
249+ return map(int, filter(None, map(str.strip, output.split('\n'))))
250+
251+
252 def is_jvm_service_active(processname):
253- cmd=["jps"]
254- p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
255- out, err = p.communicate()
256- if err == None and str(out).find(processname) != -1:
257- return True
258- else:
259- return False
260+ return jps(processname) != []
261+
262
263 def kill_java_process(process):
264- cmd=["jps"]
265- p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
266- out, err = p.communicate()
267- cmd = out.split()
268- for i in range(0, len(cmd)):
269- if cmd[i] == process:
270- pid = int(cmd[i-1])
271- os.kill(pid, signal.SIGTERM)
272+ for pid in jps(process):
273+ os.kill(pid, signal.SIGTERM)
274 return 0
275
276 def mergeFiles(file1, file2):
277 with open(file1, 'a') as f1:
278 with open(file2) as f2:
279- f1.write(f2.read())
280\ No newline at end of file
281+ f1.write(f2.read())
282
283=== modified file 'hooks/common.py'
284--- hooks/common.py 2014-11-12 15:51:11 +0000
285+++ hooks/common.py 2015-02-26 13:19:33 +0000
286@@ -9,3 +9,7 @@
287 storm_local_dir = os.path.join(os.path.sep, 'tmp', 'storm', 'local')
288 storm_data_dir = os.path.join(os.path.sep, 'home', 'storm')
289 hosts_path = os.path.join(os.path.sep, 'etc', 'hosts')
290+
291+java_libs = [ [ 'httpcore', '4.3.2' ], [ 'httpclient', '4.3.2' ] ]
292+java_apps = [ 'storm', 'zookeeper' ]
293+
294
295=== modified file 'hooks/install'
296--- hooks/install 2014-11-12 15:51:11 +0000
297+++ hooks/install 2015-02-26 13:19:33 +0000
298@@ -22,7 +22,12 @@
299 setDirPermission(com.storm_data_dir, "storm", "storm", 0755)
300 copy(com.storm_yaml, com.storm_conf_path)
301 fileSetKV(com.storm_yaml_path, "storm.local.dir: ", com.storm_local_dir)
302-
303+ for app in com.java_apps:
304+ for lib in com.java_libs:
305+ target_path = os.path.join('usr', 'lib', app, 'lib')
306+ source_path = os.path.join(os.environ['CHARM_DIR'], 'files', target_path, lib[0] + '-' + lib[1] + '.jar' )
307+ os.system('rm -f '+ '/' + target_path + '/' + lib[0] + '*.jar')
308+ copy(source_path, '/' + target_path)
309
310 hooks = hookenv.Hooks()
311 log = hookenv.log
312
313=== modified file 'tests/10-deploy'
314--- tests/10-deploy 2014-09-19 22:54:54 +0000
315+++ tests/10-deploy 2015-02-26 13:19:33 +0000
316@@ -28,7 +28,7 @@
317 getattr(self, test)()
318
319 def test_zookeeper_service_status(self):
320- o,c= self.zk_unit.run("jps | awk '{print $2}'")
321+ o,c= self.zk_unit.run("pgrep -a java")
322 if o.find('QuorumPeerMain') == -1:
323 amulet.raise_status(amulet.FAIL, msg="Zookeeper QuorumPeerMain not started")
324
325@@ -51,13 +51,13 @@
326 if (time.time() - ticks) > 300:
327 amulet.raise_status(amulet.FAIL, msg="nimbus-server is not started")
328 break
329- o,c= self.st_unit.run("jps | awk '{print $2}'")
330+ o,c= self.st_unit.run("pgrep -a java")
331 if o.find('nimbus') != -1:
332 break
333 time.sleep(2)
334
335 def test_storm_slave_service_status(self):
336- o,c= self.st_slave_unit.run("jps | awk '{print $2}'")
337+ o,c= self.st_slave_unit.run("pgrep -a java")
338 if o.find('supervisor') == -1:
339 amulet.raise_status(amulet.FAIL, msg="supervisor is not started")
340

Subscribers

People subscribed via source and target branches