Giter VIP home page Giter VIP logo

mysql-operator's Introduction

Charmed MySQL VM operator

Description

This repository contains a Juju Charm for deploying MySQL on virtual machines.

To deploy on Kubernetes, please use Charmed MySQL K8s operator.

Usage

To deploy this charm using Juju 2.9 or later, run:

juju add-model mysql-vm
juju deploy mysql --channel 8.0

Note: the above model must be created on LXD (virtual machines) environment. Use another charm for K8s!

To confirm the deployment, you can run:

juju status --watch 1s

Once MySQL starts up, it will be running on the default port (3306).

If required, you can remove the deployment completely by running:

juju destroy-model mysql-vm --destroy-storage --yes

Note: the --destroy-storage will delete any data persisted by MySQL.

Documentation

Please follow the tutorial guide with detailed explanation how to access DB, configure cluster, change credentials and/or enable TLS.

Integrations (relations)

The charm supports modern mysql_client and legacy mysql, mysql-shared, mysql-router interfaces (in a backward compatible mode).

Note: do NOT relate both modern and legacy interfaces simultaneously!

Modern interfaces

This charm implements the provides data platform library, with the modern mysql_client interface. To relate to it, use the requires data-platform library.

Modern mysql_client interface (database endpoint):

Adding a relation is accomplished with juju relate (or juju integrate for Juju 3.x) via endpoint database. Example:

# Deploy Charmed MySQL cluster with 3 nodes
juju deploy mysql -n 3 --channel 8.0

# Deploy the relevant charms, e.g. mysql-test-app
juju deploy mysql-test-app

# Relate MySQL with your application
juju relate mysql:database mysql-test-app:database

# Check established relation (using mysql_client interface):
juju status --relations

# Example of the properly established relation:
# > Relation provider   Requirer                 Interface     Type
# > mysql:database      mysql-test-app:database  mysql_client  regular

Note: In order to relate with this charm, every table created by the related application must have a primary key. This is required by the group replication plugin enabled in this charm.

Legacy interfaces

Note: Legacy relations are deprecated and will be discontinued on future releases. Usage should be avoided.

This charm supports several legacy interfaces, e.g. mysql, mysql-shared, mysql-router. They were used in some legacy charms in cross-model relations.

Legacy mysql interface (mysql endpoint)

It was a popular interface used by some legacy charms (e.g. "MariaDB", "OSM MariaDB", "Percona Cluster" and "Mysql Innodb Cluster"), often in cross-model relations:

juju deploy mysql --channel 8.0
juju config mysql mysql-interface-database=mediawiki mysql-interface-user=mediawiki
juju deploy mediawiki
juju relate mysql:mysql mediawiki:db

mysql-router interface (db-router endpoint)

It is a relation that one uses with the mysql router charm. The following commands can be executed to deploy and relate to the keystone charm:

juju deploy mysql --channel 8.0
juju deploy mysql-router --series focal
juju deploy keystone --series focal
juju relate mysql-router keystone
juju relate mysql:db-router mysql-router:db-router

Note: pay attention to deploy identical series for keystone and mysql-router applications (due to the subordinate charm nature of mysql-router).

mysql-shared interface (shared-db endpoint)

It is a relation that one uses when the application needs to connect directly to the database cluster. It is supported by various legacy charms, e.g. mysql-innodb-cluster. The following commands can be executed to deploy and relate to the keystone charm:

juju deploy mysql --channel 8.0
juju deploy keystone --series focal
juju relate keystone:shared-db mysql:shared-db

Security

Security issues in the Charmed MySQL VM Operator can be reported through LaunchPad. Please do not file GitHub issues about security issues.

Contributing

Please see the Juju SDK docs for guidelines on enhancements to this charm following best practice guidelines, and CONTRIBUTING.md for developer guidance.

License

The Charmed MySQL VM Operator is distributed under the Apache Software License, version 2.0. It installs/operates/depends on MySQL Community Edition, which is licensed under the GPL License, version 2.

Trademark Notice

MySQL is a trademark or registered trademark of Oracle America, Inc. Other trademarks are property of their respective owners.

mysql-operator's People

Contributors

carlcsaposs-canonical avatar shayancanonical avatar paulomach avatar taurus-forever avatar renovate[bot] avatar deusebio avatar delgod avatar averma-canonical avatar dragomirp avatar zmraul avatar jardon avatar welpaolo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.