Node migration
In august 2022, two big updates took place which motivated the preparation of a new AURORAL Node version. This version is tagged as v2 in GitHub.
- A new gateway was developed, which is more lightweight and should bring more stability.
- Now AURORAL has a production environment, users can choose to connect directly or migrate their old Nodes following this guide.
Because of these changes, it is recommended to migrate the Nodes to the v2.
Therefore, this article covers two migration cases:
- Upgrade to v3 of internal components (Agent and Gateway).
- Moving a Node from development environment to production or vice versa.
There are two ways described in this blog entry together with their pros and cons:
A: Exporting items and starting with a clean installation [recommended]
Pros: – You will have up to date node with extensions, node_cli and docker-compose file
Cons: – Your OIDS will be changed. If item is part of contract it needs to be contracted again
How to:
– Run ./node_cli -u
to update your node instance to latest version and wait until it is updated
– Run your node (command ./node_cli
)
– Locate your node's Swagger page (typically http://localhost:81)
– Use endpoint GET /api/admin/export
– Ensure that your items are in retrieved response and store exportfile to your disk
– Now you can stop your old node with command ./node_cli -s
– Follow procedure Installing the AURORAL Node
– After installing and registering new node, open node's Swagger page (again typically http://localhost:81), locate POST /api/admin/import
endpoint and copy there content of your exportfile
– Check repsonse, and if everything is OK, you can remove your old node (using ./node_cli -r
in old node folder)
B: Updating Node with Java GTW manually
Pros: – Your OIDs will be unchanged
Cons: – You will not have latest features, extensions and docker-compose file
How to:
– Disable node (./node_cli -s
)
– Open docker-compose.yml file in text editor, and locate gateway part
– You need to replace it with text bellow:
gateway:
restart: unless-stopped
volumes:
- aur_gateway:/gateway/persistance
- ./.env:/gateway/.env:ro
image: ghcr.io/auroralh2020/auroral_gateway_js:latest
- Then replace your node_cli file with new one from https://github.com/AuroralH2020/auroral-node.git
- Now you need to remove ?aurgateway docker volume. It's name depends on name of your node's folder.
- Run
./node_cli -k
to regenerate your key pair and update public key in NM platform - Update everything using
./node_cli -u
command Copy these lines to (hidden)
.env
file located in your node's folder:XMPP_SERVICE=xmpp://auroral.dev.bavenir.eu:5222 XMPP_DOMAIN=auroral.dev.bavenir.eu XMPP_RESOURCE=AuroralNode NM_HOST="https://auroral.dev.bavenir.eu/api/gtw/v1/" ## EventChannelSettings EVENT_SETTINGS_FILE=persistance/events.json ## Agent connection GTW_TOKEN_TTL=86400 GTW_AGENT_HOST=http://auroral-agent GTW_AGENT_PORT=4000 GTW_AGENT_TIMEOUT=10000
Done! You can now start your node with new gateway. Remember that not all features are availible in this mixed version and it is better to start with clean installation if you need to use any extension
Brought to you by the AURORAL community, keep posted! 💪