Comments (5)
The App Autoscaler meanwhile has gained MySQL support.
from app-autoscaler.
We have created an issue in Pivotal Tracker to manage this:
https://www.pivotaltracker.com/story/show/140075095
The labels on this github issue will be updated when the story is started.
from app-autoscaler.
Is there anyone working on this? I am interested in contributing to support for MySQL.
from app-autoscaler.
Please go ahead with it... we don't have efforts on it right now...
from app-autoscaler.
Design Notes - Support for MySQL
I have successfully deployed app-autoscaler with MySQL.
I'd like to share how I did it before I create a pull request.
Why Support for MySQL?
If you are running Cloud Foundry with mysql, you do not need to deploy and manage a postgres database.
[Pseudo Codes] App AutoScaler
Install Go MySQL Driver
source .envrc
go get github.com/go-sql-driver/mysql
Import Go MySQL Driver
[Postgres] _ "github.com/lib/pq"
[MySQL] _ "github.com/go-sql-driver/mysql"
Add Liquibase MySQL Dependency
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.36</version>
</dependency>
Change DB Propertities
autoscaler/db/db.go
[Postgres] const PostgresDriverName = "postgres"
[MySQL] const DatasourceDriverName = "mysql"
DB Tables - Modify Value & Varchar Column Length
[Postgres] value: json
[MySQL] value: text
[Postgres] type: varchar
[MySQL] type: varchar(255)
DDL
[Postgres] INSERT INTO table(col1, col2, col3, col4, col5) values($1, $2, $3, $4, $5)
[MySQL] INSERT INTO table(col1, col2, col3, col4, col5) values(?, ?, ?, ?, ?)
[Pseudo Codes] App AutoScaler Release
Install Node MySQL Package - API Server & Service Broker (pre_packaging)
npm install mysql
Modify property-overrides.yml
---
default_db:
databases:
- {name: autoscaler, tag: default}
db_scheme: mysql
port: 3306
roles:
- {name: root, password: password, tag: default}
Modify bosh-lite-manifest-template-v1.yml
- name: cf-mysql
url: https://bosh.io/d/github.com/cloudfoundry/cf-mysql-release?v=32
version: '32'
sha1: a41bb2cadd4311bc9977ccc2c1fca07ba41ccef2
jobs:
- name: mysql
instances: (( instance_count_overrides.mysql.instances || 1 ))
update:
serial: true
resource_pool: default
networks:
- name: default
templates:
- name: consul_agent
release: cf
consumes: {consul_client: nil, consul_server: nil, consul_common: nil}
- name: mysql
release: cf-mysql
properties:
cf_mysql:
mysql:
admin_password: password
port: 3306
binlog_enabled: false
cluster_health:
password: password
galera_healthcheck:
db_password: password
endpoint_username: galera_healthcheck
endpoint_password: password
seeded_databases:
- name: autoscaler
username: root
password: password
consul:
agent:
mode: client
services:
mysql:
check:
tcp: 127.0.0.1:3306
interval: 30s
timeout: 10s
Modify Packages & Jobs
packages/{component}/spec
- app-autoscaler/src/github.com/go-sql-driver/mysql/*.go
jobs/{component}/templates/pre-start.erb
[Postgres] java -cp "/var/vcap/packages/db/target/lib/*" liquibase.integration.commandline.Main --url jdbc:postgresql://$HOST:$PORT/$DBNAME --username=$USER --password=$PASSWORD \
--driver=org.postgresql.Driver --changeLogFile=/var/vcap/packages/eventgenerator/dataaggregator.db.changelog.yml update
[MySQL] java -cp "/var/vcap/packages/db/target/lib/*" liquibase.integration.commandline.Main --url jdbc:mysql://$HOST:$PORT/$DBNAME --username=$USER --password=$PASSWORD \
--driver=com.mysql.jdbc.Driver --changeLogFile=/var/vcap/packages/eventgenerator/dataaggregator.db.changelog.yml update
jobs/{component}/spec (IP address on which the db server will listen)
[Postgres] postgres.service.cf.internal
[MySQL] mysql.service.cf.internal
jobs/{component}/templates/{component}.yml.erb
[Postgres] db_url = db_scheme://db_role['name']:db_role['password']@db_address:db_port.to_s/db_database['name']?sslmode=disable
[MySQL] db_url = db_role['name'] :db_role['password']@tcp(db_address:db_port.to_s)/db_database['name']
from app-autoscaler.
Related Issues (20)
- Liquibase leaves dangling lock on startup HOT 4
- Support for sending health metrics over Loggregator HOT 1
- [threat-modle] CEW352: CSRF test for GUI HOT 2
- unit test failing with golang 1.7 HOT 5
- handling for "start-time" and "end-time" is wrong with golang apiserver HOT 2
- There is a CSS injection vulnerability in the dependency springfox referenced by scheduler HOT 2
- Schedules can not be removed in synchronization when an application is deleted directly HOT 2
- metricsgateway ut panics because of testhelpers/websocket_handler HOT 2
- As an enduser, I expect the throughput not to be zero if its upper than 0 rps and less than 1 rps HOT 2
- I want to scale my app more rapidly when there is a request explosion HOT 2
- As for scaling based on load, we need Auto Scalar with step up scaling and step scale down HOT 4
- When autoscaler scales down(in) an app, does it happen gracefully? What happens to the inflight requests? HOT 2
- Value of custom metric not being consumed properly HOT 7
- Not an issue but another CPU query HOT 3
- attach-autoscaling-policy command fails HOT 6
- To configure rules at application instance level
- Consulting query on DB connections on scaling. HOT 3
- Feature Request: Being able to autoscale an app by monitoring other app's metrics HOT 2
- Getting an error during the deployment HOT 2
- App is scaling up and not scaling down due to memory not reducing for my app HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from app-autoscaler.