Skip to content

Commit

Permalink
[CE-342] Fix systemd config update doc
Browse files Browse the repository at this point in the history
* Fix the systemd config update doc under ubuntu 18.04;
* And update the grammar indicator from 'sh' to 'bash'.

CE-342 #done

Change-Id: I2cd6eef062a29fcb5c289337beeab47526e64dfd
Signed-off-by: Baohua Yang <yangbaohua@gmail.com>
  • Loading branch information
yeasy committed Aug 21, 2018
1 parent a318849 commit 2c5821d
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 43 deletions.
14 changes: 7 additions & 7 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,32 @@ The project employs [Gerrit](https://gerrit.hyperledger.org) as the code commit/

* Clone the project to your working directory with your `LFID`.

```sh
```bash
$ git clone ssh://LFID@gerrit.hyperledger.org:29418/cello && scp -p -P 29418 LFID@gerrit.hyperledger.org:hooks/commit-msg cello/.git/hooks/
```

(Optionally) Config your git name and email if not setup previously.

```sh
```bash
$ git config user.name "your name"
$ git config user.email "your email"
```

(Optionally) Setup git-review by inputting your LFID. Notice this is only necessary once.
```sh
```bash
$ git review -s
```

* Assign yourself a `To Do` Jira task, mark it as `In progress`, then create a branch with the Jira task number off of your cloned repository, e.g., for CE-26, it can be:

```sh
```bash
$ cd cello
$ git checkout -b CE-26
```

* After modifying the code, run `make check` to make sure all the checking is passed. Then Commit your code with `-s` to sign-off, and `-a` to automatically add changes (or run `git add .` to include all changes manually).

```sh
```bash
$ make check
...
py27: commands succeeded
Expand All @@ -71,7 +71,7 @@ $ git commit -s -a

Example commit msg may look like (take CE-1234 for example):

```sh
```bash
[CE-1234] A short description of your change with no period at the end

You can add more details here in several paragraphs, but please keep each line
Expand All @@ -85,7 +85,7 @@ Signed-off-by: Your Name <committer@email.address>

* Submit your commit using `git review`, and mark the corresponding Jira item as `Under Review`.

```sh
```bash
$ git review
remote: Processing changes: new: 1, refs: 1, done
remote:
Expand Down
14 changes: 7 additions & 7 deletions docs/make_support.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Builds js files for react.
### check
CI checking. Runs the following commands. This runs the following commands for you.

```sh
```bash
$ tox
$ make start && sleep 10 && make stop
```
Expand All @@ -22,15 +22,15 @@ $ make start && sleep 10 && make stop
Cleans up the environment and removes temp files like .cache, .tox, .pyc.
It runs the following commands for you.

```sh
```bash
$ rm -rf .tox .cache *.egg-info
$ find . -name "*.pyc" -o -name "__pycache__" -exec rm -rf "{}" \;
```

### doc
Starts a doc server locally. It runs the following commands for you.

```sh
```bash
$ pip install mkdocs
$ mkdocs serve
```
Expand All @@ -41,7 +41,7 @@ Show help.
### image-clean
Cleans up all cello related docker images. It runs the following commands for you.

```sh
```bash
$ docker images | grep "cello-" | awk '{print $1}' | xargs docker rmi -f
$ docker rmi $(docker images -f dangling=true -q)
```
Expand All @@ -55,14 +55,14 @@ Shows logs of all services.
### setup-master
Sets up the master node. Run on Master node. It runs the following command for you.

```sh
```bash
$ cd scripts/master_node && bash setup.sh
```

### setup-worker
Sets up the worker node. Run on Worker node. It runs the following commands for you.

```sh
```bash
$ cd scripts/worker_node && bash setup.sh
```

Expand All @@ -72,7 +72,7 @@ Redeploys specified service(s). To redeploy `Dashboard` service, use: `make rede
### start
Starts all services. Runs following command for you.

```sh
```bash
$ docker-compose up -d --no-recreate
```

Expand Down
4 changes: 2 additions & 2 deletions docs/production_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ In order to optimize the system performance in production environment, these sys

## `/etc/sysctl.conf`

```sh
```bash
# Don't ask why, this is a solid answer.
vm.swappiness=10
fs.file-max = 2000000
Expand All @@ -24,7 +24,7 @@ Then, need to run `sysctl -p` for enabling.

## `/etc/security/limits.conf`

```sh
```bash
* hard nofile 1048576
* soft nofile 1048576
* soft nproc 10485760
Expand Down
8 changes: 4 additions & 4 deletions docs/reactjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
How to start service with react theme?
--------------------------------------

```sh
```bash
$ THEME=react make start
```

If you want to develop original js code for react, you must install node modules, and rebuild js after you change the js code.

In the initialized state, must install node modules, the command is

```sh
```bash
$ make npm-install
```

Expand All @@ -22,13 +22,13 @@ How to build react js?

In the development phase

```sh
```bash
$ make watch-mode
```

In the production environment

```sh
```bash
$ make build-js
```

Expand Down
20 changes: 10 additions & 10 deletions docs/setup_master.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The [Master Node](./terminology.md) can be deployed by in 2 steps.

You may check `git` and `make` are installed to clone the code.

```sh
```bash
$ sudo aptitude install git make -y
$ git clone http://gerrit.hyperledger.org/r/cello && cd cello
```
Expand All @@ -34,7 +34,7 @@ For the first time running, please setup the master node with the [setup.sh](htt

Just run (safe to repeat it):

```sh
```bash
$ make setup-master
```

Expand All @@ -45,7 +45,7 @@ Make sure there is no error during the setup. Otherwise, please check the log ms
#### Start/Stop/Restart
To start the whole services, please run

```sh
```bash
$ [environment variables] make start
```
Environment variables which you can use in the command:
Expand All @@ -62,42 +62,42 @@ Environment variables which you can use in the command:


To stop or restart the whole services, please run
```sh
```bash
$ make stop
```
To restart the whole services, please run
```sh
```bash
$ make restart
```

#### Start/Stop/Restart in Development mode
As a developer, you can start/stop/restart services in development mode. In development mode, [user dashboard](./dashboard_user.md) will watch and restart service if files change. And [operator dashboard](./dashboard_operator.md) will enalbe flask debug.

To start the whole services in developer mode, please run
```sh
```bash
$ DEV=True make start
```



To stop or restart the whole services, please run
```sh
```bash
$ DEV=True make stop
```
To restart the whole services, please run
```sh
```bash
$ DEV=True make restart
```

#### Check Logs
To check the logs for all the services, please run

```sh
```bash
$ make logs
```

To check the logs for one specific service, please run
```sh
```bash
$ make log service=watchdog
```

Expand Down
24 changes: 11 additions & 13 deletions docs/setup_worker_docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,40 +11,38 @@ For the Worker Node with meeting the [system requirements](#system-requirements)
### System Requirements
* Hardware: 4c8g50g
* Docker engine:
- 1.10.0~1.17.0
- 1.10.0~1.18.6

### Docker Daemon Setup

Let Docker daemon listen on port 2375, and make sure Master can reach Worker Node through this port.

#### Ubuntu 16.04
Update `/lib/systemd/system/docker.service` like
#### Ubuntu 18.04
Edit systemd service config file `/lib/systemd/system/docker.service`, update the `ExecStart` line under section `[Service]`, as the following:

```
[Service]
DOCKER_OPTS="$DOCKER_OPTS -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock --api-cors-header='*' --default-ulimit=nofile=8192:16384 --default-ulimit=nproc=8192:16384"
EnvironmentFile=-/etc/default/docker
ExecStart=/usr/bin/dockerd -H fd:// $DOCKER_OPTS
DOCKER_OPTS="$DOCKER_OPTS "
ExecStart=/usr/bin/dockerd -H fd:// -H unix:///var/run/docker.sock -H tcp://0.0.0.0:2375 --default-ulimit=nofile=8192:16384 --default-ulimit=nproc=8192:16384
```

Regenerate the docker service script and restart the docker engine:

```sh
$ sudo systemctl daemon-reload
$ sudo systemctl restart docker.service
```bash
$ sudo systemctl daemon-reload; sudo systemctl restart docker.service
```

### Alternatively (for all Linux distro):
This will run the docker-daemon on port 2375 as long as the system is restarted or docker-daemon is killed.

```sh
```bash
$ sudo systemctl stop docker.service
$ sudo dockerd -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock --api-cors-header='*' --default-ulimit=nofile=8192:16384 --default-ulimit=nproc=8192:16384 -D &
$ sudo dockerd -H fd:// -H unix:///var/run/docker.sock -H tcp://0.0.0.0:2375 --default-ulimit=nofile=8192:16384 --default-ulimit=nproc=8192:16384 -D &
```

At last, run the follow test at Master node and get OK response, to make sure it can access the Worker node successfully.

```sh
```bash
[Master] $ docker -H Worker_Node_IP:2375 info
```

Expand All @@ -58,7 +56,7 @@ $ MASTER_NODE=xx.xx.xx.xx make setup-worker
### Firewall Setup
Make sure ip forward is enabled, you can simply run the follow command.

```sh
```bash
$ sysctl -w net.ipv4.ip_forward=1
```
And check the os iptables config, to make sure host ports are open (e.g., 2375, 7050~10000)
Expand Down

0 comments on commit 2c5821d

Please sign in to comment.