Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trusty support #549

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 37 additions & 3 deletions starcluster/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ def __init__(self, instance, key_location, alias=None, user='root'):
self._groups = None
self._ssh = None
self._num_procs = None
self._nfs_service_name = None
self._rpcbind_service_name = None
self._memory = None
self._user_data = None

Expand Down Expand Up @@ -229,6 +231,38 @@ def num_processors(self):
'cat /proc/cpuinfo | grep processor | wc -l')[0])
return self._num_procs

@property
def nfs_service_name(self):
"""
Determine whether the system uses 'nfs-kernel-server' to name
the NFS service, or whether it uses the legacy 'nfs' name.
"""
if not self._nfs_service_name:
try:
self.ssh.execute(
'test -e /etc/init.d/nfs-kernel-server',
raise_on_failure=True)
self._nfs_service_name = 'nfs-kernel-server'
except exception.SSHError:
self._nfs_service_name = 'nfs'
return self._nfs_service_name

@property
def rpcbind_service_name(self):
"""
Determine whether the system uses 'rpcbind' to name the RPC
service, or whether it uses the legacy 'portmap' name.
"""
if not self._rpcbind_service_name:
try:
self.ssh.execute(
'test -e /etc/init.d/rpcbind',
raise_on_failure=True)
self._rpcbind_service_name = 'rpcbind'
except exception.SSHError:
self._rpcbind_service_name = 'portmap'
return self._rpcbind_service_name

@property
def memory(self):
if not self._memory:
Expand Down Expand Up @@ -702,7 +736,7 @@ def stop_exporting_fs_to_nodes(self, nodes, paths=None):

def start_nfs_server(self):
log.info("Starting NFS server on %s" % self.alias)
self.ssh.execute('/etc/init.d/portmap start', ignore_exit_status=True)
self.ssh.execute('service %s restart' % self.rpcbind_service_name)
self.ssh.execute('mount -t rpc_pipefs sunrpc /var/lib/nfs/rpc_pipefs/',
ignore_exit_status=True)
EXPORTSD = '/etc/exports.d'
Expand All @@ -716,7 +750,7 @@ def start_nfs_server(self):
self.ssh.execute("mkdir -p %s" % DUMMY_EXPORT_DIR)
with self.ssh.remote_file(DUMMY_EXPORT_FILE, 'w') as dummyf:
dummyf.write(DUMMY_EXPORT_LINE)
self.ssh.execute('/etc/init.d/nfs start')
self.ssh.execute('service %s restart' % self.nfs_service_name)
self.ssh.execute('rm -f %s' % DUMMY_EXPORT_FILE)
self.ssh.execute('rm -rf %s' % DUMMY_EXPORT_DIR)
self.ssh.execute('exportfs -fra')
Expand All @@ -728,7 +762,7 @@ def mount_nfs_shares(self, server_node, remote_paths):
server_node - remote server node that is sharing the remote_paths
remote_paths - list of remote paths to mount from server_node
"""
self.ssh.execute('/etc/init.d/portmap start')
self.ssh.execute('service %s restart' % self.rpcbind_service_name)
# TODO: move this fix for xterm somewhere else
self.ssh.execute('mount -t devpts none /dev/pts',
ignore_exit_status=True)
Expand Down
2 changes: 1 addition & 1 deletion starcluster/plugins/condor.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def _add_condor_node(self, node):
config_vals = ['$(condor_config_val %s)' % var for var in config_vars]
node.ssh.execute('mkdir -p %s' % ' '.join(config_vals))
node.ssh.execute('chown -R condor:condor %s' % ' '.join(config_vals))
node.ssh.execute('/etc/init.d/condor start')
node.ssh.execute('service condor start')

def _setup_condor(self, master=None, nodes=None):
log.info("Setting up Condor grid")
Expand Down
10 changes: 5 additions & 5 deletions starcluster/plugins/hadoop.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,23 +279,23 @@ def _setup_hadoop_dir(self, node, path, user, group, permission="775"):
node.ssh.execute("chmod -R %s %s" % (permission, path))

def _start_datanode(self, node):
node.ssh.execute('/etc/init.d/hadoop-0.20-datanode restart')
node.ssh.execute('service hadoop-0.20-datanode restart')

def _start_tasktracker(self, node):
node.ssh.execute('/etc/init.d/hadoop-0.20-tasktracker restart')
node.ssh.execute('service hadoop-0.20-tasktracker restart')

def _start_hadoop(self, master, nodes):
log.info("Starting namenode...")
master.ssh.execute('/etc/init.d/hadoop-0.20-namenode restart')
master.ssh.execute('service hadoop-0.20-namenode restart')
log.info("Starting secondary namenode...")
master.ssh.execute('/etc/init.d/hadoop-0.20-secondarynamenode restart')
master.ssh.execute('service hadoop-0.20-secondarynamenode restart')
log.info("Starting datanode on all nodes...")
for node in nodes:
self.pool.simple_job(self._start_datanode, (node,),
jobid=node.alias)
self.pool.wait()
log.info("Starting jobtracker...")
master.ssh.execute('/etc/init.d/hadoop-0.20-jobtracker restart')
master.ssh.execute('service hadoop-0.20-jobtracker restart')
log.info("Starting tasktracker on all nodes...")
for node in nodes:
self.pool.simple_job(self._start_tasktracker, (node,),
Expand Down
12 changes: 6 additions & 6 deletions starcluster/plugins/mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ class MysqlCluster(DefaultClusterSetup):
2. chown -R mysql:mysql /var/lib/mysql-cluster/
3. generate ndb-mgmd for master
4. generate my.cnf for data nodes
5. /etc/init.d/mysql-ndb-mgm restart on master
5. service mysql-ndb-mgm restart on master
6. pkill -9 mysql on data nodes
7. /etc/init.d/mysql start on data nodes
8. /etc/init.d/mysql-ndb restart on data nodes
7. service mysql start on data nodes
8. service mysql-ndb restart on data nodes

Correction to above, do this:
1. define plugin section in config named mysql
Expand Down Expand Up @@ -279,19 +279,19 @@ def run(self, nodes, master, user, user_shell, volumes):
self.pool.wait(len(nodes))
# Restart mysql-ndb-mgm on master
log.info('Restarting mysql-ndb-mgm on master node...')
mconn.execute('/etc/init.d/mysql-ndb-mgm restart')
mconn.execute('service mysql-ndb-mgm restart')
# Start mysqld-ndb on data nodes
log.info('Restarting mysql-ndb on all data nodes...')
for node in self.data_nodes:
self.pool.simple_job(node.ssh.execute,
('/etc/init.d/mysql-ndb restart'),
('service mysql-ndb restart'),
jobid=node.alias)
self.pool.wait(len(self.data_nodes))
# Start mysql on query nodes
log.info('Starting mysql on all query nodes')
for node in self.query_nodes:
self.pool.simple_job(node.ssh.execute,
('/etc/init.d/mysql restart'),
('service mysql restart'),
dict(ignore_exit_status=True),
jobid=node.alias)
self.pool.wait(len(self.query_nodes))
Expand Down