Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update initial draft for upgrade with Linux and Kubernetes #1725

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

joaniefromtheblock
Copy link
Contributor

Description

  • Initial draft for upgrading with Linus and Kubernetes
  • Will need additional input and help @siladu

Issue(s) fixed

Fixes #1711

Preview

Copy link

vercel bot commented Oct 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
besu-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 7, 2024 1:24am

@joaniefromtheblock
Copy link
Contributor Author

@siladu Could you provide some guidance on what might need to be included for this?

# Upgrade your Besu node

When upgrading your Besu node, we recommend:

- Using an orchestration method (for example, Ansible or Chef) to keep all nodes in sync with your desired configuration.
- Preserving your node's data and configuration
<!--- - Using an orchestration method to keep all nodes in sync with your desired configuration. --->
- Storing your configuration under version control.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove full stop here as well (or add to other bullet?)

2. Back up your data directory and configuration:

```bash
sudo cp -r /var/lib/besu/data /var/lib/besu/data.backup
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For mainnet, the data directory is huge and most stakers wouldn't be able to back it up without running out of space and potentially breaking their node.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sudo cp /etc/besu/config.toml /etc/besu/config.toml.backup
```

3. Download and install the new version:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The coincashew script that uses https://api.github.com/repos/hyperledger/besu/releases/latest is good.
Think we should credit them if we copy it though.

1. Check node status:

```bash
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' localhost:8545
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to have a verification step 👍
Think it's good to check your node is up, back in sync and has peers.

This will also give you the actual version:

curl -X POST --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":1}' http://127.0.0.1:8545

Not everyone will have RPC enabled so this would break for those cases so think we should have some alternative ways to check too.

We have logs and metrics that output the version, e.g. the startup logs look something like this and should always be available:

{"@timestamp":"2025-01-17T07:23:03,791","level":"INFO","thread":"main","class":"Besu","message":"Starting Besu","throwable":""}
{"@timestamp":"2025-01-17T07:23:04,558","level":"INFO","thread":"main","class":"Besu","message":"Connecting to 0 static nodes.","throwable":""}
{"@timestamp":"2025-01-17T07:23:04,643","level":"INFO","thread":"main","class":"Besu","message":"
####################################################################################################
#                                                                                                  #
# Besu version 25.1.0                                                                #
#   
...                                                                                               #

The latest logs will indicate whether besu is in sync too.

The metrics, like the RPCs, aren't enabled by default but if they are then you can check the process_release metric in prometheus or like this:

$ curl -s localhost:9545/metrics | grep process_release
process_release{version="besu/v25.10/linux-x86_64/openjdk-java-21"} 1.0


### Data corruption

If you encounter data corruption, restore the node data from a known good backup. Ensure regular backups are in place to avoid data loss.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could add "As a last resort, deleting the database will resync the node and may solve corruption issues, but may suffer significant downtime depending on the size of the network."

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense to also mention ansible, even if rarely used, since we have this page https://besu.hyperledger.org/private-networks/how-to/deploy/ansible and have the ansible role publicly available.
I just think the other deployment are more relevant/popular.

Sorry if my issue description misled on this :)


The playbook:
### Upgrading in Kubernetes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like someone more familiar with Kubernetes like @joshuafernandes to review this and maybe the docker section please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"How to Upgrade Besu" Refresh
3 participants