Have issue when create ipfs-cluster like a docker compose(cluster.lock),(repo.lock)

2023-08-12T11:11:04.902Z INFO service ipfs-cluster-service/daemon.go:50 Initializing. For verbose output run with “-l debug”. Please wait…
error obtaining execution lock: lock /data/ipfs-cluster/cluster.lock: someone else has the lock. If no other ipfs-cluster-service process is running, remove /data/ipfs-cluster/cluster.lock, or make sure that the config folder is writable for the user running ipfs-cluster-service.

:~/ipfs/ipfs0$ docker exec -it ipfs0 sh
/ # ipfs daemon
Initializing daemon…
Kubo version: 0.21.0-294db3e
Repo version: 14
System version: amd64/linux
Golang version: go1.19.10

Error: resource temporarily unavailable

when remove cluster.lock, and use ipfs-cluster-service daemon I got this:
2023-08-12T11:18:14.040Z INFO service ipfs-cluster-service/daemon.go:50 Initializing. For verbose output run with “-l debug”. Please wait…
error creating datastore: failed to open pebble database: resource temporarily unavailable

I think something wrong with network, have any idea? (instead peers id stars)
FYI I am using swarm.key and Cluster_secret

ipfs-cluster-ctl peers ls

********************************************** | cluster0 | Sees 0 other peers

Addresses:
- /ip4/127.0.0.1/tcp/9096/p2p/***************************************************
- /ip4/172.25.0.3/tcp/9096/p2p/***************************************************
IPFS: ***************************************************
- /ip4/127.0.0.1/tcp/4001/p2p/***************************************************
- /ip4/172.25.0.2/tcp/4001/p2p/***************************************************

My compose file, swarm key I added to container folder

version: ‘3.4’
services:

cluster peer0

use peer0 as the bootstrap peer

ipfs0:
container_name: ipfs0
image: ipfs/go-ipfs:release
ports:
- “4001:4001” # ipfs swarm
- “5001:5001” # ipfs api
- “8081:8080” # ipfs gateway
volumes:
- /home/alex/ipfs/ipfs0:/data/ipfs

cluster0:
container_name: cluster0
image: ipfs/ipfs-cluster:latest
depends_on:
- ipfs0
environment:
CLUSTER_PEERNAME: cluster0
CLUSTER_SECRET: "*********************************************"
CLUSTER_IPFSHTTP_NODEMULTIADDRESS: /dns4/ipfs0/tcp/5001
CLUSTER_CRDT_TRUSTEDPEERS: '
’ # Trust all peers in Cluster
CLUSTER_RESTAPI_HTTPLISTENMULTIADDRESS: /ip4/0.0.0.0/tcp/9094 # expose API
CLUSTER_MONITORPINGINTERVAL: 2s # Speed up peer discovery
ports:
- “9094:9094” # http api
- “9095:9095” # proxy api
- “9096:9096” # cluster swarm, other peers connect via this port
volumes:
- /home/alex/ipfs/cluster0:/data/ipfs-cluster

Another cluster process is using the same config folder, as the message tells you.

Yes, but it’s happen when I create from scratch.

ipfs-cluster-service daemon
2023-08-12T11:33:23.054Z INFO service ipfs-cluster-service/daemon.go:50 Initializing. For verbose output run with “-l debug”. Please wait…
error creating datastore: failed to open pebble database: resource temporarily unavailable
/ #

:~$ docker-compose down
Removing network dockermaker_default
dockermaker@agti-node-0:~$ docker-compose up -d
Creating network "dockermaker_default" with the default driver
Creating ipfs0 ... done
Creating cluster0 ... done
dockermaker@agti-node-0:~$ docker compose ps
NAME                COMMAND                  SERVICE             STATUS               PORTS
cluster0            "/sbin/tini -- /usr/…"   cluster0            running              0.0.0.0:9094-9096->9094-9096/tcp, :::9094-9096->9094-9096/tcp
ipfs0               "/sbin/tini -- /usr/…"   ipfs0               running (starting)   0.0.0.0:4001->4001/tcp, 0.0.0.0:5001->5001/tcp, 0.0.0.0:8081->8080/tcp, :::4001->4001/tcp, :::5001->5001/tcp, :::8081->8080/tcp
dockermaker@agti-node-0:~$ cd ipfs/
dockermaker@agti-node-0:~/ipfs$ ls
cluster0  ipfs0  swarm.key
dockermaker@agti-node-0:~/ipfs$ cd cluster0/
dockermaker@agti-node-0:~/ipfs/cluster0$ ls
cluster.lock  identity.json  pebble  peerstore  service.json  swarm.key
dockermaker@agti-node-0:~/ipfs/cluster0$ docker exec -it cluster0 sh
/ # ipfs-cluster-service daemon
2023-08-12T12:35:20.948Z        INFO    service ipfs-cluster-service/daemon.go:50       Initializing. For verbose output run with "-l debug". Please wait...
error obtaining execution lock: lock /data/ipfs-cluster/cluster.lock: someone else has the lock. If no other ipfs-cluster-service process is running, remove /data/ipfs-cluster/cluster.lock, or make sure that the config folder is writable for the user running ipfs-cluster-service.

The docker container launched by compose is already running ipfs-cluster-service. When you exec sh and run ipfs-cluster-service daemon again, you get an error because it is already running.

1 Like

Okay, its clear. And for adding new peer how can I get any peer id or network info? Issue above