Skip to content
This repository has been archived by the owner on Mar 26, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' of https://github.com/gluster/glusterd2 into doc
Browse files Browse the repository at this point in the history
  • Loading branch information
rishubhjain committed Jul 12, 2018
2 parents 79b85e6 + a28efc6 commit d3a28d6
Show file tree
Hide file tree
Showing 144 changed files with 2,210 additions and 913 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ DEPENV ?=
PLUGINS ?= yes
FASTBUILD ?= yes

.PHONY: all build check check-go check-reqs install vendor-update vendor-install verify release check-protoc $(GD2_BIN) $(GD2_BUILD) $(CLI_BIN) $(CLI_BUILD) cli $(GD2_CONF) gd2conf test dist dist-vendor functest
.PHONY: all build binaries check check-go check-reqs install vendor-update vendor-install verify release check-protoc $(GD2_BIN) $(GD2_BUILD) $(CLI_BIN) $(CLI_BUILD) cli $(GD2_CONF) gd2conf test dist dist-vendor functest

all: build

build: check-go check-reqs vendor-install $(GD2_BIN) $(CLI_BIN) $(GD2_CONF)
build: check-go check-reqs vendor-install binaries $(GD2_CONF)
check: check-go check-reqs check-protoc
binaries: $(GD2_BIN) $(CLI_BIN)

check-go:
@./scripts/check-go.sh
Expand All @@ -57,7 +58,7 @@ $(GD2_BUILD):

$(CLI_BIN) cli: $(CLI_BUILD)
$(CLI_BUILD):
@FASTBUILD=$(FASTBUILD) ./scripts/build.sh glustercli
@FASTBUILD=$(FASTBUILD) GD2_STATE_DIR=$(GD2STATEDIR) ./scripts/build.sh glustercli
@FASTBUILD=$(FASTBUILD) ./scripts/build.sh glustercli/generate_bash_completion
@./$(CLI_BASH_COMPLETION_GEN_BIN) $(CLI_BASH_COMPLETION_BUILD)
@echo
Expand Down
11 changes: 0 additions & 11 deletions constants/constants.go

This file was deleted.

12 changes: 12 additions & 0 deletions doc/development-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ Once you are ready to push, you will type the following:
**Creating A Pull Request:**
When you are satisfied with your changes, you will then need to go to your repo in GitHub.com and create a pull request for your branch. Automated tests will be run against the pull request. Your pull request will be reviewed and merged.

If you are planning on making a large set of changes or a major architectural change it is often desirable to first build a consensus in an issue discussion and/or create an initial design doc PR. Once the design has been agreed upon one or more PRs implementing the plan can be made.

**Review Process:**
Once your PR has has been submitted for review the following critieria will need to be met before it will be merged:
* Each PR needs reviews accepting the change from at least two developers for merging
* It is common to request reviews from those reviewers automatically suggested by github
* Each PR needs to have been open for at least 24 working hours to allow for community feedback
* The 24 working hours counts hours occuring Mon-Fri in the local timezone of the submitter
* Each PR must be fully updated to master and tests must have passed

When the criteria are met a project maintainer can merge your changes into the project's master branch.

## Troubleshooting and Debugging

**Dumping etcd key and values:**
Expand Down
33 changes: 25 additions & 8 deletions doc/endpoints.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 16 additions & 7 deletions doc/quick-start-user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,31 @@ Install rpcbind:
**Installing glusterfs from nightly RPMs (CentOS 7):**

These packages require dependencies present in [EPEL](https://fedoraproject.org/wiki/EPEL). Enable the EPEL repositories before enabling gluster nightly packages repo below.

Install packages that provide GlusterFS server (brick process) and client (fuse, libgfapi):

```sh
# curl -o /etc/yum.repos.d/glusterfs-nighthly-master.repo http://artifacts.ci.centos.org/gluster/nightly/master.repo
# dnf install glusterfs-server glusterfs-fuse glusterfs-api
# curl -o /etc/yum.repos.d/glusterfs-nightly-master.repo http://artifacts.ci.centos.org/gluster/nightly/master.repo
# yum install glusterfs-server glusterfs-fuse glusterfs-api
```

### Download glusterd2

Glusterd2 is a single binary without any external dependencies. Like all Go programs, dependencies are statically linked. You can download the [latest release](https://github.com/gluster/glusterd2/releases) from Github.
As we do not have releases often, our nightly RPMs are generally more stable
as they contain the latest fixes. If you are on centos 7, you can download the
latest glusterd2 nightly RPM using the following method:

```sh
$ wget https://github.com/gluster/glusterd2/releases/download/v4.0dev-7/glusterd2-v4.0dev-7-linux-amd64.tar.xz
$ tar -xf glusterd2-v4.0dev-7-linux-amd64.tar.xz
# curl -o /etc/yum.repos.d/glusterd2-nightly-master.repo http://artifacts.ci.centos.org/gluster/gd2-nightly/gd2-master.repo
# yum install glusterd2
```

Alternatlively, if you are using a non-RPM based distro, you can download
binaries of the latest release. Like all Go programs, glusterd2 is a single
binary (statically linked) without external dependencies. You can download the
[latest release](https://github.com/gluster/glusterd2/releases) from Github.

### Running glusterd2

**Create a working directory:** This is where glusterd2 will store all data which includes logs, pid files, etcd information etc. For this example, we will be using a temporary path. If a working directory is not specified, it defaults to current directory.
Expand All @@ -55,7 +64,7 @@ Glusterd2 will also pick up conf file named `glusterd2.toml` if available in `/e

```toml
$ cat conf.toml
workdir = "/var/lib/gd2"
localstatedir = "/var/lib/gd2"
peeraddress = "192.168.56.101:24008"
clientaddress = "192.168.56.101:24007"
etcdcurls = "http://192.168.56.101:2379"
Expand Down Expand Up @@ -172,7 +181,7 @@ $ curl -X POST http://192.168.56.101:24007/v1/volumes --data @volcreate.json -H

Send the volume create request using glustercli:

$ glustercli volume create testvol <uuid1>:/export/brick1/data <uuid2>:/export/brick2/data <uuid1>:/export/brick3/data <uuid2>:/export/brick4/data --replica 2
$ glustercli volume create --name testvol <uuid1>:/export/brick1/data <uuid2>:/export/brick2/data <uuid1>:/export/brick3/data <uuid2>:/export/brick4/data --replica 2

## Start the volume

Expand Down
8 changes: 8 additions & 0 deletions doc/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,11 @@ tests.
```sh
# go test ./e2e -v -functest
```

**Running a single functional test:**
```sh
# go test ./e2e -v -functest -run "TestVolume"
```

The argument to the -run command-line flag is an unanchored regular expression
that matches the test's name.
2 changes: 1 addition & 1 deletion doc/xlator.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ volume.auth.password
```
brick.id
brick.hostname
brick.nodeid
brick.peerid
brick.path
brick.volumename
brick.volumeid
Expand Down
30 changes: 11 additions & 19 deletions e2e/bitrot_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package e2e

import (
"io/ioutil"
"strings"
"testing"

"github.com/gluster/glusterd2/pkg/api"
Expand All @@ -20,11 +18,7 @@ func TestBitrot(t *testing.T) {
r.Nil(err)
defer teardownCluster(gds)

client = initRestclient(gds[0].ClientAddress)

tmpDir, err = ioutil.TempDir(baseWorkdir, t.Name())
r.Nil(err)
t.Logf("Using temp dir: %s", tmpDir)
client = initRestclient(gds[0])

// test Bitrot on dist-rep volume
t.Run("Replica-volume", testBitrotOnReplicaVolume)
Expand All @@ -35,12 +29,11 @@ func TestBitrot(t *testing.T) {

func testBitrotOnReplicaVolume(t *testing.T) {
r := require.New(t)
volumeName := strings.Replace(t.Name(), "/", "-", 1)
volumeName := formatVolName(t.Name())
var brickPaths []string

for i := 1; i <= 4; i++ {
brickPath, err := ioutil.TempDir(tmpDir, "brick")
r.Nil(err)
brickPath := testTempDir(t, "brick")
brickPaths = append(brickPaths, brickPath)
}

Expand Down Expand Up @@ -78,12 +71,11 @@ func testBitrotOnReplicaVolume(t *testing.T) {

func testBitrotOnDistVolume(t *testing.T) {
r := require.New(t)
volumeName := strings.Replace(t.Name(), "/", "-", 1)
volumeName := formatVolName(t.Name())
var brickPaths []string

for i := 1; i <= 4; i++ {
brickPath, err := ioutil.TempDir(tmpDir, "brick")
r.Nil(err)
brickPath := testTempDir(t, "brick")
brickPaths = append(brickPaths, brickPath)
}

Expand Down Expand Up @@ -120,7 +112,7 @@ func testBitrotOnDistVolume(t *testing.T) {
}

func testbitrot(t *testing.T) {
volumeName := strings.Replace(t.Name(), "/", "-", 1)
volumeName := formatVolName(t.Name())
r := require.New(t)

//check bitrot status, before starting volume
Expand All @@ -133,7 +125,7 @@ func testbitrot(t *testing.T) {

//check bitrot status on started volume
_, err = client.BitrotScrubStatus(volumeName)
r.Contains(err.Error(), "Bitrot is not enabled")
r.Contains(err.Error(), "bitrot is not enabled")

//enable bitrot on volume
err = client.BitrotEnable(volumeName)
Expand All @@ -150,7 +142,7 @@ func testbitrot(t *testing.T) {

//check bitrot status
_, err = client.BitrotScrubStatus(volumeName)
r.Contains(err.Error(), "Bitrot is not enabled")
r.Contains(err.Error(), "bitrot is not enabled")

//stop volume
err = client.VolumeStop(volumeName)
Expand All @@ -170,15 +162,15 @@ func testbitrot(t *testing.T) {

//check bitrot status
scrubStatus, err = client.BitrotScrubStatus(volumeName)
r.Contains(err.Error(), "Bitrot is not enabled")
r.Contains(err.Error(), "bitrot is not enabled")

//disable bitrot on volume
err = client.BitrotDisable(volumeName)
r.Contains(err.Error(), "Bitrot is already disabled")
r.Contains(err.Error(), "bitrot is already disabled")

//check bitrot status
_, err = client.BitrotScrubStatus(volumeName)
r.Contains(err.Error(), "Bitrot is not enabled")
r.Contains(err.Error(), "bitrot is not enabled")

//stop volume
err = client.VolumeStop(volumeName)
Expand Down
Loading

0 comments on commit d3a28d6

Please sign in to comment.