On Tue, Apr 23, 2024 at 10:22 PM Satya Elipe <[email protected]> wrote:

> Hi All
>
> I'm dockerizing our static/standalone GoCD server.
>
> Hence copied the content from the static GoCD server to EFS and mounted
> that EFS content into the container (GoCD server container).
>
> And with that, container starts and runs but it can't fetch any data, and
> I see the below in the log:
>
> ```jvm 2    | Caused by:
> org.h2.jdbc.JdbcSQLNonTransientConnectionException: Database may be already
> in use: null. Possible solutions: close all other connection(s); use the
> server mode [90020-200]
>
> jvm 2    | Caused by: java.lang.IllegalStateException: The file is locked:
> nio:/godata/db/h2db/cruise.mv.db [1.4.200/7]```
>
> Looks like the static/old server acquired the lock and when the data from
> that server copied to EFS lock is still maintained and hence the new server
> has the db file locked and couldn't fetch any data.
>
> Wonder, how are the people handling this situation ?
> We need the old server running as well when the new server is being
> brought up within the docker container.
>
> Any inputs will be of great help.
>

If this is an important GoCD instance, then I urge you to move off H2DB to
PostgreSQL.

We recently migrated a GoCD instance that has about 6 years of data in H2DB
to use RDS and hosted GoCD itself as a Container. We are running on an EKS
cluster and are making use of the Elastic Agent plugin.

The H2DB that GoCD uses does not allow multiple processes to share the same
database file. I recommend that you stop the original GoCD process (the
jobs will keep running and will wait for the server to come back), rsync
the DB contents to the EFS store to speed up the copy and remove the locks,
and then start the new GoCD instance as a container with the DB mounted via
EFS.

If you could consider moving off H2DB and using postgres, then use the DB
Migrator tool and do so. You process would then be:
1. Stop the older GoCD server
2. Use the DB Migrator tool to migrate from the H2DB file to a PostgreSQL
instance.
3. Start the GoCD instance as a Container process with the configuration to
point it to the PostgreSQL instance.

You may want to triel this once and then perform the actual switch.



>
> Many thanks,
> Satya
>
> --
> You received this message because you are subscribed to the Google Groups
> "go-cd" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/go-cd/CADKEDRoqGkWLv6%3DUG8CA-NAD6sRETHiE6bB5Q2crf2Ezbn-cMw%40mail.gmail.com
> <https://groups.google.com/d/msgid/go-cd/CADKEDRoqGkWLv6%3DUG8CA-NAD6sRETHiE6bB5Q2crf2Ezbn-cMw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/go-cd/CANiY96af882MjPPSVFowz9hNqakLNS7xF%2Bu7mLWb_2FXQ8fQrg%40mail.gmail.com.

Reply via email to