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

Add update service node page for docker in Lisk Service v0.7.0 #1850

Merged
Merged
Changes from 7 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
7307f65
Update index.adoc
chris529 Sep 13, 2023
37152f6
create-update-docker.adoc
chris529 Sep 14, 2023
2c459e5
update-in-update-docker.adoc
chris529 Sep 14, 2023
3259fc0
update-in-update-docker.adoc
chris529 Sep 18, 2023
cedcda9
update-in-update-docker.adoc
chris529 Sep 18, 2023
5f339fa
Revert "Update index.adoc"
chris529 Sep 18, 2023
1923681
update in update-docker.adoc
chris529 Sep 19, 2023
cc32413
create-new-page-update-source.adoc
chris529 Sep 21, 2023
7cdac5a
update-in-both update-docker.adoc-and-docker.adoc
chris529 Sep 28, 2023
82333dd
update-in-source.adoc
chris529 Sep 28, 2023
e81abd0
update-in-source.adoc
chris529 Sep 28, 2023
25a3308
removed update-eisting-node
chris529 Sep 28, 2023
13739cc
update-in-docker.adoc
chris529 Oct 5, 2023
8c5cc8c
update-in-docker.adoc
chris529 Oct 5, 2023
e82704a
update-in-source.adoc
chris529 Oct 5, 2023
1f136ae
update-in-source.adoc
chris529 Oct 5, 2023
e782520
update-in-source.adoc
chris529 Oct 5, 2023
3d612a1
update-in-docker.adoc
chris529 Oct 5, 2023
eece577
update-in-source.adoc
chris529 Oct 5, 2023
c03b016
Merge branch '1570-add-update-service-node-page-for-docker' into 1571…
chris529 Oct 5, 2023
da0f0bd
update in source.adoc
chris529 Oct 13, 2023
4903212
update in source.adoc
chris529 Oct 13, 2023
7d897f6
Update docs/antora/modules/ROOT/pages/management/docker.adoc
chris529 Oct 13, 2023
aeeb162
Update docs/antora/modules/ROOT/pages/management/docker.adoc
chris529 Oct 13, 2023
2dd0e21
Update docs/antora/modules/ROOT/pages/management/source.adoc
chris529 Oct 13, 2023
516c763
Merge branch 'release/0.7.0' into 1570-add-update-service-node-page-f…
chris529 Oct 13, 2023
3ce876a
update in docker.adoc
chris529 Oct 13, 2023
5f2ae7c
update in source.adoc
chris529 Oct 17, 2023
e2d4dd8
update in source.adoc
chris529 Oct 17, 2023
e0b7368
Merge branch '1570-add-update-service-node-page-for-docker' into 1571…
sameersubudhi Oct 17, 2023
88ecfb2
update in docker.adoc
chris529 Oct 17, 2023
2126e73
update in source.adoc
chris529 Oct 17, 2023
773b3ab
update in docker.adoc
chris529 Oct 17, 2023
51222c9
Update docs/antora/modules/ROOT/pages/management/docker.adoc
chris529 Oct 18, 2023
aaefb4d
Update docs/antora/modules/ROOT/pages/management/docker.adoc
chris529 Oct 18, 2023
1cbda96
Update docs/antora/modules/ROOT/pages/management/source.adoc
chris529 Oct 18, 2023
469bc53
Update docs/antora/modules/ROOT/pages/management/source.adoc
chris529 Oct 18, 2023
68fea38
update in source.adoc
chris529 Oct 18, 2023
730a367
Update docs/antora/modules/ROOT/pages/management/docker.adoc
chris529 Oct 19, 2023
b596062
Update docs/antora/modules/ROOT/pages/management/docker.adoc
chris529 Oct 19, 2023
7cf1835
Update docs/antora/modules/ROOT/pages/management/docker.adoc
chris529 Oct 19, 2023
b1bb6be
update in doker.adoc
chris529 Oct 19, 2023
ee83af0
update in docker.adoc
chris529 Oct 19, 2023
f981e0a
update in docker.adoc
chris529 Oct 19, 2023
acc325e
Update docs/antora/modules/ROOT/pages/management/source.adoc
chris529 Oct 20, 2023
c61d27d
Update docs/antora/modules/ROOT/pages/management/source.adoc
chris529 Oct 20, 2023
68b7ab3
Merge pull request #1853 from LiskHQ/1571-add-update-service-node-pag…
sameersubudhi Oct 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
247 changes: 247 additions & 0 deletions docs/antora/modules/ROOT/pages/update-existing-node/update-docker.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,247 @@
= Update Docker commands
Mona Bärenfänger <[email protected]> Chris Braithwaite <[email protected]>
:description: Describes how to manage Lisk Service v0.7.0 with Docker.
:toc:
:idseparator: -
:idprefix:
:experimental:
:imagesdir: ../assets/images
:source-language: bash
:url_config: configuration/docker.adoc
:url_FLUSHALL: https://redis.io/commands/FLUSHALL
:url_docker_example: https://github.com/LiskHQ/lisk-service/blob/v0.7.0-rc.0/docker/example.env

== Start

.Inside the lisk-service root folder
----
make up
----

This will start Lisk Service with the default configuration, which in turn will connect to a Lisk Core Mainnet node.

In case a different node or network shall be used, xref:{url_config}[configure] Lisk Service accordingly.

[NOTE]
====
It is recommended to copy the xref:{url_docker_example][docker/example.env.] to `env` before running the `make up` command:

----
Common Docker configuration

Service broker
SERVICE_BROKER_TIMEOUT=10
----
====

== Stop

.Inside the lisk-service root folder
----
make down
----

This will stop Lisk Service.

== Show the status of Docker containers

----
docker ps
----

== Reset the Lisk Service database

To reset the database of Lisk Service, drop the respective MySQL and Redis databases.

Before resetting the database, stop Lisk Service:

----
make stop
----

Now connect to the Docker container in which you wish to reset the database. If you are not sure what to choose here, check the available containers via <<show-the-status-of-docker-containers>>.

To connect to the interactive shell of the MySQL Docker container in which you wish to reset the MySQL database, execute the following command:

----
docker exec -it lisk-service-mysql-primary-1 bash
----

=== Drop Database

[tabs]
====
MySQL DB::
+
--
. Login to MySQL with the `lisk` user.
+
----
mysql -ulisk -ppassword
----
+
On successful login, you enter the MYSQL command-line client:
+
----
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2044
Server version: 8.0.27 MySQL Community Server - GPL

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
----
. Drop the `lisk` database.
+
----
mysql> drop database lisk;
----
. Create a fresh database `lisk`.
+
----
mysql> create database lisk;
----
. Log out from MySQL by typing `quit;`
+
----
mysql> quit;
----

Log out of the docker container by pressing kbd:[CRTL] + kbd:[D].

--
MariaDB::
+
--
MariaDB also uses the same SQL commands for querying and manipulating the relevant data, including data storage, client libraries, and replication.

. Login to MariaDB with the `lisk` user.
+
----
docker exec -it lisk_mariadb mysql -uroot -p
----
+
On successful login, you enter the MariaDB command-line client:
+
----
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.7.8-MariaDB-1:10.7.8+maria~ubu2004 mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
----
. Drop the `lisk` database.
+
----
MariaDB [(none)]> drop database lisk;
----
+
.Result
----
Query OK, 0 rows affected (0.009 sec)
----
. Create a fresh database `lisk`
+
----
MariaDB [(none)]> create database lisk;
----
+
.Result
----
Query OK, 1 row affected (0.001 sec)
----
. Log out by typing `quit;`.
+
----
MariaDB [(none)]> exit;
----

Log out of the docker container by pressing kbd:[CRTL] + kbd:[D].
--
====

=== Flush Redis DB

Reset the databases for Redis after dropping the MySQL database:

.Execute command in running docker container.
----
sudo docker exec -it lisk-service_redis_core_persistent_1 /bin/sh
----

.Truncate redis database.
----
redis-cli flushall
----

TIP: Log out of the docker container again by pressing kbd:[CRTL] + kbd:[D].

[NOTE]
====
The `flushall` command truncates all existing Redis databases:

> Deletes all the keys of all the existing databases, not just the current selected one. This command never fails.

For more information, check the Redis documentation: {url_FLUSHALL}[FLUSHALL].

To flush only a particular DB in Redis, execute the following command instead:

----
redis-cli -n <db_number> flushdb
----
====

=== Start Lisk Service

After the databases are reset, start Lisk Service again as usual:

----
make up
----

NOTE: When Lisk Service is started again after a database reset, then the process to reindex all the data is initiated.
This can be quite time-consuming when the chain is long, spanning over hours.

== Logging

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.

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.

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

----
docker container logs lisk-service_gateway_1
----

To check the logs for different microservices using the `make` commands, the following commands listed below can be used:

----
make logs
----
The above command, displays the logs for all the microservices that have been logged so far, and that are currently existing.
----
make logs-live
----
The above command displays the logs for all the microservices currently logged so far, and also continues to display the latest logs.
----
make logs-blockchain-connector
----
The above command is similar to the `make logs` command, but only displays the appropriate logs for the specified microservice.
For example, in this case only for the `blockchain-connector`.
----
make logs-live-blockchain-connector
----
Finally, the above command is similar to the `make logs-live` command, but only displays the logs for the specified microservice.
For example, in this case also only for blockchain-connector here.

Replace the `blockchain-connector` with the specific service name required.
sameersubudhi marked this conversation as resolved.
Show resolved Hide resolved