Skip to content

Commit

Permalink
docs: update gpback installation steps according to operations
Browse files Browse the repository at this point in the history
  • Loading branch information
TomShawn committed Jan 4, 2024
1 parent 60f3393 commit 73e5320
Showing 1 changed file with 53 additions and 19 deletions.
72 changes: 53 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,68 @@ Follow the directions [here](https://golang.org/doc/) for installation, usage
and configuration instructions. Make sure to set the [Go PATH environment
variable](https://go.dev/doc/install) before starting the following steps.

## Download & Build
## Downloading & Building

1. Downloading the latest version:
1. Downloading the `cloudberrydb/gpbackup` repository to your target machine:

```bash
go install github.com/cloudberrydb/gpbackup@latest
```
```bash
git clone https://github.com/cloudberrydb/gpbackup.git
```

This will place the code in `$GOPATH/pkg/mod/github.com/cloudberrydb/gpbackup`.
2. Installing the `gpbackup` package:

2. Building and installing binaries
```bash
go install github.com/cloudberrydb/gpbackup@latest
```

Make the `gpbackup` directory your current working directory and run:
This will place the code in `$GOPATH/pkg/mod/github.com/cloudberrydb/gpbackup`.

```bash
make depend
make build
```
3. Entering the directory of `cloudberrydb/gpbackup`. Then, building and installing binaries of source code:

```bash
cd <your_local_gpbackup_repo>
make depend
make build
```

<!-- The `build` target will put the `gpbackup` and `gprestore` binaries in
`$HOME/go/bin`. This will also attempt to copy `gpbackup_helper` to the
CloudberryDB segments (retrieving hostnames from `gp_segment_configuration`).
Pay attention to the output as it will indicate whether this operation was
successful. -->

`make build_linux` is for cross-compiling on macOS, and the target is Linux.

`make install` will scp the `gpbackup_helper` binary (used with -single-data-file flag) to all hosts.

4. Check whether the build is successful by checking whether your `$HOME/go/bin` directory contains `gpback`, `gprestore`, and `gpbackup_helper`.

```bash
ls $HOME/go/bin
```

5. If successful, copy the `gpback`, `gprestore`, and `gpbackup_helper` files to the `/bin` folder of your CloudberryDB installation on each segment. For example:

```bash
cp /home/gpadmin/go/bin/gpbackup /usr/local/cloudberry-db/bin/
cp /home/gpadmin/go/bin/gprestore /usr/local/cloudberry-db/bin/
cp /home/gpadmin/go/bin/gpbackup_helper /usr/local/cloudberry-db/bin/
```

6. Grant the execute permission to the files. For example:

The `build` target will put the `gpbackup` and `gprestore` binaries in
`$HOME/go/bin`. This will also attempt to copy `gpbackup_helper` to the
CloudberryDB segments (retrieving hostnames from `gp_segment_configuration`).
Pay attention to the output as it will indicate whether this operation was
successful.
```bash
chmod +x /usr/local/cloudberry-db/bin/gpbackup
chmod +x /usr/local/cloudberry-db/bin/gprestore
chmod +x /usr/local/cloudberry-db/bin/gpbackup_helper
```

`make build_linux` is for cross compiling on macOS, and the target is Linux.
7. Validate whether the installation is successful:

`make install` will scp the `gpbackup_helper` binary (used with -single-data-file flag) to all hosts
```bash
gpbackup --version
gprestore --version
```

## Running the utilities

Expand Down

0 comments on commit 73e5320

Please sign in to comment.