Converting Agent Node Types

Converting agent nodes to public or private agent nodes.

You can convert agent nodes to public or private for an existing DC/OS cluster.

Agent nodes are designated as public or private during installation. By default, they are designated as private during GUI or CLI installation.

Prerequisites:

These steps must be performed on a machine that is configured as a DC/OS node. Any tasks that are running on the node will be terminated during this conversion process.

  1. Install DC/OS using the custom installation method.
  2. Deploy at least one master and one private agent node.
  • Retrieve the archived DC/OS installer file (dcos-install.tar) from your installation.
  • Install the CLI JSON processor jq.
  • Install and configure SSH. This is required to access nodes in the DC/OS cluster.

Determine the node type

You can determine the node type by running this command from the DC/OS CLI.

  • Run this command to determine how many private agents are there in the cluster. A result of 0 indicates that there are no private agents.

    1. dcos node --json | jq --raw-output '.[] | select(.reserved_resources.slave_public == null) | .id' | wc -l
  • Run this command to determine how many public agents are there in the cluster. A result of 0 indicates that there are no public agents.

    1. dcos node --json | jq --raw-output '.[] | select(.reserved_resources.slave_public != null) | .id' | wc -l

Uninstall the DC/OS private agent software

  1. Uninstall DC/OS on the agent node.

    1. sudo /opt/mesosphere/bin/dcos-shell
    2. sudo -i pkgpanda uninstall
    3. sudo systemctl stop dcos-mesos-slave
    4. sudo systemctl disable dcos-mesos-slave
  2. Remove the old directory structures on the agent node.

    1. sudo rm -rf /etc/mesosphere /opt/mesosphere /var/lib/mesos /var/lib/dcos
  3. Restart the machine.

    1. sudo reboot

Install DC/OS and convert agent node

  1. Copy the archived DC/OS installer file (dcos-install.tar) to the node that that is being converted. This archive is created during the GUI or CLI installation method.

  2. Copy the files to your agent node. For example, you can use Secure Copy (scp) to copy dcos-install.tar to your home directory:

    1. scp ~/dcos-install.tar $username@$node-ip:~/dcos-install.tar
  3. SSH to the machine:

    1. ssh $USER@$AGENT
  4. Create a directory for the installer files:

    1. sudo mkdir -p /opt/dcos_install_tmp
  5. Unpackage the dcos-install.tar file:

    1. sudo tar xf dcos-install.tar -C /opt/dcos_install_tmp
  6. Run this command to install DC/OS on your agent nodes. You must designate your agent nodes as public or private.

    Private agent nodes:

    1. sudo bash /opt/dcos_install_tmp/dcos_install.sh slave

    Public agent nodes:

    1. sudo bash /opt/dcos_install_tmp/dcos_install.sh slave_public