Installing Galera Cluster With MariaDB

2y ago
32 Views
7 Downloads
1.89 MB
29 Pages
Last View : 18d ago
Last Download : 3m ago
Upload by : Asher Boatman
Transcription

Installing GaleraCluster with MariaDBCodership Training

IntroductionInstalling Galera Cluster with MariaDBIntroductionConfiguring NodesStarting GaleraGalera Cluster OverviewOpening PortsConclusionInstalling Software

IntroductionsCodership OyRussell Dyer, PresenterCreators & Developers of Galera ClusterEmployees in Multiple CountriesGalera ClusterKB Editor, Documentation, Instructor(MySQL, MariaDB)Writer(O'Reilly Books)Released Initially in May 2007Over 1.5 Million DownloadsInstalling Galera Cluster with MariaDBCopyright Codership Oy 2019. All Rights Reserved.library@galeracluster.comVersion 1.0Slide 3

Tutorial OutlineGalera Cluster OverviewInstalling SoftwareConfiguring NodesOpening PortsStarting GaleraInstalling Galera Cluster with MariaDBCopyright Codership Oy 2019. All Rights Reserved.library@galeracluster.comVersion 1.0Slide 4

Galera Cluster OverviewInstalling Galera Cluster with MariaDBIntroductionConfiguring NodesStarting GaleraGalera Cluster OverviewOpening PortsConclusionInstalling Software

Basic Replication ConceptsNode — Physical or Virtual ServerMasterDatabase — MariaDBReplicationSlaveClient WritesHigh AvailabilitySlaveLoad BalancingClient ReadsClient ReadsClient ReadsInstalling Galera Cluster with MariaDBCopyright Codership Oy 2019. All Rights Reserved.library@galeracluster.comVersion 1.0Slide 6

Galera Cluster ConceptsVirtual Synchronous ReplicationGalera ClusterTrue Multi-Master SolutionConflict Detection & Resolution onCommitNode 1Client WritesEasy MaintenanceNode 2Node 3Automatic ProvisioningNode IsolationRolling UpgradesClient WritesInstalling Galera Cluster with MariaDBCopyright Codership Oy 2019. All Rights Reserved.Client Readslibrary@galeracluster.comVersion 1.0Slide 7

Galera Factors & Best PracticesServersLinux or Unix Operating SystemDedicated Servers with Plenty of RAMMultiple, Odd Number of NodesNot a Stand-AloneThree MinimumEqual NodesEquipment & SoftwareConfigurationCodership KB - Best Practices Articles: mlInstalling Galera Cluster with MariaDBCopyright Codership Oy 2019. All Rights Reserved.library@galeracluster.comVersion 1.0Slide 8

Installing SoftwareInstalling Galera Cluster with MariaDBIntroductionConfiguring NodesStarting GaleraGalera Cluster OverviewOpening PortsConclusionInstalling Software

Minimal SoftwareOperating System & Utilitiesssh -i '.ssh/galera-key' centos@12.127.17.75Synchronizing Toolssh galera-1FirewallLOGIN METHODSDatabase SoftwareGalera ClusterSimpler with config FileHost galera-1HostName 12.127.17.75User centosIdentityFile /.ssh/galera-keyHost galera-2HostName 12.127.17.89User centosIdentityFile /.ssh/galera-keyHost galera-3HostName 12.127.17.124User centosIdentityFile /.ssh/galera-keyInstalling Galera Cluster with MariaDBCopyright Codership Oy 2019. All Rights Reserved.library@galeracluster.comVersion 1.0Slide 10

Node Provisioning ToolState Transfers for New NodesGalera ClusterState Snapshot Transfer (SST)Node 1Incremental State Transfers (IST)Methods for State TransfersSTATE TRANSFERNode 2JoinerNodeLogical — mysqldumpPhysical — rsyncASKS TO JOINNode 3yum -y install rsyncExecuted from Command-Line on Each Node.Documentation on Node Provisioning: de-provisioning.htmlDocumentation on State Transfers: ate-transfer.htmlInstalling Galera Cluster with MariaDBCopyright Codership Oy 2019. All Rights Reserved.library@galeracluster.comVersion 1.0Slide 11

Installing MariaDB with GaleraMariaDB Repo File Generatoryum -y install MariaDB-server MariaDB-clientsystemctl start sitories/)Install MariaDB — Galera Includedmysql secure installationExecuted from Command-LineSecure Installation (e.g., Password)Installation Documentation: stall.htmlMariaDB Repo File Generator: /Installing Galera Cluster with MariaDBCopyright Codership Oy 2019. All Rights Reserved.library@galeracluster.comVersion 1.0Slide 13

Configuring NodesInstalling Galera Cluster with MariaDBIntroductionConfiguring NodesStarting GaleraGalera Cluster OverviewOpening PortsConclusionInstalling Software

Database ConfigurationEdit MySQL Configuration File(/etc/my.cnf.d/server.cnf)bind-address — Not Local Host[mysqld]datadir /var/lib/mysqlsocket /var/lib/mysql/mysql.sockbind-address 0.0.0.0user mysqldefault storage enginebinlog formatlog-errordefault storage engine InnoDBinnodb autoinc lock mode 2innodb flush log at trx commit 0innodb buffer pool size 128Mbinlog format ROWlog-error /var/log/mysqld.logExcerpt from MySQL Configuration File.Installing Galera Cluster with MariaDBCopyright Codership Oy 2019. All Rights Reserved.library@galeracluster.comVersion 1.0Slide 16

Galera Configuration — Initializingwsrep on Enables Galerawsrep provider is Name &Path of Galera Libraries[galera]wsrep on ONwsrep provider /usr/lib64/galera-4/libgalera smm.so Excerpt from Database Configuration File.May Need to Adjust File Path[GALERA] HEADERON MARIADB ONLYDocumentation on wsrep on: sql-wsrep-options.html#wsrep-onDocumentation on wsrep provider: sql-wsrep-options.html#wsrep-providerInstalling Galera Cluster with MariaDBCopyright Codership Oy 2019. All Rights Reserved.library@galeracluster.comVersion 1.0Slide 17

Galera Configuration — Node & Clusterwsrep node nameUnique for Each Node (e.g., node1, node2)Corresponds to AWS Instanceswsrep node addressNode's IP AddressUse Internal IP Address for AWSwsrep cluster nameCluster Name — Same on All Nodes[GALERA] HEADERON MARIADB ONLY[galera].wsrep node name 'galera-1'wsrep node address "172.31.19.208"wsrep cluster name 'galera-training'wsrep cluster address Excerpt from Database Configuration File.wsrep cluster addressComma-Separated List of All Nodes — Same on All NodesDocumentation on wsrep node name: n on wsrep node address: tion on wsrep cluster name: tion on wsrep cluster address: ling Galera Cluster with MariaDBCopyright Codership Oy 2019. All Rights Reserved.library@galeracluster.comVersion 1.0Slide 18

Galera Configuration — More OptionsSet Galera Cache withwsrep provider optionsSet the Number of Threads for Galerawith wsrep slave threads[galera].wsrep provider options "gcache.size 300M;gcache.page size 300M"wsrep slave threads 4wsrep sst method rsyncExcerpt from Database Configuration File.Set wsrep sst method to eitherrsync or mysqldump for ProvisioningNew NodesDocumentation on wsrep provider options: entation on wsrep slave threads: ation on wsrep sst method: sql-wsrep-options.html#wsrep-sst-methodInstalling Galera Cluster with MariaDBCopyright Codership Oy 2019. All Rights Reserved.library@galeracluster.comVersion 1.0Slide 19

Opening PortsInstalling Galera Cluster with MariaDBIntroductionConfiguring NodesStarting GaleraGalera Cluster OverviewOpening PortsConclusionInstalling Software

Galera PortsMariaDB Default Traffic — TCP 3306Galera Cluster Communications — TCP & UDP 4567Incremental State Transfers — TCP 4444State Snapshot Transfers — TCP 4568Firewall Settings: rewall-settings.htmlInstalling Galera Cluster with MariaDBCopyright Codership Oy 2019. All Rights Reserved.library@galeracluster.comVersion 1.0Slide 21

SELinuxKernel Module for Linux Securitysetenforce 0Disables SELinuxOpen Port for MariaDBOpens Ports for GaleraOpen Ports for Galerasemanage port -a -t mysqld port t -p tcp rt-a-a-a-a-t-t-t-tmysqld port tmysqld port tmysqld port tmysqld port t-p-p-p-ptcptcpudptcp4444456745674568Open Ports on SELinuxsemanage permissive -a mysqld tSELinux Configuration: linux.htmlInstalling Galera Cluster with MariaDBCopyright Codership Oy 2019. All Rights Reserved.library@galeracluster.comVersion 1.0Slide 22

FirewallFirewall Daemon for RestrictingNetwork Traffic & Servicessystemctl enable firewalldsystemctl start firewalldEnable & Start Firewallfirewall-cmd --zone public --add-service mysql --permanentfirewall-cmd --zone public --add-port 3306/tcp --permanentOpen Port for MariaDBOpen Ports for GaleraReload ll-cmd--zone public--zone public--zone public--zone public--add-port 4444/tcp--add-port 4567/tcp--add-port 4567/udp--add-port ntfirewall-cmd --reloadConfiguring firewalld: rewalld.htmlInstalling Galera Cluster with MariaDBCopyright Codership Oy 2019. All Rights Reserved.library@galeracluster.comVersion 1.0Slide 23

Starting GaleraInstalling Galera Cluster with MariaDBIntroductionConfiguring NodesStarting GaleraGalera Cluster OverviewOpening PortsConclusionInstalling Software

Caveats of Starting a ClusterA Cluster is made of Multiple Nodes— Not Stand-AloneNew Nodes Unassuming — Look forPrimary ComponentTell First Node it’s the PrimaryComponentInstalling Galera Cluster with MariaDBCopyright Codership Oy 2019. All Rights Reserved.library@galeracluster.comVersion 1.0Slide 25

Starting NodesBootstrap Database & Galera onSeed NodeStartingMariaDB NodesMariaDB — galera new clusterSeed Nodegalera new clusterAdditional NodesStart Database & Galera Normallyon Additional NodesInstalling Galera Cluster with MariaDBCopyright Codership Oy 2019. All Rights Reserved.systemctl start mariadblibrary@galeracluster.comVersion 1.0Slide 26

Video DemonstrationInstalling Galera Cluster with MariaDBCopyright Codership Oy 2019. All Rights Reserved.library@galeracluster.comVersion 1.0

ConclusionInstalling Galera Cluster with MariaDBIntroductionConfiguring NodesStarting GaleraGalera Cluster OverviewOpening PortsConclusionInstalling Software

Additional ResourcesCodership Library (galeracluster.com/library)Documentation (/library/documentation)Knowledge Base (/library/kb)FAQ (/library/faq)Training (/library/training)Videos (/library/training/videos)Tutorials (/library/training/tutorials)Tutorial Article on Installing Galera with MariaDB: ls/galera-installing-mariadb.htmlInstalling Galera Cluster with MariaDBCopyright Codership Oy 2019. All Rights Reserved.library@galeracluster.comVersion 1.0Slide 29

Installing Galera Cluster with MariaDB Introduction Galera Cluster Overview Installin

Related Documents:

tural!Overview! !MariaDB!White!Paper! !08 26 13 001.docx!Page!3!! w:!www.mariadb.com!! e:!info@mariadb.com!

www.fromdual.com 2 / 22 About FromDual GmbH FromDual provides neutral and independent: Consulting for MySQL, Galera Cluster, MariaDB and Percona Server Support for all MySQL and Galera Cluster Remote-DBA Services for all MySQL MySQL Training Open Source Business Allian

Various forms of mysQL exist, such as oracle mysQL, mariadb, Percona server for mysQL, Galera cluster for mysQL, and Galera cluster for mariadb. oracle mysQL community edition is a freely downloadable version. commercial

MariaDB offers Galera cluster technology. MariaDB also offers many operations and commands unavailable in MySQL, and eliminates/replaces features impacting performance negatively. Getting Started Before you begin this tut

Standard Replication & Galera Cluster Introduction Purpose & Advantages Standard Replication Layout Configuring Replication Galera Basics Configuring Galera

MariaDB storage engine offerings . Cassandra: still around, requires libthrift CONNECT: for ETL operations TokuDB: requires jemalloc and transparent hugepages to be never (not always) Storage Engines InnoDB 5.7 is now included in MariaDB Server 10.2 (there is

MySQL Teamwork: Replication or Galera Cluster, joerg.bruehe@fromdual.com, 2016 April, CC-BY-SA 26 / 42 Galera Properties (2)-MySQL sources need patching (Codership offers binaries, ditto MariaDB and Percona)-Beware of hot spots (rows)-Conflict detection is late, full rollb

Bribery, fraud or other corrupt practice by University employees will be treated as a serious disciplinary offence, potentially resulting in dismissal without notice and/or legal action. In addition, there might, depending on the circumstances, be a criminal investigation by the police or other relevant authorities. 4 2.2 Reporting and Investigation Procedures 2.2.1 Corporate hospitality Where .