Commit 507993c4 authored by Łukasz Nowak's avatar Łukasz Nowak

Use declarative way to install Zeo cluster.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@45775 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 924f5362
...@@ -499,30 +499,47 @@ class Recipe(BaseSlapRecipe): ...@@ -499,30 +499,47 @@ class Recipe(BaseSlapRecipe):
bt5_repository_list])) bt5_repository_list]))
return [] return []
def installZeo(self, ip, port, name, path): def installZeo(self, ip):
zeo_event_log = os.path.join(self.log_directory, 'zeo.log') zodb_dir = os.path.join(self.data_root_directory, 'zodb')
zeo_pid = os.path.join(self.run_directory, 'zeo.pid') self._createDirectory(zodb_dir)
self.registerLogRotation('zeo', [zeo_event_log], zeo_configuration_list = []
self.killpidfromfile + ' ' + zeo_pid + ' SIGUSR2') zeo_number = 0
config = dict( for zeo_server in sorted(self._zeo_storage_dict.iterkeys()):
zeo_ip=ip, zeo_number += 1
zeo_port=port, zeo_event_log = os.path.join(self.log_directory, 'zeo-%s.log'% zeo_number)
zeo_storagename=name, zeo_pid = os.path.join(self.run_directory, 'zeo-%s.pid'% zeo_number)
zeo_event_log=zeo_event_log, self.registerLogRotation('zeo', [zeo_event_log],
zeo_pid=zeo_pid, self.killpidfromfile + ' ' + zeo_pid + ' SIGUSR2')
zeo_zodb=path config = dict(
) zeo_ip=ip,
zeo_conf_path = self.createConfigurationFile('zeo.conf', zeo_port=self._zeo_storage_port_dict[zeo_server],
self.substituteTemplate(self.getTemplateFilename('zeo.conf.in'), config)) zeo_event_log=zeo_event_log,
self.path_list.append(zeo_conf_path) zeo_pid=zeo_pid,
wrapper = zc.buildout.easy_install.scripts([('zeo', __name__ + '.execute', )
'execute')], self.ws, sys.executable, self.wrapper_directory, arguments=[ storage_number = 0
self.options['runzeo_binary'].strip(), '-C', zeo_conf_path] storage_definition_list = []
)[0] for storage_name in sorted(self._zeo_storage_dict[zeo_server]):
self.path_list.append(wrapper) storage_number += 1
return dict( path = os.path.join(zodb_dir, 'zodb_%s.fs' % storage_number)
zeo_address='%s:%s' % (config['zeo_ip'], config['zeo_port']), storage_definition_list.append("""<filestorage %(storage_name)s>
zeo_storagename=config['zeo_storagename']) path %(path)s
</filestorage>"""% dict(storage_name=storage_name, path=path))
zeo_configuration_list.append(dict(
ip=ip,
port=config['zeo_port'],
path=path,
storage_name=storage_name,
))
config['zeo_filestorage_snippet'] = '\n'.join(storage_definition_list)
zeo_conf_path = self.createConfigurationFile('zeo-%s.conf' % zeo_number,
self.substituteTemplate(self.getTemplateFilename('zeo.conf.in'), config))
self.path_list.append(zeo_conf_path)
wrapper = zc.buildout.easy_install.scripts([('zeo', __name__ + '.execute',
'execute')], self.ws, sys.executable, self.wrapper_directory, arguments=[
self.options['runzeo_binary'].strip(), '-C', zeo_conf_path]
)[0]
self.path_list.append(wrapper)
return zeo_configuration_list
def installZope(self, ip, port, name, zeo_address=None, zeo_storagename=None, def installZope(self, ip, port, name, zeo_address=None, zeo_storagename=None,
zodb_root_path=None, with_timerservice=False): zodb_root_path=None, with_timerservice=False):
......
...@@ -6,9 +6,7 @@ ...@@ -6,9 +6,7 @@
pid-filename %(zeo_pid)s pid-filename %(zeo_pid)s
</zeo> </zeo>
<filestorage %(zeo_storagename)s> %(zeo_filestorage_snippet)s
path %(zeo_zodb)s
</filestorage>
<eventlog> <eventlog>
<logfile> <logfile>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment