# SingleStore Toolbox Installation

## Install SingleStore Toolbox

Select a distribution type or method of installation from the options below.

* *Red Hat Distribution*

  ## Online InstallationFor online installations where you can access the SingleStore YUM repository, run the following steps.**Note**: These steps are also provided in the [self-managed deployment guides](https://docs.singlestore.com/db/v9.1/deploy.md).1) Add the SingleStore repository to your repository list.
     ```shell
     sudo yum-config-manager --add-repo https://release.memsql.com/production/rpm/x86_64/repodata/memsql.repo

     ```

  2) Verify that the SingleStore repo information is listed under `repolist`.
     ```shell
     sudo yum repolist

     ```

  3) Verify you have the `which` package installed. This is used during the install process to identify the correct package type for your installation.
     ```shell
     rpm -q which

     ```
     If `which` is not installed, you must install it before proceeding. If you cannot install `which`, you will have to specify the correct package during the deployment phase covered in the respective deployment guide.
     ```shell
     sudo yum install -y which

     ```

  4) To install Toolbox, run the following:
     ```shell
     sudo yum install -y singlestoredb-toolbox 

     ```## Offline InstallationFor clusters that must be deployed in an environment without Internet access, download the following SingleStore packages onto a device with access to the main deployment host.|   |   |
  | - | - |For offline installations, you only need to copy and install `singlestoredb-toolbox` onto the main deployment host as the `sdb-deploy` tool in `singlestoredb-toolbox` will be used to install the `singlestoredb-server` package onto each host in your cluster.```shell
  sudo rpm -ivh /tmp/singlestoredb-toolbox-<version>.x86_64.rpm

  ```

* *Debian Distribution*

  ## Online InstallationFor online installations where you can access the SingleStore APT repository, run the following steps.**Note**: These steps are also provided in the [self-managed deployment guides](https://docs.singlestore.com/db/v9.1/deploy.md).1) SingleStore packages are signed to ensure integrity, so the GPG key needs to be added to this host. When done, verify that the SingleStore signing key has been added using `apt-key list`.
     ```shell
     wget -O - 'https://release.memsql.com/release-aug2018.gpg' 2>/dev/null | sudo apt-key add - && apt-key list

     ```
     **Without using `apt-key`**:
     ```shell
     wget -q -O - 'https://release.memsql.com/release-aug2018.gpg' | sudo tee /etc/apt/trusted.gpg.d/memsql.asc 1>/dev/null
     ```

  2) Verify you have `apt-transport-https` installed.
     ```shell
     apt-cache policy apt-transport-https

     ```
     If `apt-transport-https` is not installed, you must install it before proceeding. `user-shell sudo apt -y install apt-transport-https`

  3) Add the SingleStore repository to retrieve its packages.
     ```shell
     echo "deb [arch=amd64] https://release.memsql.com/production/debian memsql main" | sudo tee /etc/apt/sources.list.d/memsql.list

     ```

  4) To install Toolbox, run the following:
     ```shell
     sudo apt update && sudo apt -y install singlestoredb-toolbox 

     ```## Offline InstallationFor clusters that must be deployed in an environment without Internet access, download the following SingleStore packages onto a device with access to the main deployment host.|   |   |
  | - | - |```shell
  sudo dpkg -i /tmp/singlestoredb-toolbox_<version>_amd64.deb

  ```

* *Tarball*

  ## Download SingleStore FilesDownload the following SingleStore tarball files onto a device with access to the main deployment host.|   |   |
  | - | - |## Transfer SingleStore FilesTransfer the `singlestoredb-toolbox` and `singlestoredb-server` tarball files into a dedicated `singlestore` directory that has been configured so that non-`sudo` users can access on the main deployment host, such as `/opt/singlestore`.## Unpack SingleStore Files**Note**: For the remainder of this document, `<version>-<commit-hash>` will be written simply as `<version>`.Unpack `singlestoredb-toolbox` into the `singlestore` directory.```shell
  tar xzvf singlestoredb-toolbox-<version>.tar.gz 

  ```You do not need to unpack the `singlestoredb-server` file in this step. It will be installed as part of deployment, which is shown in the next step.

## Upgrade SingleStore Toolbox

> **❗ Important**: Note that upgrading SingleStore Toolbox does not automatically upgrade the database engine. To upgrade the database engine, see [Upgrade SingleStore](https://docs.singlestore.com/db/v9.1/user-and-cluster-administration/maintain-your-cluster/upgrade-or-uninstall-singlestore/upgrade-singlestore.md).To upgrade the database engine to version 9.1, see [Upgrade to SingleStore 9.1](https://docs.singlestore.com/db/v9.1/user-and-cluster-administration/maintain-your-cluster/upgrade-or-uninstall-singlestore/upgrade-to-singlestore-9-1.md)

* *Red Hat Distribution*

  To upgrade the tools in the `singlestoredb-toolbox` package, follow the same basic steps that you would perform to update any RPM package.> **❗ Important**: The `singlestoredb-server` package should be updated through the `sdb-deploy upgrade` command. This command will install, update, and then restart nodes in your cluster (or rollback the installation process, if necessary).**Online**```shell
  sudo yum update -y singlestoredb-toolbox

  ```**Offline**```shell
  sudo rpm -Uvh /tmp/singlestoredb-toolbox-<version>.x86_64.rpm

  ```

* *Debian Distribution*

  To upgrade the tools in the `singlestoredb-toolbox` package, follow the same basic steps that you would perform to update any Debian package.> **❗ Important**: The `singlestoredb-server` package should be updated through the `sdb-deploy upgrade` command. This command will install, update, and then restart nodes in your cluster (or rollback the installation process, if necessary).**Online**1) SingleStore packages are signed to ensure integrity, so the GPG key needs to be added to this host. When done, verify that the SingleStore signing key has been added using `apt-key list`.
     ```shell
     wget -O - 'https://release.memsql.com/release-aug2018.gpg' 2>/dev/null | sudo apt-key add - && apt-key list
     ```
     **Without using `apt-key`**:
     ```shell
     wget -q -O - 'https://release.memsql.com/release-aug2018.gpg' | sudo tee /etc/apt/trusted.gpg.d/memsql.asc 1>/dev/null
     ```

  2) Upgrade Toolbox.
     ```shell
     sudo apt install singlestoredb-toolbox -y
     ```**Offline**```shell
  sudo dpkg -i /tmp/singlestoredb-toolbox_<version>_amd64.deb

  ```

* *Tarball*

  To upgrade the SingleStore Toolbox tarball, you need to replace the currently installed SingleStore Toolbox binaries with new binaries. Using symbolic links is one way to achieve this action and the instructions are as follows.1. Navigate to the directory that contains the unpacked SingleStore Toolbox tarball and create a symbolic link pointing to the SingleStore Toolbox currently installed. Name this symlink `singlestoredb-toolbox`.
     ```shell
     ln -s singlestoredb-toolbox-<version>-<commit-hash> singlestoredb-toolbox
     ```
     Run `ls -l` to verify that the symlink is created.

  2. Obtain the latest version of `singlestoredb-toolbox` using the following command.
     ```shell
     curl https://release.memsql.com/production/index/memsqltoolbox/latest.json
     ```
     The JSON you receive contains a relative path to the `memsql-toolbox-tar` file in the following format.
     ```shell
     "Path": "production/tar/x86_64/singlestoredb-toolbox-<version>-<commit-hash>.x86_64.tar.gz"
     ```

  3. Use `wget` to download the file by copying, pasting, and appending the path (minus the quotes) to <https://release.memsql.com/>. Example is shown below.
     ```shell
     wget https://release.memsql.com/production/tar/x86_64/singlestoredb-toolbox-<version>-<commit-hash>.x86_64.tar.gz
     ```
     As an alternative to steps 2 and 3, you can download the latest version of SingleStore Toolbox tarball file using the following link.



  4. Transfer the tarball file to the main deployment host where the earlier version of the SingleStore Toolbox is available.

  5. Unpack the SingleStore Toolbox file by running the following command.
     ```shell
     tar xzvf singlestoredb-toolbox-<version>-<commit-hash>.tar.gz
     ```
     Now the directory contains both versions of SingleStore Toolbox.

  6. Remove the `singlestoredb-toolbox` symlink by running the following command.
     ```shell
     rm singlestoredb-toolbox
     ```

  7. Recreate the symlink by pointing it to the new version of SingleStore Toolbox downloaded and unpacked in steps 2 and 4.
     ```shell
     ln -s singlestoredb-toolbox-<version>-<commit-hash>/ singlestoredb-toolbox
     ```
     The upgrade is complete and you can verify the cluster status by running the commands in the new SingleStore Toolbox directory. If you encounter any issues and need to downgrade, you can simply point the symlink back to the old version for SingleStore Toolbox.

  8. After successful validation, you can remove the old version of SingleStore Toolbox by running the following command.
     ```shell
     rm -rf singlestoredb-toolbox-<version>-<commit-hash>
     ```> **📝 Note**: Using symbolic links is optional in the SingleStore Toolbox tarball upgrade. To perform the upgrade, you need to replace the old SingleStore Toolbox binaries with new binaries with or without symbolic links.As an alternative to using symbolic links for the upgrade, you can update the PATH environment variable with the path to the folder where the new version of SingleStore Toolbox tarball is unpacked, as shown below.```shell
  export PATH=<Folder-with-new-binaries>/singlestoredb-toolbox-<version>-<commit-hash>/:$PATH
  ```

## Uninstall SingleStore Toolbox

* *Red Hat Distribution*

  You can either uninstall Toolbox as a standalone task or remove it while uninstalling SingleStore. If you want to completely uninstall SingleStore and its related tools packages, first uninstall SingleStore from your nodes by using the `sdb-deploy uninstall` command. This will remove the `singlestoredb-server` package for that version of SingleStore (all versions of SingleStore can be uninstalled using the `--all-versions` flag).> **❗ Important**: The `remove` command and `-e` flag will only remove the binaries in the package and not remove any configuration files.As part of the removal process, or to simply remove Toolbox, perform the following operation:**Online**```shell
  sudo yum remove singlestoredb-toolbox

  ```**Offline**```shell
  sudo rpm -e singlestoredb-toolbox

  ```

* *Debian Distribution*

  You can either uninstall Toolbox as a standalone task or remove it while uninstalling SingleStore. If you want to completely uninstall SingleStore and its related tools packages, first uninstall SingleStore from your nodes by using the `sdb-deploy uninstall` command. This will remove the `singlestoredb-server` package for that version of SingleStore (all versions of SingleStore can be uninstalled using the `--all-versions` flag).As part of the removal process, or to simply remove Toolbox, perform the following operation:> **❗ Important**: The `purge` command and `-P` flag will remove the binaries in the package as well as any configuration files. If you want to keep the configuration files, use the `remove` command or `-r` flag instead.**Online**```shell
  sudo apt purge singlestoredb-toolbox

  ```**Offline**```shell
  sudo dpkg -P /tmp/singlestoredb-toolbox_<version>_amd64.deb

  ```

***

Modified at: June 22, 2022

Source: [/db/v9.1/user-and-cluster-administration/cluster-management-with-tools/singlestore-tools-installation/singlestore-toolbox-installation/](https://docs.singlestore.com/db/v9.1/user-and-cluster-administration/cluster-management-with-tools/singlestore-tools-installation/singlestore-toolbox-installation/)

(An index of the documentation is available at /llms.txt)
