[#88] Add relabel for instance

Signed-off-by: Sergio Nemirowski <sergio@nspcc.ru>
This commit is contained in:
Sergio Nemirowski 2021-06-16 21:37:07 +03:00 committed by Alex Vanin
parent c172fcc11f
commit a4587dbcd4
4 changed files with 46 additions and 20 deletions

View file

@ -6,7 +6,7 @@ docker image and run it with docker-compose.
## Build image
Prepared neofs-storage-testnet image is available at Docker Hub.
Prepared **neofs-storage-testnet** image is available at Docker Hub.
However, if you need to rebuild it for some reason, run
`make image-storage-testnet` command.
@ -49,23 +49,21 @@ neo-go wallet nep17 transfer -w wallet.json -r https://rpc1.n3.nspcc.ru:20331 \
### Configure
Then configure docker-compose.yml file. Change endpoints values. Both
Then configure `node_config.env` file. Change endpoints values. Both
should contain your **public** IP.
```yaml
environment:
- NEOFS_NODE_ADDRESS=65.52.183.157:36512
- NEOFS_GRPC_ENDPOINT=65.52.183.157:36512
```
NEOFS_NODE_ADDRESS=65.52.183.157:36512
NEOFS_GRPC_ENDPOINT=65.52.183.157:36512
```
Set up your [UN/LOCODE](https://unece.org/trade/cefact/unlocode-code-list-country-and-territory)
attribute.
```yaml
environment:
- NEOFS_NODE_ADDRESS=65.52.183.157:36512
- NEOFS_GRPC_ENDPOINT=65.52.183.157:36512
- NEOFS_NODE_ATTRIBUTE_1=UN-LOCODE:RU LED
```
NEOFS_NODE_ADDRESS=65.52.183.157:36512
NEOFS_GRPC_ENDPOINT=65.52.183.157:36512
NEOFS_NODE_ATTRIBUTE_1=UN-LOCODE:RU LED
```
You can validate UN/LOCODE attribute in
@ -98,7 +96,7 @@ ScriptHash3.0BE dc4b0b44d01c16667880062e2fd4508f9939fedf
$ echo '11ab917cd99170cb8d0d48e78fca317564e6b3aaff7f7058952d6175cdca0f56' | xxd -r -p > my_wallet.key
```
Then specify path to this file in docker-compose
Then specify path to this file in `docker-compose.yml`
```yaml
volumes:
- neofs_storage:/storage
@ -128,4 +126,4 @@ log, setup log level to debug with this env:
```yaml
environment:
- NEOFS_LOGGER_LEVEL=debug
```
```

View file

@ -5,26 +5,23 @@ services:
storage01:
image: nspccdev/neofs-storage-testnet:0.21.1
container_name: neofs-testnet
env_file: node_config.env
network_mode: host
restart: always
volumes:
- neofs_storage:/storage
- <NEOFS_NODE_KEY>:/node.key
stop_signal: SIGINT
environment:
- NEOFS_NODE_ADDRESS=<ANNOUNCE_ADDRESS>
- NEOFS_GRPC_ENDPOINT=<BIND_ADDRESS>
- <NEOFS_NODE_ATTRIBUTE_1>=UN-LOCODE:<XX YYY>
- NEOFS_NODE_ATTRIBUTE_2=Price:100000
vmagent:
image: victoriametrics/vmagent:v1.61.0
container_name: vmagent
depends_on:
- storage01
env_file: node_config.env
command:
- '--promscrape.config=/configs/prometheus.yml'
- '--remoteWrite.url=https://collector.fs.neo.org:8429/api/v1/write'
- '-promscrape.config=/configs/prometheus.yml'
- '-remoteWrite.url=https://collector.fs.neo.org:8429/api/v1/write'
network_mode: host
restart: always
volumes:

View file

@ -0,0 +1,28 @@
#
# Specify your public IP address or domain name with the open port
# in NODE_ADDRESS and BIND_ADDRESS
# By default keep these addresses the same.
# This is used for the public announcement in the network map
#
#NEOFS_NODE_ADDRESS=<ANNOUNCE_ADDRESS>
#NEOFS_NODE_ADDRESS=1.1.1.1:36512
NEOFS_NODE_ADDRESS=
# This is used to open the connection listening socket on your machine
#
#NEOFS_GRPC_ENDPOINT=<BIND_ADDRESS>
#NEOFS_GRPC_ENDPOINT=1.1.1.1:36512
NEOFS_GRPC_ENDPOINT=
#https://unece.org/trade/cefact/unlocode-code-list-country-and-territory
# Find suitable LOCODE (from the link above) for your storage node.
#
#NEOFS_NODE_ATTRIBUTE_1=UN-LOCODE:<XX YYY>
#NEOFS_NODE_ATTRIBUTE_1=UN-LOCODE:RU LED
NEOFS_NODE_ATTRIBUTE_1=
NEOFS_NODE_ATTRIBUTE_2=Price:100000

View file

@ -8,3 +8,6 @@ scrape_configs:
scrape_interval: 5s
static_configs:
- targets: ['127.0.0.1:9090']
relabel_configs:
- target_label: 'instance'
replacement: "%{NEOFS_NODE_ADDRESS}"