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

docker: add compose file for database #2898

Merged
merged 4 commits into from
Oct 29, 2018

Conversation

marcaurele
Copy link
Member

Description

A docker-compose file to setup quickly the database for CS. This helps during local development and remove the need to install a local MariaDB/MySQL.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

GitHub Issue/PRs

None

Screenshots (if appropriate):

How Has This Been Tested?

docker-compose up starts the MariaDB 10.0 database for local development.

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
    Testing
  • I have added tests to cover my changes.
  • All relevant new and existing integration tests have passed.
  • A full integration testsuite with all test that can run on my environment has passed.

@marcaurele
Copy link
Member Author

I perform my local development with that docker setup and thought I could share it to see if it can help others. Don't hesitate to close it if this is not really needed, or some sort of duplicate.

@rohityadavcloud
Copy link
Member

@marcaurele how do I test it? I don't use docker for cloudstack development, what commands etc can be used to test it?

@marcaurele
Copy link
Member Author

marcaurele commented Oct 25, 2018

in a terminal : docker-compose up

@@ -0,0 +1,17 @@
version: '2'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marcaurele can license be added to this file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I've just pushed the change.

@rohityadavcloud
Copy link
Member

@marcaurele does mariadb 10.x work out of the box, for example mysql 5.7 needs the following config:

[mysqld]

server_id = 1
sql-mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION,ERROR_FOR_DIVISION_BY_ZERO,NO_ZERO_DATE,NO_ZERO_IN_DATE,NO_ENGINE_SUBSTITUTION"
innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
max_connections=1000
log-bin=mysql-bin
binlog-format = 'ROW'

Can you check/ensure any additional config to be provided?

@marcaurele
Copy link
Member Author

@rhtyd it's maridb 10.0 and not 10.X which is equivalent to mysql 5.6, so there's no need for any extra configuration. It's working out of the box.

@rohityadavcloud
Copy link
Member

@marcaurele OK, what about the innodb settings?

innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
max_connections=1000
log-bin=mysql-bin
binlog-format = 'ROW'

@marcaurele
Copy link
Member Author

Are those the custom configuration made for CS?

@rohityadavcloud
Copy link
Member

@marcaurele see install/admin docs, those are recommended mysql settings. The max mysql conn. settings has to do with max job/thread pool size limits.

@marcaurele
Copy link
Member Author

pushed another file which is included in the compose to customize the configuration.

@@ -0,0 +1,7 @@
[mysqld]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marcaurele sorry, license please.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about it but forgot to add it before pushing. Done!

@rohityadavcloud
Copy link
Member

Thanks, LGTM @marcaurele we just need another review and then we can merge this.

@marcaurele
Copy link
Member Author

@rafaelweingartner / @wido / @DaanHoogland / @GabrielBrascher are you using docker for your development?

@rohityadavcloud rohityadavcloud added this to the 4.12.0.0 milestone Oct 29, 2018
@rohityadavcloud rohityadavcloud merged commit 3101612 into apache:master Oct 29, 2018
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

Successfully merging this pull request may close these issues.

4 participants