Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

Commit 2ca2af5

Browse files
Merge pull request #1850 from LiskHQ/1570-add-update-service-node-page-for-docker
Add update service node page for docker in Lisk Service v0.7.0
2 parents 789d641 + 68b7ab3 commit 2ca2af5

File tree

2 files changed

+260
-1
lines changed

2 files changed

+260
-1
lines changed

docs/antora/modules/ROOT/pages/management/docker.adoc

+151-1
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,24 @@ Mona Bärenfänger <[email protected]>
1111
:url_FLUSHALL: https://redis.io/commands/FLUSHALL
1212
:url_snapshot_config: configuration/index.adoc
1313
:url_backups: management/snapshots.adoc
14+
:url_rel_notes: https://github.com/LiskHQ/lisk-service/releases
15+
:url_tags: https://github.com/LiskHQ/lisk-service/tags
16+
17+
== Build Docker image
18+
19+
.Inside the lisk-service root folder
20+
----
21+
make build
22+
----
23+
This creates the necessary Docker images to start Lisk Service in the containers.
1424

1525
== Start
1626

1727
.Inside the lisk-service root folder
1828
----
29+
cp ./docker/example.env .env
30+
----
31+
----
1932
make up
2033
----
2134

@@ -204,10 +217,147 @@ If you wish to take a snapshot of your Docker installation, the details can be f
204217

205218
== Logging
206219

207-
To check the logs for the different microservices of Lisk Service, use the command `docker container logs CONTAINER`, where `CONTAINER` is the respective Docker container that holds the logs you wish to view.
220+
The possibility exists here to either use the `docker` commands or the `make` commands to check the logs, and both options are listed here below.
221+
222+
For `docker`, to check the logs for the different microservices of Lisk Service, use the command `docker container logs CONTAINER`, where `CONTAINER` is the respective Docker container that holds the logs you wish to view.
208223

209224
For example, to see the logs for the Gateway microservice, execute the following command:
210225

211226
----
212227
docker container logs lisk-service_gateway_1
213228
----
229+
230+
To check the logs for different microservices using the `make` commands, the following commands listed below can be used:
231+
232+
.Displays the logs for all the microservices that have been logged so far, and that are currently existing
233+
----
234+
make logs
235+
----
236+
237+
.Displays the latest logs for all the microservices
238+
----
239+
make logs-live
240+
----
241+
242+
.Displays the logs for the specified microservice.
243+
----
244+
make logs-blockchain-connector
245+
----
246+
In the above example, it will display logs only for the `blockchain-connector` microservice.
247+
248+
.Displays the latest logs for the specified microservice.
249+
----
250+
make logs-live-blockchain-connector
251+
----
252+
In the above example, it will display the latest logs only for the `blockchain-connector` microservice.
253+
254+
255+
Replace the `blockchain-connector` with the specific service name required.
256+
257+
258+
== Upgrade Lisk Service
259+
260+
To upgrade the Docker container to a desired version, please follow one of the two options below. To find all the tagged versions for Lisk Service, please check the {url_tags}[available tags] on GitHub.
261+
262+
[tabs]
263+
====
264+
Option A - Download pre-built images from DockerHub::
265+
+
266+
--
267+
. Stop Lisk Service
268+
+
269+
----
270+
make stop
271+
----
272+
NOTE: In case the database needs to be flushed please execute the `make down` command instead. Please check the {url_rel_notes}[release notes] for the relevant version to see if the existing databases need to be flushed.
273+
274+
. Checkout the version with *`git checkout <tag>`*
275+
+
276+
----
277+
git checkout v0.7.0
278+
----
279+
280+
. Update `docker-compose.yml` to download the specific image versions from the DockerHub as shown below.
281+
Update specified images with the desired version, for example `0.7.0`.
282+
+
283+
.docker-compose.yml
284+
[source,yaml]
285+
----
286+
blockchain-app-registry:
287+
image: lisk/service_blockchain_app_registry:0.7.0
288+
...
289+
290+
blockchain-connector:
291+
image: lisk/service_blockchain_connector:0.7.0
292+
...
293+
294+
blockchain-indexer:
295+
image: lisk/service_blockchain_indexer:0.7.0
296+
...
297+
298+
blockchain-coordinator:
299+
image: lisk/service_blockchain_coordinator:0.7.0
300+
...
301+
302+
transaction-statistics:
303+
image: lisk/service_transaction_statistics:0.7.0
304+
...
305+
306+
fee-estimator:
307+
image: lisk/service_fee_estimator:0.7.0
308+
...
309+
310+
gateway:
311+
image: lisk/service_gateway:0.7.0
312+
...
313+
314+
market:
315+
image: lisk/service_market:0.7.0
316+
...
317+
318+
export:
319+
image: lisk/service_export:0.7.0
320+
321+
----
322+
323+
. Start Lisk Service in the containers.
324+
+
325+
----
326+
make up
327+
----
328+
--
329+
Option B - Build images locally ::
330+
+
331+
--
332+
Build the images locally using the following steps.
333+
Navigate inside the lisk-service root folder, and execute the following commands.
334+
335+
. Stop Lisk Service
336+
+
337+
----
338+
make stop
339+
----
340+
NOTE: In case the database needs to be flushed please execute the `make down` command instead. Please check the {url_rel_notes}[release notes] for the relevant version to see if the existing databases need to be flushed.
341+
342+
. Checkout the version with *`git checkout <tag>`*
343+
+
344+
----
345+
git checkout v0.7.0
346+
----
347+
348+
. Build the required updated Docker images
349+
+
350+
----
351+
make build
352+
----
353+
354+
. Start Lisk Service in the containers
355+
+
356+
----
357+
make up
358+
----
359+
--
360+
361+
====
362+
363+
To verify the microservice logs, please refer to the <<Logging>> section.

docs/antora/modules/ROOT/pages/management/source.adoc

+109
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ Mona Bärenfänger <[email protected]> Muhammad Talha <muhammad.talha@lightcurv
1010
// External URLs
1111
:url_pm2_docs: https://pm2.keymetrics.io/docs/usage/quick-start/
1212
:url_FLUSHALL: https://redis.io/commands/FLUSHALL
13+
:url_pm2_management: https://pm2.keymetrics.io/docs/usage/log-management/
1314
:url_backups: management/snapshots.adoc
15+
:url_rel_notes: https://github.com/LiskHQ/lisk-service/releases
16+
:url_tags: https://github.com/LiskHQ/lisk-service/tags
17+
1418

1519
//TODO: add in link to new Backups page for importing the DB snapshot manually
1620

@@ -19,6 +23,9 @@ For more details about PM2, see {url_pm2_docs}[PM2 docs].
1923

2024
Moreover, we'll also talk about the steps to reset a Lisk Service node.
2125

26+
TIP: The process ID of each PM2-managed process can be seen by executing the <<list>> command. To learn more about PM2 log management please refer the {url_pm2_management}[PM2 logs documentation].
27+
28+
2229
== Various PM2 commands
2330

2431
=== Start
@@ -103,6 +110,7 @@ Alternatively, it is also possible to check the logs for a specific PM2 process
103110
For example, `pm2 logs 0` can be used to check the Lisk Service Gateway logs.
104111

105112
TIP: The process ID of each PM2-managed process can be seen by executing the <<list>> command.
113+
To learn more about PM2 log management please refer the {url_pm2_management}[PM2 logs documentation].
106114

107115
For example, to see the logs for the Gateway microservice, execute the following command:
108116

@@ -367,3 +375,104 @@ redis-cli -n <db_number> flushdb
367375
====
368376

369377
You can start Lisk Service again with the <<start>> command.
378+
379+
380+
== Upgrade Lisk Service
381+
382+
To upgrade Lisk Service to a desired version, please follow the steps listed below. To find all the tagged versions for Lisk Service, please check the {url_tags}[available tags] on GitHub.
383+
384+
. Stop the existing running version of Lisk Service.
385+
+
386+
----
387+
pm2 stop ecosystem.config.js
388+
----
389+
+
390+
.Response
391+
[%collapsible]
392+
====
393+
.Example output
394+
[source,bash]
395+
----
396+
[PM2] [lisk-service-blockchain-app-registry](1) ✓
397+
[PM2] [lisk-service-gateway](0) ✓
398+
[PM2] [lisk-service-blockchain-indexer](3) ✓
399+
[PM2] [lisk-service-blockchain-connector](2) ✓
400+
[PM2] [lisk-service-blockchain-coordinator](4) ✓
401+
[PM2] [lisk-service-fee-estimator](5) ✓
402+
[PM2] [lisk-service-transaction-statistics](6) ✓
403+
[PM2] [lisk-service-market](7) ✓
404+
[PM2] [lisk-service-export](8) ✓
405+
┌------------------------------------------------------------------------------------------------------------------------------------------------------------------------┐
406+
│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │
407+
├------------------------------------------------------------------------------------------------------------------------------------------------------------------------┤
408+
│ 1 │ lisk-service-blockchain-app-registry │ default │ 0.7.0-… │ fork │ 0 │ 0 │ 32 │ stopped │ 0% │ 0b │ XYZ │ disabled │
409+
│ 2 │ lisk-service-blockchain-connector │ default │ 0.7.0-… │ fork │ 0 │ 0 │ 0 │ stopped │ 0% │ 0b │ XYZ │ disabled │
410+
│ 4 │ lisk-service-blockchain-coordinator │ default │ 0.7.0-… │ fork │ 0 │ 0 │ 0 │ stopped │ 0% │ 0b │ XYZ │ disabled │
411+
│ 3 │ lisk-service-blockchain-indexer │ default │ 0.7.0-… │ fork │ 0 │ 0 │ 32 │ stopped │ 0% │ 0b │ XYZ │ disabled │
412+
│ 8 │ lisk-service-export │ default │ 0.7.0-… │ fork │ 0 │ 0 │ 30 │ stopped │ 0% │ 0b │ XYZ │ disabled │
413+
│ 5 │ lisk-service-fee-estimator │ default │ 0.7.0-… │ fork │ 0 │ 0 │ 30 │ stopped │ 0% │ 0b │ XYZ │ disabled │
414+
│ 0 │ lisk-service-gateway │ default │ 0.7.0-… │ fork │ 0 │ 0 │ 30 │ stopped │ 0% │ 0b │ XYZ │ disabled │
415+
│ 7 │ lisk-service-market │ default │ 0.7.0-… │ fork │ 0 │ 0 │ 30 │ stopped │ 0% │ 0b │ XYZ │ disabled │
416+
│ 6 │ lisk-service-transaction-statistics │ default │ 0.7.0-… │ fork │ 0 │ 0 │ 30 │ stopped │ 0% │ 0b │ XYZ │ disabled │
417+
└------------------------------------------------------------------------------------------------------------------------------------------------------------------------┘
418+
----
419+
====
420+
421+
. Checkout the version with *`git checkout <tag>`*.
422+
+
423+
----
424+
git checkout v0.7.0
425+
----
426+
427+
. Update the npm dependencies by executing the following command.
428+
+
429+
----
430+
make build-local
431+
----
432+
433+
. Restart Lisk Service with the following command.
434+
+
435+
----
436+
pm2 start ecosystem.config.js
437+
----
438+
+
439+
.Response
440+
[%collapsible]
441+
====
442+
.Example output
443+
----
444+
[PM2] Applying action restartProcessId on app [lisk-service-gateway](ids: [ 0 ])
445+
[PM2] Applying action restartProcessId on app [lisk-service-blockchain-app-registry](ids: [ 1 ])
446+
[PM2] [lisk-service-gateway](0) ✓
447+
[PM2] [lisk-service-blockchain-app-registry](1) ✓
448+
[PM2] Applying action restartProcessId on app [lisk-service-blockchain-connector](ids: [ 2 ])
449+
[PM2] [lisk-service-blockchain-connector](2) ✓
450+
[PM2] Applying action restartProcessId on app [lisk-service-blockchain-indexer](ids: [ 3 ])
451+
[PM2] [lisk-service-blockchain-indexer](3) ✓
452+
[PM2] Applying action restartProcessId on app [lisk-service-blockchain-coordinator](ids: [ 4 ])
453+
[PM2] [lisk-service-blockchain-coordinator](4) ✓
454+
[PM2] Applying action restartProcessId on app [lisk-service-fee-estimator](ids: [ 5 ])
455+
[PM2] [lisk-service-fee-estimator](5) ✓
456+
[PM2] Applying action restartProcessId on app [lisk-service-transaction-statistics](ids: [ 6 ])
457+
[PM2] [lisk-service-transaction-statistics](6) ✓
458+
[PM2] Applying action restartProcessId on app [lisk-service-market](ids: [ 7 ])
459+
[PM2] [lisk-service-market](7) ✓
460+
[PM2] Applying action restartProcessId on app [lisk-service-export](ids: [ 8 ])
461+
[PM2] [lisk-service-export](8) ✓
462+
┌----------------------------------------------------------------------------------------------------------------------------------------------------------------------------┐
463+
│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │
464+
├----------------------------------------------------------------------------------------------------------------------------------------------------------------------------┤
465+
│ 1 │ lisk-service-blockchain-app-registry │ default │ 0.7.0-… │ fork │ 33328 │ 0s │ 16 │ online │ 0% │ 65.5mb │ XYZ │ disabled │
466+
│ 2 │ lisk-service-blockchain-connector │ default │ 0.7.0-… │ fork │ 33331 │ 0s │ 0 │ online │ 0% │ 63.8mb │ XYZ │ disabled │
467+
│ 4 │ lisk-service-blockchain-coordinator │ default │ 0.7.0-… │ fork │ 33341 │ 0s │ 0 │ online │ 0% │ 54.1mb │ XYZ │ disabled │
468+
│ 3 │ lisk-service-blockchain-indexer │ default │ 0.7.0-… │ fork │ 33338 │ 0s │ 16 │ online │ 0% │ 54.3mb │ XYZ │ disabled │
469+
│ 8 │ lisk-service-export │ default │ 0.7.0-… │ fork │ 33355 │ 0s │ 15 │ online │ 0% │ 14.1mb │ XYZ │ disabled │
470+
│ 5 │ lisk-service-fee-estimator │ default │ 0.7.0-… │ fork │ 33346 │ 0s │ 15 │ online │ 0% │ 46.9mb │ XYZ │ disabled │
471+
│ 0 │ lisk-service-gateway │ default │ 0.7.0-… │ fork │ 33326 │ 0s │ 15 │ online │ 0% │ 65.6mb │ XYZ │ disabled │
472+
│ 7 │ lisk-service-market │ default │ 0.7.0-… │ fork │ 33351 │ 0s │ 15 │ online │ 0% │ 36.9mb │ XYZ │ disabled │
473+
│ 6 │ lisk-service-transaction-statistics │ default │ 0.7.0-… │ fork │ 33348 │ 0s │ 15 │ online │ 0% │ 43.5mb │ XYZ │ disabled │
474+
└----------------------------------------------------------------------------------------------------------------------------------------------------------------------------┘
475+
----
476+
====
477+
478+
NOTE: Please check the {url_rel_notes}[GitHub release notes] for the relevant version to verify if the existing databases need to be flushed.

0 commit comments

Comments
 (0)