You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by li...@apache.org on 2017/01/22 05:35:03 UTC
[1/2] incubator-trafodion git commit: [TRAFODION-2454] pyinstaller:
don't restart all hdp services
Repository: incubator-trafodion
Updated Branches:
refs/heads/master 9bb8185bc -> 643f82ba5
[TRAFODION-2454] pyinstaller: don't restart all hdp services
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/6ac3516a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/6ac3516a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/6ac3516a
Branch: refs/heads/master
Commit: 6ac3516adc0723b074b826c3e8e4728d4b599fd7
Parents: ed2e4fa
Author: Eason <hf...@gmail.com>
Authored: Fri Jan 20 00:32:32 2017 +0800
Committer: Eason <hf...@gmail.com>
Committed: Fri Jan 20 00:32:32 2017 +0800
----------------------------------------------------------------------
install/python-installer/scripts/hadoop_mods.py | 45 +++++++++-----------
1 file changed, 19 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/6ac3516a/install/python-installer/scripts/hadoop_mods.py
----------------------------------------------------------------------
diff --git a/install/python-installer/scripts/hadoop_mods.py b/install/python-installer/scripts/hadoop_mods.py
index 945057b..d98989d 100755
--- a/install/python-installer/scripts/hadoop_mods.py
+++ b/install/python-installer/scripts/hadoop_mods.py
@@ -139,35 +139,28 @@ class HDPMod(object):
self.p.put(cluster_url, config)
def restart(self):
- srv_baseurl = CLUSTER_URL_PTR % (self.url, self.cluster_name) + '/services/'
- srvs = ['HBASE', 'HDFS', 'ZOOKEEPER']
-
- # Stop
info('Restarting HDP services ...')
- for srv in srvs:
- srv_url = srv_baseurl + srv
- config = {'RequestInfo': {'context' :'Stop %s services' % srv}, 'ServiceInfo': {'state' : 'INSTALLED'}}
- rc = self.p.put(srv_url, config)
-
- # check stop status
- if rc:
- get_stat = lambda: self.p.get(srv_url)['ServiceInfo']['state'] == 'INSTALLED'
- retry(get_stat, 30, 5, 'HDP service %s stop' % srv)
- else:
- info('HDP service %s had already been stopped' % srv)
+ def startstop(srvs, action, count, interval):
+ srv_baseurl = CLUSTER_URL_PTR % (self.url, self.cluster_name) + '/services/'
+ state = 'INSTALLED' if action == 'stop' else 'STARTED'
+ for srv in srvs:
+ srv_url = srv_baseurl + srv
+ config = {'RequestInfo': {'context' :'%s %s services' % (action, srv)}, 'ServiceInfo': {'state' : state}}
+ rc = self.p.put(srv_url, config)
+
+ # check startstop status
+ if rc:
+ get_stat = lambda: self.p.get(srv_url)['ServiceInfo']['state'] == state
+ retry(get_stat, count, interval, 'HDP service %s %s' % (srv, action))
+ else:
+ if action == 'stop': action += 'p'
+ info('HDP service %s had already been %sed' % (srv, action))
+ srvs = ['HBASE', 'HDFS', 'ZOOKEEPER']
+ startstop(srvs, 'stop', 30, 10)
time.sleep(10)
- # Start
- config = {'RequestInfo': {'context' :'Start All services'}, 'ServiceInfo': {'state' : 'STARTED'}}
- rc = self.p.put(srv_baseurl, config)
-
- # check start status
- if rc:
- result_url = rc['href']
- get_stat = lambda: self.p.get(result_url)['Requests']['request_status'] == 'COMPLETED'
- retry(get_stat, 120, 5, 'HDP services start')
- else:
- info('HDP services had already been started')
+ srvs.reverse()
+ startstop(srvs, 'start', 60, 10)
def run():
if 'CDH' in dbcfgs['distro']:
[2/2] incubator-trafodion git commit: Merge Fix for [TRAFODION-2454]
pyinstaller: don't restart all hdp services
Posted by li...@apache.org.
Merge Fix for [TRAFODION-2454] pyinstaller: don't restart all hdp services
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/643f82ba
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/643f82ba
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/643f82ba
Branch: refs/heads/master
Commit: 643f82ba5404dceda646a013a7b0132cd3ba3c34
Parents: 9bb8185 6ac3516
Author: Liu Ming <ov...@sina.com>
Authored: Sun Jan 22 05:34:37 2017 +0000
Committer: Liu Ming <ov...@sina.com>
Committed: Sun Jan 22 05:34:37 2017 +0000
----------------------------------------------------------------------
install/python-installer/scripts/hadoop_mods.py | 45 +++++++++-----------
1 file changed, 19 insertions(+), 26 deletions(-)
----------------------------------------------------------------------