예제 #1
0
    def __reset_node(self, cluster_util, cluster, node, crash_warning=False):
        shell = RemoteMachineShellConnection(node)
        rest = RestConnection(node)
        try:
            if '.com' in node.ip or ':' in node.ip:
                _ = rest.update_autofailover_settings(False, 120)
                cli = CouchbaseCLI(node, node.rest_username,
                                   node.rest_password)
                output, err, result = cli.set_address_family("ipv6")
                if not result:
                    raise Exception("Addr family was not changed to ipv6")
                _ = rest.update_autofailover_settings(True, 120)
            else:
                # Start node
                data_path = rest.get_data_path()
                core_path = \
                    str(rest.get_data_path()).split("data")[0] + "crash/"
                if not os.path.isdir(core_path):
                    core_path = "/opt/couchbase/var/lib/couchbase/crash/"

                # Stop node
                cluster_util.stop_server(cluster, node)
                # Delete Path
                shell.cleanup_data_config(data_path)
                if not crash_warning:
                    shell.cleanup_data_config(core_path)

                cluster_util.start_server(cluster, node)
                if not RestConnection(node).is_ns_server_running():
                    self.log.error("%s ns_server not running" % node.ip)
        except Exception as e:
            self.log.critical(e)
        finally:
            shell.disconnect()
예제 #2
0
    def reset_cluster(self, crash_warning=False):
        try:
            for node in self.cluster.servers:
                shell = RemoteMachineShellConnection(node)
                # Start node
                rest = RestConnection(node)
                data_path = rest.get_data_path()
                core_path = str(rest.get_data_path()).split("data")[0] + "crash/"
                if not os.path.isdir(core_path):
                    core_path = "/opt/couchbase/var/lib/couchbase/crash/"

                # Stop node
                self.stop_server(node)
                # Delete Path
                shell.cleanup_data_config(data_path)
                if not crash_warning:
                    shell.cleanup_data_config(core_path)

                self.start_server(node)
                if '.com' in node.ip or ':' in node.ip:
                    shell.update_dist_type()
                shell.disconnect()
            # Wait after reset of cluster nodes
            sleep(10)
        except Exception, ex:
            self.log.error(ex)
예제 #3
0
 def reset_cluster(self):
     try:
         for node in self.cluster.servers:
             shell = RemoteMachineShellConnection(node)
             # Start node
             rest = RestConnection(node)
             data_path = rest.get_data_path()
             # Stop node
             self.stop_server(node)
             # Delete Path
             shell.cleanup_data_config(data_path)
             self.start_server(node)
         time.sleep(10)
     except Exception, ex:
         self.log.info(ex)
예제 #4
0
파일: Collections.py 프로젝트: umang-cb/TAF
 def wipe_config_on_removed_nodes(self, remove_nodes):
     """
     Stop servers on nodes that were failed over and removed, and wipe config dir
     """
     for node in remove_nodes:
         self.log.info("Wiping node config and restarting server on {0}".format(node))
         rest = RestConnection(node)
         data_path = rest.get_data_path()
         shell = RemoteMachineShellConnection(node)
         shell.stop_couchbase()
         self.sleep(10)
         shell.cleanup_data_config(data_path)
         shell.start_server()
         self.sleep(10)
         if not RestHelper(rest).is_ns_server_running():
             self.log.error("ns_server {0} is not running.".format(node.ip))
         shell.disconnect()
예제 #5
0
    def reset_cluster(self):
        try:
            for node in self.cluster.servers:
                shell = RemoteMachineShellConnection(node)
                # Start node
                rest = RestConnection(node)
                data_path = rest.get_data_path()
                core_path = str(
                    rest.get_data_path()).split("data")[0] + "crash/"
                # Stop node
                self.stop_server(node)
                # Delete Path
                shell.cleanup_data_config(data_path)
                shell.cleanup_data_config(core_path)

                self.start_server(node)
                shell.disconnect()
            time.sleep(10)
        except Exception, ex:
            self.log.error(ex)
예제 #6
0
    def reset_cluster(self):
        try:
            for node in self.cluster.servers:
                shell = RemoteMachineShellConnection(node)
                # Start node
                rest = RestConnection(node)
                data_path = rest.get_data_path()
                # Stop node
                shell.stop_server()
                # Delete Path
                shell.cleanup_data_config(data_path)
                shell.start_server()

                # If Ipv6 update dist_cfg file post server restart
                # to change distribution to IPv6
                if '.com' in node.ip or ':' in node.ip:
                    self.log.info("Updating dist_cfg for IPv6 Machines")
                    shell.update_dist_type()
            self.sleep(10)
        except Exception, ex:
            self.log.info(ex)