Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local mysql #55

Open
xinglongjian opened this issue Mar 17, 2017 · 3 comments
Open

local mysql #55

xinglongjian opened this issue Mar 17, 2017 · 3 comments

Comments

@xinglongjian
Copy link

May I use local mysql in the docker-gerrit? What variables need to set?

issues occured:
➜ ~ docker run --name gerrit -e GERRIT_START_ACTION=supervise -v ~/gerrit_volume:/var/gerrit/review_site -p 8080:8080 -p 29418:29418 -e DATABASE_TYPE=mysql -e DB_ENV_MYSQL_USER=gerrit2 -e DB_ENV_MYSQL_PASSWORD=secret -e DB_ENV_MYSQL_DB=reviewdb -e USER_NAME=xxx openfrontier/gerrit:2.12.3

/gerrit-entrypoint.sh: ignoring /docker-entrypoint-init.d/*

Upgrading gerrit...
fatal: DbInjector failed
fatal: Unable to determine SqlDialect
fatal: caused by com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
fatal:
fatal: The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
fatal: caused by java.net.ConnectException: Connection refused

@thinkernel
Copy link
Contributor

Hi @xinglongjian
You should let the gerrit know where your mysql server is by providing 2 environment variables below.
-e DB_PORT_3306_TCP_ADDR=your mysql host IP addrss
-e DB_PORT_3306_TCP_PORT=your mysql port

@xinglongjian
Copy link
Author

I set those 2 environment variables and the result is same!

~docker run --name gerrit -e GERRIT_START_ACTION=supervise -v ~/gerrit_volume:/var/gerrit/review_site -p 8080:8080 -p 29418:29418 -e DATABASE_TYPE=mysql -e MYSQL_USER=gerrit2 -e MYSQL_PASSWORD=secret -e MYSQL_DB=reviewdbb -e DB_PORT_3306_TCP_ADDR=localhost -e DB_PORT_3306_TCP_PORT=3306 -e USER_NAME=xinglongjian openfrontier/gerrit:2.12.3

/gerrit-entrypoint.sh: ignoring /docker-entrypoint-init.d/*

Upgrading gerrit...
fatal: DbInjector failed
fatal: Unable to determine SqlDialect
fatal: caused by com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
fatal:
fatal: The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
fatal: caused by java.net.ConnectException: Connection refused

@qinshulei
Copy link

You need wait mysql container ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants