Sitelet https://github.com/XK4MiLX/chainweb-node-docker/commit/435768188e1a650a27a92130eb6a978d76666e34
Skip to content

Commit 4357681

Browse files
committed
add ulimit check
1 parent 76a8f8d commit 4357681

2 files changed

Lines changed: 22 additions & 18 deletions

File tree

‎README.md‎

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ the following shell command to start the node.
88
```sh
99
docker run \
1010
--detach \
11-
--ulimit "nofile=65536:65536" \
1211
--publish 443:443 \
1312
--name chainweb-node \
1413
larsk/chainweb-node:latest
@@ -24,10 +23,9 @@ provided the Chainweb node in the environment.
2423
```sh
2524
docker run \
2625
--detach \
27-
--ulimit "nofile=65536:65536" \
28-
--env "CHAINWEB_PORT=1789" \
2926
--publish 1789:1789 \
3027
--name chainweb-node \
28+
--env "CHAINWEB_PORT=1789" \
3129
larsk/chainweb-node:latest
3230
```
3331

@@ -68,9 +66,8 @@ follows:
6866

6967
```sh
7068
docker run \
71-
--ulimit "nofile=65536:65536" \
72-
--publish 443:443 \
7369
--detach \
70+
--publish 443:443 \
7471
--name chainweb-node \
7572
chainweb-node-with-db \
7673
/chainweb/run-chainweb-node.sh
@@ -94,12 +91,11 @@ docker run -ti --rm \
9491

9592
# 2. Use the database volume with a Chainweb node
9693
docker run \
97-
--ulimit "nofile=65536:65536" \
94+
--detach \
9895
--publish 443:443 \
99-
--mount type=volume,source=chainweb-db,target=/root/.local/share/chainweb-node/mainnet01/0/ \
10096
--name chainweb-node \
101-
--detach \
102-
larsk/chainweb-node:latest \
97+
--mount type=volume,source=chainweb-db,target=/root/.local/share/chainweb-node/mainnet01/0/ \
98+
larsk/chainweb-node:latest
10399
```
104100

105101
Alternatively a bind mount can be used to persist the database in the file
@@ -121,9 +117,10 @@ TODO
121117
* `/chainweb/initialize-db.sh`
122118
* `/chainweb/check-reachability.sh`
123119

124-
### Database Directory Path:
120+
### File System
125121

126-
* `/root/.local/share/chainweb-node/mainnet01/0`
122+
* Database directory: `/root/.local/share/chainweb-node/mainnet01/0`
123+
* Chainweb configuration file: `/chainweb/chainweb.yaml`
127124

128125
### Available Configuration Options
129126

@@ -150,13 +147,12 @@ Here is an example for how to use these settings:
150147

151148
```sh
152149
docker run \
150+
--detach \
151+
--publish 1789:1789 \
152+
--name chainweb-node \
153153
--env "CHAINWEB_PORT=1789" \
154154
--env "CHAINWEB_BOOTSTRAP_NODE=fr2.chainweb.com" \
155155
--env "LOGLEVEL=warn" \
156-
--ulimit "nofile=65536:65536" \
157-
--name chainweb-node \
158-
--publish 1789:1789 \
159-
--detach \
160156
chainweb-node-with-db
161157
```
162158

‎run-chainweb-node.sh‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ if [[ -z "$CHAINWEB_HOST" ]] ; then
1313
fi
1414
export CHAINWEB_HOST
1515

16+
# ############################################################################ #
17+
# Check ulimit
18+
19+
UL=$(ulimit -n -S)
20+
[[ "$UL" -ge 65536 ]] ||
21+
{
22+
echo "The configuration of the container has a too tight limit for the number of open file descriptors. The limit is $UL but at least 65536 is required." 1>&2
23+
echo "Try starting the container with '--ulimit \"nofile=65536:65536\"'" 1>&2
24+
exit 1
25+
}
26+
1627
# ############################################################################ #
1728
# Check connectivity
1829

@@ -28,9 +39,6 @@ curl -fsL "https://$CHAINWEB_BOOTSTRAP_NODE/info" > /dev/null ||
2839
exit 1
2940
}
3041

31-
# ############################################################################ #
32-
# TODO check ulimit
33-
3442
# ############################################################################ #
3543
# Run node
3644

0 commit comments

Comments
 (0)