Getting Started Stable Diffusion with LoRA models
1. About Stable Diffusion
Orchestrator is a tool for MySQL HA and replication management.
This is a simple set up document to set up an orchestrator.
I just followed these documents at first.
At first, build a docker image. I couldn’t find which docker image in DockerHub can be used in a docker-compose.
git clone https://github.com/openark/orchestrator
cd orchestrator
docker build . -t docker/Dockerfile -t orchestrator:latest
Set up a MySQL server for Orchestrator and create a user and a database.
CREATE DATABASE IF NOT EXISTS orchestrator;
CREATE USER 'orchestrator'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON `orchestrator`.* TO 'orchestrator'@'%';
In each MySQL server of a topology, create an orchestrator user to manage by Orchestrator.
CREATE USER 'orchestrator'@'%' IDENTIFIED BY 'password';
GRANT SUPER, PROCESS, REPLICATION SLAVE, RELOAD ON *.* TO 'orchestrator'@'%';
GRANT SELECT ON mysql.slave_master_info TO 'orchestrator'@'%';
Configure MySQL settings for orchestrator MySQL server and also managed MySQL topology servers in /etc/orchestrator.conf.json
.
{
"MySQLOrchestratorHost": "orchestrator_mysql_db",
"MySQLOrchestratorPort": 3306,
"MySQLOrchestratorDatabase": "orchestrator",
"MySQLOrchestratorUser": "orchestrator",
"MySQLOrchestratorPassword": "orch_backend_password",
"MySQLTopologyUser": "orchestrator",
"MySQLTopologyPassword": "orch_topology_password"
}
Then start the Orchestrator with a few Docker containers. After starting a container, access orchestrator UI by 127.0.0.1:3000
On UI, a new DB cluster can be registered. On CLI, we can register it by next.
> docker exec -it cluster_orchestrator_1 orchestrator-client -c discover -i main:3306
main:3306
The reason for why a KV store is used and configuration for Consul can be found on the official documents
First, update a few fields in orchestrator.conf.json
.
The details of them can be seen on the above document.
...
"KVClusterMasterPrefix": "mysql/main",
"ConsulAddress": "consul-server1:8500",
"ConsulCrossDataCenterDistribution": true,
...
Note that this configuration assumes that Consul agent isn’t installed an orchestrator instance.
Also, I couldn’t figure out how to resolve DNS using consul containers so that we can use Consul DNS name like consul.service..consul
, so the traffic isn’t load balanced.
Then, after a cluster is registered on Orchestrator, KVs also are stored in Consul. It can be checked by a consul client.
> docker exec -it cluster_consul-client_1 consul kv export
[
{
"key": "mysql/main/main",
"flags": 0,
"value": "bWFpbjozMzA2"
},
{
"key": "mysql/main/main/hostname",
"flags": 0,
"value": "bWFpbg=="
},
{
"key": "mysql/main/main/ipv4",
"flags": 0,
"value": "MTkyLjE2OC4yMDguMg=="
},
{
"key": "mysql/main/main/ipv6",
"flags": 0,
"value": ""
},
{
"key": "mysql/main/main/port",
"flags": 0,
"value": "MzMwNg=="
}
]
There is an MySQL configuration about failover.
Also, all MySQL servers have to turn on log_slave_updates
option.
In order to promote a read replica on Main DB, it seems configuring GTID is required. Maybe Pseudo GTID also works, but haven’t tried. At least it doesn’t work for binary logging based replications.
In order to list up clusters
bash-5.1# orchestrator-client -c clusters
main:3306
In order to check a topology of each cluster
bash-5.1# orchestrator-client -c topology -i main:3306
main:3306 [0s,ok,5.7.36-log,rw,ROW,>>]
+ read-replica-1:3306 [0s,ok,5.7.36-log,rw,ROW,>>]
+ read-replica-2:3306 [0s,ok,5.7.36-log,rw,ROW,>>]
To register a cluster
> orchestrator-client -c discover -i main:3306
main:3306
The example of an error message.
Desginated instance read-replica-2:3306 cannot take over all of its siblings. Error: 2021-11-04 04:34:36 ERROR Relocating 1 replicas of main:3306 below read-replica-2:3306 turns to be too complex; please do it manually
By cli, the same result happened.
bash-5.1# orchestrator-client -c graceful-master-takeover -a main:3306 -d read-replica-1
Desginated instance read-replica-1:3306 cannot take over all of its siblings. Error: 2021-11-04 05:37:45 ERROR Relocating 1 replicas of main:3306 below read-replica-1:3306 turns to be too complex; please do it manually
After GTID replication on MySQL turned on, this error was gone.
I also tried to turn on log_slave_updates
on all MySQL servers by following one comment of a GitHub issue, but didn’t solve.
1. About Stable Diffusion
Basic commands
Template package
This article was written by just following Kelsey Hightower’s Kubernetes Hardway document to understand Kubernetes internal architecture.
There are a few documents to manage billing data in BigQuery Attribution of committed use discount fees and credits How to export to BigQuery Structur...
Operations
Architecture
Following videos are helpful to understand the overview of Elasticsearch more.
In this post, some variables defined in Grafana are used for Prometheus metrics, including $__rate_interval: This article describes the benefit of this va...
Follow this document mainly.
There are an awesome article about the options to use the Google Secret Manager and their pros and cons. In this article, use Secrets Store CSI Driver by fol...
To figure out which kubernetes objects are how much resource, a vertical pod autoscaler might be useful. It has a feature to either automatically update valu...
This document is written by following this document.
Basically, follow this document
There is a good video to describe a algorithms of TiDB:
TiDB data is split into multiple nodes and they’re called the name as a region.
Install go install cuelang.org/go/cmd/cue@latest
This document just follows a quick tutorial for kubebuilder and learn its behavior.
There are multiple documents about innodb locks on MySQL 5.7: InnoDB locking Locks Set by Different SQL Statements in InnoDB Using InnoDB Transaction ...
I used to use Windows 11, but for some reasons, the OS stopped working and I needed to clean-install it from Windows 10 from windows recovery environment.
See another post also to set up a TiDB on minikube.
Overview
Follow an official article for this document when the version of Kubernetes was 1.26 and set up VMs on GCP.
SSH configuration
SSH configuration
The official document: Docker image and initial configuration
There are fewer lock contentions to worry about, replication is a lot happier, production impact of outages become smaller, backups and restores run faster, ...
Getting Started Use minikube by following this document
In this article, explain how to backup MySQL database using Percona Xtrabackup. There are two binaries, innobackupex and xtrabackup. innobackupex is a wrappe...
Set up TypeScript Next.js with Material UI
Basic configuration
Orchestrator is a tool for MySQL HA and replication management.
Consul is developed by Hashicorp to provide a few features like a service discovery.
This configuration is for the version 5.7 and it’s minimum configuration in the official document.
gh-ost
I set up Ubuntu for the 1st time since several years ago.
Apache Cassandra
Getting started
jq is used to parse JSON result, format and output on the cli.
MySQL connections
This is written on March 2021.
I mostly followed this article to update a WSL version, except that I didn’t enable Hyper-V until then and got an error Please enable the Virtual Machine Pla...
There are many web sites to compare static site generator, but they miss some explanations that require to me. For some people, these features are important ...
PHPBench framework
Command list
The deployment is many use cases and in this page, they’re not described. For the details for those use cases or the concept of deployment, see official page.
Configurations
This document is written for MySQL 5.7, so these contents may be not correct for other versions.
This document is written for MySQL 5.7, so these contents may be not correct for other versions. In this page, performance_schema is mainly discussed.
Configurations
There are some cases that we wanna fetch all records that are matching with a certain condition from an other gRPC server. In these cases, there are at least...
Written in March, 2020.
Functions
The configuration to enable comments is described in the official page.
Getting Started See Official tutorial for detail steps.
Configuration The detail for gitconfig is written in official page.
Written in March 2020.
This page explains how to enable searching non-posts pages for Minimal mistakes by Lunr.js for someone who does not know jekyll at all. Lunr.js is the defaul...
This document is described based on MySQL 5.6.
Performance
MySQL Tuner tool This is a tool to review a configuration for MySQL server.
Collect recent error logs If the logs are outputted by zap, error messages are aggregated by checking level = error. This log does not work very well if the ...
The Cloud endpoint is actually the NGINX proxy which offers the following features on GCP. Authentication and validation Logging and monitoring in GCP
http package in golang supports HTTP/2 protocols. It’s automatically configured.
Basic concepts There are some basic components for terraform.
Troubleshootings
gogo/protobuf is the library to store some extensions from golang/protobuf in this repository. There are some useful packages that golang/protobuf does not p...
Target upstream services Cloud CDN can have only GCP load balancer as the upstream services. And GCP load balancer can configure one of followings for backen...
Some JavaScript library depends on Google Closure. If you need to understand the behavior of such a library, you have to know closure. The official document ...