Exemplo n.º 1
0
    def configure(self, env, upgrade_type=None):
        import params

        # The configure command doesn't actually receive the upgrade_type from Script.py, so get it from the config dictionary
        if upgrade_type is None:
            upgrade_type = Script.get_upgrade_type(
                default("/commandParams/upgrade_type", ""))

        if upgrade_type is not None and params.upgrade_direction == Direction.UPGRADE and params.version is not None:
            Logger.info(
                format(
                    "Configuring Oozie during upgrade type: {upgrade_type}, direction: {params.upgrade_direction}, and version {params.version}"
                ))
            if params.version and check_stack_feature(
                    StackFeature.ROLLING_UPGRADE, params.version):
                # In order for the "<stack-root>/current/oozie-<client/server>" point to the new version of
                # oozie, we need to create the symlinks both for server and client.
                # This is required as both need to be pointing to new installed oozie version.

                # Sets the symlink : eg: <stack-root>/current/oozie-client -> <stack-root>/a.b.c.d-<version>/oozie
                stack_select.select("oozie-client", params.version)
                # Sets the symlink : eg: <stack-root>/current/oozie-server -> <stack-root>/a.b.c.d-<version>/oozie
                stack_select.select("oozie-server", params.version)

            if params.version and check_stack_feature(
                    StackFeature.CONFIG_VERSIONING, params.version):
                conf_select.select(params.stack_name, "oozie", params.version)

        env.set_params(params)
        oozie(is_server=True, upgrade_type=upgrade_type)
Exemplo n.º 2
0
  def configure(self, env, upgrade_type=None):
    import params

    # The configure command doesn't actually receive the upgrade_type from Script.py, so get it from the config dictionary
    if upgrade_type is None:
      restart_type = default("/commandParams/restart_type", "")
      if restart_type.lower() == "rolling_upgrade":
        upgrade_type = UPGRADE_TYPE_ROLLING
      elif restart_type.lower() == "nonrolling_upgrade":
        upgrade_type = UPGRADE_TYPE_NON_ROLLING

    if upgrade_type is not None and params.upgrade_direction == Direction.UPGRADE and params.version is not None:
      Logger.info(format("Configuring Oozie during upgrade type: {upgrade_type}, direction: {params.upgrade_direction}, and version {params.version}"))
      if compare_versions(format_stack_version(params.version), '2.2.0.0') >= 0:
        # In order for the "/usr/hdp/current/oozie-<client/server>" point to the new version of
        # oozie, we need to create the symlinks both for server and client.
        # This is required as both need to be pointing to new installed oozie version.

        # Sets the symlink : eg: /usr/hdp/current/oozie-client -> /usr/hdp/2.3.x.y-<version>/oozie
        stack_select.select("oozie-client", params.version)
        # Sets the symlink : eg: /usr/hdp/current/oozie-server -> /usr/hdp/2.3.x.y-<version>/oozie
        stack_select.select("oozie-server", params.version)

      if compare_versions(format_stack_version(params.version), '2.3.0.0') >= 0:
        conf_select.select(params.stack_name, "oozie", params.version)

    env.set_params(params)
    oozie(is_server=True)
Exemplo n.º 3
0
  def configure(self, env, upgrade_type=None):
    import params

    # The configure command doesn't actually receive the upgrade_type from Script.py, so get it from the config dictionary
    if upgrade_type is None:
      restart_type = default("/commandParams/restart_type", "")
      if restart_type.lower() == "rolling_upgrade":
        upgrade_type = UPGRADE_TYPE_ROLLING
      elif restart_type.lower() == "nonrolling_upgrade":
        upgrade_type = UPGRADE_TYPE_NON_ROLLING

    if upgrade_type is not None and params.upgrade_direction == Direction.UPGRADE and params.version is not None:
      Logger.info(format("Configuring Oozie during upgrade type: {upgrade_type}, direction: {params.upgrade_direction}, and version {params.version}"))
      if compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0:
        # In order for the "/usr/hdp/current/oozie-<client/server>" point to the new version of
        # oozie, we need to create the symlinks both for server and client.
        # This is required as both need to be pointing to new installed oozie version.

        # Sets the symlink : eg: /usr/hdp/current/oozie-client -> /usr/hdp/2.3.x.y-<version>/oozie
        hdp_select.select("oozie-client", params.version)
        # Sets the symlink : eg: /usr/hdp/current/oozie-server -> /usr/hdp/2.3.x.y-<version>/oozie
        hdp_select.select("oozie-server", params.version)

      if compare_versions(format_hdp_stack_version(params.version), '2.3.0.0') >= 0:
        conf_select.select(params.stack_name, "oozie", params.version)

    env.set_params(params)
    oozie(is_server=True)
Exemplo n.º 4
0
    def configure(self, env, upgrade_type=None):
        import params

        #TODO: needed?
        if upgrade_type == "nonrolling" and params.upgrade_direction == Direction.UPGRADE and \
                params.version and compare_versions(format_stack_version(params.version), '4.1.0.0') >= 0:
            # In order for the "/usr/hdp/current/oozie-<client/server>" point to the new version of
            # oozie, we need to create the symlinks both for server and client.
            # This is required as both need to be pointing to new installed oozie version.

            # Sets the symlink : eg: /usr/hdp/current/oozie-client -> /usr/hdp/2.3.x.y-<version>/oozie
            # Sets the symlink : eg: /usr/hdp/current/oozie-server -> /usr/hdp/2.3.x.y-<version>/oozie
            stack_select.select_packages(params.version)

        env.set_params(params)
        oozie(is_server=True)
Exemplo n.º 5
0
    def configure(self, env, upgrade_type=None):
        import params

        # The configure command doesn't actually receive the upgrade_type from Script.py, so get it from the config dictionary
        if upgrade_type is None:
            upgrade_type = Script.get_upgrade_type(
                default("/commandParams/upgrade_type", ""))

        if upgrade_type is not None and params.upgrade_direction == Direction.UPGRADE and params.version is not None:
            Logger.info(
                format(
                    "Configuring Oozie during upgrade type: {upgrade_type}, direction: {params.upgrade_direction}, and version {params.version}"
                ))
            if params.version and check_stack_feature(
                    StackFeature.ROLLING_UPGRADE, params.version):
                stack_select.select_packages(params.version)

        env.set_params(params)
        oozie(is_server=True, upgrade_type=upgrade_type)
Exemplo n.º 6
0
 def configure(self, env):
     import params
     env.set_params(params)
     oozie()
Exemplo n.º 7
0
 def configure(self, env):
   oozie()
Exemplo n.º 8
0
 def configure(self, env):
     import params
     env.set_params(params)
     oozie(action='config', is_server=True)
Exemplo n.º 9
0
 def start(self, env):
   import params
   env.set_params(params)
   self.configure(env)
   oozie(action='start')
Exemplo n.º 10
0
 def configure(self, env):
   import params
   env.set_params(params)
   oozie(action='config',is_server=True)
Exemplo n.º 11
0
 def install(self, env):
   self.install_packages(env)
   oozie(action='install')     
Exemplo n.º 12
0
 def status(self, env):
     import params
     env.set_params(params)
     oozie(action='status')
Exemplo n.º 13
0
 def stop(self, env):
     import params
     env.set_params(params)
     oozie(action='stop')
Exemplo n.º 14
0
 def start(self, env):
     import params
     env.set_params(params)
     self.configure(env)
     oozie(action='start')
Exemplo n.º 15
0
  def configure(self, env):
    import params
    env.set_params(params)

    oozie(is_server=False)
Exemplo n.º 16
0
 def configure(self, env):
   import params
   env.set_params(params)
   oozie()
Exemplo n.º 17
0
 def stop(self, env):
   import params
   env.set_params(params)
   oozie(action='stop')
Exemplo n.º 18
0
 def status(self, env):
   import params
   env.set_params(params)
   oozie(action='status')
Exemplo n.º 19
0
 def configure(self, env, upgrade_type=None):
     import params
     env.set_params(params)
     oozie(is_server=True)
Exemplo n.º 20
0
    def configure(self, env):
        import params
        env.set_params(params)

        oozie(is_server=False)
Exemplo n.º 21
0
 def install(self, env):
     self.install_packages(env)
     oozie(action='install')