Influxdb 2.0 Backup Fails with Read:authorizations is unauthorized - backup

I am trying to backup influxdb using backup command as stated in v2.0 doc.
https://docs.influxdata.com/influxdb/v2.0/backup-restore/backup/
docker-compose.yaml
version: '3'
services:
influxdb:
image: influxdb:2.0
ports:
- 8086:8086
volumes:
- influxdb-data:/var/lib/influxdb2
- /influxdb-backup/:/influxdb-backup/
restart: always
volumes:
influxdb-data:
external: true
The Backup Commmand fails as follow.
docker-compose exec influxdb influx backup influxdb-backup -t xxx
2021-04-22T22:14:06.631863Z info Backing up KV store {"log_id": "0TfvCY9G000", "path": "20210422T221406Z.bolt"}
Error: Read:authorizations is unauthorized.
See 'influx backup -h' for help

Related

Java Application on Docker (MySQL + Rabbit)

I am making an REST API which has a POST method which accepts a String as JSON and then sends it over RabbitMQ Topic and then a consumer is converting into entity and saving into a MySQL db.
Everything is running fine locally, but my task is to upload it on Docker and to be run online.
When I try to change "localhost" in properties with container names my Maven build fails....
How can i fix that?
I am putting my .properties:
spring.main.allow-bean-definition-overriding=true
spring.datasource.url=jdbc:mysql://localhost:3306/rabbit_messages?createDatabaseIfNotExist=true
spring.datasource.username=root
spring.datasource.password=1234
spring.rabbitmq.host = 127.0.0.1
spring.rabbitmq.port = 5672
spring.rabbitmq.username = guest
spring.rabbitmq.password = guest
and my docker-compose:
version: '3'
services:
my-app:
container_name: myapp
build:
context: .
dockerfile: Dockerfile
ports:
- "8080:8080"
links:
- rabbitmq
- mysql
environment:
- SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3307/rabbit_messages?createDatabaseIfNotExist=true
- SPRING_DATASOURCE_USERNAME=root
- SPRING_DATASOURCE_PASSWORD=1234
- SPRING_RABBITMQ_HOST=rabbitmq
depends_on:
- rabbitmq
- mysql
java:
image: openjdk:latest
container_name: openjdk
rabbitmq:
image: rabbitmq:3-management
container_name: rabbitmq
ports:
- "5672:5672"
- "15672:15672"
erlang:
image: erlang:latest
container_name: erlang
mysql:
image: mysql:latest
container_name: mysql
ports:
- "3307:3307"
environment:
- MYSQL_DATABASE=rabbit_messages
- MYSQL_ROOT_PASSWORD=1234
- MYSQL_PASSWORD=1234
restart: on-failure

Connect SQL IDE to docker db container?

I am using docker with three services:
version: '2'
services:
nginx:
image: nginx:latest
container_name: nz01
ports:
- "8000:8000"
volumes:
- ./src:/src
- ./config/nginx:/etc/nginx/conf.d
depends_on:
- web
web:
build: .
container_name: dz01
depends_on:
- db
volumes:
- ./src:/src
expose:
- "8000"
db:
image: postgres:latest
container_name: pz01
volumes:
- ./postgres-data:/var/lib/postgresql/data
All seems to work pretty well, and I know that db service is running on 172.18.0.2 but when I use Datagrip to connect to the DB to work faster with table creation and inserts and things like that It does not work.
My configuration at django app is:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'postgres',
'USER': 'postgres',
'HOST': 'pz01',
'PORT': 5432,
}
}
The configuration at Datagrip:
'DB_NAME': 'postgres',
'USER': 'postgres',
'HOST': 'pz01',
'PORT': 5432,
I also tried with host as the ip, and localhost and neither works.
The password as null, because the db service log shows that by default it does not have password.
How can I connect to my docker db from my macbook?
EDIT:
As #Dihgg says I fixed the port at DB service.
I set at
db:
image: postgres:latest
container_name: pz01
ports:
- "5433:5432"
volumes:
- ./postgres-data:/var/lib/postgresql/data
The port is not 5432:5432 because when this is the value I get:
ERROR: for db Cannot start service db: b'driver failed programming external connectivity on endpoint pz01 (146bb3cdada29f75766aa888143b4af17b267d13096db60fb0ccdaedb710e77e): Error starting userland proxy: Bind for 0.0.0.0:5432 failed: port is already allocated'
ERROR: Encountered errors while bringing up the project.
Despite that, I can't connect from Datagrip, when I use pz01 as host the error is(trying with 5432 or 5433 port and no password set):
Host is unknown
When I use as host the ip the error is: Connection failed
Try expose the port in the db container
db:
image: postgres:latest
container_name: pz01
ports:
- "5432:5432"
volumes:
- ./postgres-data:/var/lib/postgresql/data
And then, use the localhost:5432 to connect

How to connect to another docker service from one docker service in a docker swarm cluster?

In the docker swarm cluster, launched two services:
sv_web
sv_api
The stack deploy file of web is:
version: "3"
services:
web:
image: XXX/sv_web:latest
ports:
- "80:80"
networks:
- webnet
networks:
webnet:
Deploy:
docker stack deploy -c ~/docker-compose-web.yml sv
The stack deploy file of api is:
version: "3"
services:
web:
image: XXX/sv_api:latest
ports:
- "81:81"
networks:
- webnet
networks:
webnet:
Deploy:
docker stack deploy -c ~/docker-compose-api.yml sv
Now want to connect sv_api service inside the sv_web application. Tried to write:
api_server = "sv_api:81"
But can't connect the sv_api service after deploying it. If use the real IP of the host in the cluster, it can be found: [HOST]:81.
So how to connect to the API service from web service in this way?
For connect you should using
depends_on
services:
some_service:
image: link
depends_on:
-api
api:
image: link
More info at docs: docker docs

repository not building when connected to bitbucker server on drone

Im trying drone 0.5 with bitbucket server,
And it seems connected because i can see my repositories.
But it keeps saying that it does not have any builds yet.
I added the drone.yml to my repo but nothing... am i missing something
I noticed that you said you:
I added the drone.yml to my repo
however that would be problematic because you have to add a:
.drone.yml
note that the correct file has a "." in front of it.
Additionally you should be trying to manually type in the authorization url to give drone access to your bitbucket account (ps drone wont work without some kind of scm set up) an example of the authorization url would be:
https://my.exampleurl.com/authorize
These are similar to the same instructions you can find here: http://readme.drone.io/admin/installation-guide/
I often see people post links like this and then someone will ask them to have copied the link's content into the actual response so I am going to do that here (you know just in case the link flys away):
Drone is distributed as a single binary file inside a scratch Docker image. Docker is the only dependency. This guide demonstrates how to install Drone using docker-compose.
Example Docker compose file with GitHub integration:
version: '2'
services:
drone-server:
image: drone/drone:0.5
ports: [ 80:8000 ]
volumes: [ ./drone:/var/lib/drone/ ]
restart: always
environment:
- DRONE_OPEN=true
- DRONE_GITHUB=true
- DRONE_GITHUB_CLIENT=${DRONE_GITHUB_CLIENT}
- DRONE_GITHUB_SECRET=${DRONE_GITHUB_SECRET}
- DRONE_SECRET=${DRONE_SECRET}
drone-agent:
image: drone/drone:0.5
command: agent
restart: always
depends_on: [ drone-server ]
volumes: [ /var/run/docker.sock:/var/run/docker.sock ]
environment:
- DRONE_SERVER=ws://drone-server:8000/ws/broker
- DRONE_SECRET=${DRONE_SECRET}
Drone integrates with multiple version control providers, configured using environment variables. This example demonstrates basic GitHub integration.
You will need to register Drone with GitHub to obtain an oauth2 client and secret. The authorization callback url should match :///authorize
services:
drone-server:
image: drone/drone:0.5
ports: [ 80:8000 ]
volumes: [ ./drone:/var/lib/drone/ ]
restart: always
environment:
- DRONE_OPEN=true
+ - DRONE_GITHUB=true
+ - DRONE_GITHUB_CLIENT=${DRONE_GITHUB_CLIENT}
+ - DRONE_GITHUB_SECRET=${DRONE_GITHUB_SECRET}
- DRONE_SECRET=${DRONE_SECRET}
Drone mounts a volume on the host machine to persist the sqlite database. This is not required when using alternate database engines.
services:
drone-server:
image: drone/drone:0.5
ports: [ 80:8000 ]
+ volumes: [ ./drone:/var/lib/drone/ ]
restart: always
Drone agents require access to the host machine Docker daemon.
services:
drone-agent:
image: drone/drone:0.5
command: agent
restart: always
depends_on: [ drone-server ]
+ volumes: [ /var/run/docker.sock:/var/run/docker.sock ]
Drone agents require the server address for agent-to-server communication.
Your server URL should use the wss:// protocol when TLS is enabled
services:
drone-agent:
image: drone/drone:0.5
command: agent
restart: always
depends_on: [ drone-server ]
volumes: [ /var/run/docker.sock:/var/run/docker.sock ]
environment:
+ DRONE_SERVER=ws://drone-server:8000/ws/broker
DRONE_SECRET=${DRONE_SECRET}
Drone server and agents use a shared secret to authenticate communication. This should be a random string of your choosing and should be kept private.
services:
drone-server:
image: drone/drone:0.5
ports: [ 80:8000 ]
volumes: [ ./drone:/var/lib/drone/ ]
restart: always
environment:
- DRONE_OPEN=true
- DRONE_GITHUB=true
- DRONE_GITHUB_CLIENT=${DRONE_GITHUB_CLIENT}
- DRONE_GITHUB_SECRET=${DRONE_GITHUB_SECRET}
+ - DRONE_SECRET=${DRONE_SECRET}
drone-agent:
image: drone/drone:0.5
command: agent
restart: always
depends_on: [ drone-server ]
volumes: [ /var/run/docker.sock:/var/run/docker.sock ]
environment:
DRONE_SERVER=ws://drone-server:8000/ws/broker
+ DRONE_SECRET=${DRONE_SECRET}
Drone registration is closed by default. This example enables open registration for users that are members of approved GitHub organizations.
services:
drone-server:
image: drone/drone:0.5
ports: [ 80:8000 ]
volumes: [ ./drone:/var/lib/drone/ ]
restart: always
environment:
+ - DRONE_OPEN=true
+ - DRONE_ORGS=dolores,dogpatch
- DRONE_GITHUB=true
- DRONE_GITHUB_CLIENT=${DRONE_GITHUB_CLIENT}
- DRONE_GITHUB_SECRET=${DRONE_GITHUB_SECRET}
- DRONE_SECRET=${DRONE_SECRET}

Docker-compose not attaching redis: redis does not start

I have an issue with my docker-compose configuration that I cannot pinpoint: redis won't start.
My docker-compose.yml:
web:
build: ./web
links:
- db
- redis
ports:
- "8080:8080"
db:
image: mysql
ports:
- "3307:3306"
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: bignibou_dev
redis:
build: ./redis
ports:
- "63790:6379"
My ./web/Dockerfile:
FROM java:8
ADD ./bignibou-server-1.0.jar /app/bignibou-server-1.0.jar
ADD ./spring-cloud.properties /app/spring-cloud.properties
ENV SPRING_CLOUD_PROPERTIESFILE=/app/spring-cloud.properties
ENV SPRING_PROFILES_ACTIVE=cloud
ENV SPRING_CLOUD_APP_NAME=bignibou
ENV CLEARDB_DATABASE_URL=mysql://root:root#localhost:3307/bignibou_dev
ENV REDISCLOUD_URL=redis://dummy:dummy#localhost:63790
ENV DYNO=dummy
EXPOSE 8080
ENTRYPOINT [ "java", "-jar", "/app/bignibou-server-1.0.jar" ]
My ./redis/Dockerfile:
FROM redis
COPY redis.conf /usr/local/etc/redis/redis.conf
EXPOSE 6379
ENTRYPOINT [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
When I run sudo docker-compose up, redis is not started by Docker although mysql/db starts properly.
Can anyone please help?
Instead of localhost , write your redis service name which in your case is redis , so connection will be like :
redis://dummy:dummy#redis:63790