Openshift combine 3 gears into 1 gear in free plan - openshift

i have opensfhit account and i am setting up my application which required more space than 1GB. as stated in this link , each gear has 1GB memory space.
and maximum of 3 gears allowed. is it possible to combine 3 Gears into 1 Gear which can have 3GB of space. currently i am in free plan, and having 1 gear with 1GB space, which has two cartridges Jboss and Postgresql database. Both combined is taking more than 1GB. so i cant deploy the application due to space constraint.. any direction would really help me.
Edit :-
I have created the scaled application in free plan, and as per openshift document, each gear can max hold 1GB space, and in my case , 2 Jboss (scaled) , load balancer, 1 psql database, so one gear will have(Jboss + load balancer) combined 1GB, 2nd gear postgresql 1GB space, and 3rd gear Jboss 1GB (scaleable).
Note :- in above case, minimal allowable gears to scale will be 2 and not 3, since one gear already allocated to database. But maximum allowed gears are 3 for scalling, and i don't know how it works.
From openshift admin panel -
JBoss Application Server 7 using 2
OpenShift is configured to scale this cartridge with the web proxy
HAProxy. OpenShift monitors the incoming web traffic to your
application and automatically adds or removes copies of your cartridge
(each running on their own gears) to serve requests as needed.
Control the number of gears OpenShift will use for your cartridge:
Minimum 2 (dropdown) and Maximum 3 (dropdown) small gears
Each scaled gear is created the same way - the normal post, pre, and
deploy hooks are executed. Each cartridge will have its own copy of
runtime data, so be sure to use a database if you need to share data
across your web cartridges.

If you deploy as a scaled application then the database would reside on a separate gear from your JBoss application, so the database would have 1GB of disk space all to itself. So you would basically have 1GB for your DB, and 1GB for JBoss. If that isn't enough then you would have to upgrade to a paid plan in order to have more disk space available on an individual gear.

I ran into the same issue and found that this was not well documented or at least not intuitively described, since 3*1GB initially seems to imply that you might just have 3GB total disk space, which is not quite the case.
Here is a quote from the documentation on scalable applications (if it is not scalable you only have 1 Gear anyways):
The HAProxy cartridge sits between your application and the public internet and routes web traffic to your web cartridges. When traffic increases, HAProxy notifies the OpenShift servers that it needs additional capacity. OpenShift checks that you have a free gear (out of your remaining account gears) and then creates another copy of your web cartridge on that new gear. The code in the git repository is copied to each new gear, but the data directory begins empty. When the new cartridge copy starts it will invoke your build hooks and then the HAProxy will begin routing web requests to it. If you push a code change to your web application all of the running gears will get that update.
Source: https://developers.openshift.com/en/managing-scaling.html (in section "How Scaling Works"
To summarise: GIT data is copied across all gears, so you have 3 times 1GB of the identical GIT data. #mbaird pointed out that this is not true for user data, which is not replicated. Also, depending on your cartridge, in a scaled application your database might be on a separate gear.
For static content hosting it seems like that if you need more disk space or INodes you have to change to a different plan or spread your data across multiple applications.

Related

I want to deploy my rails app with Mysql as database. I want to go with free heroku server. what are the limitations of this free server?

i have a small rails Application with Mysql database.i want to deploy this application to heroku. but i am not getting the limitations of it. like what is the maximum database size and maximum application size. i know only the ram limitation is upto 512 mb. how many instances it will provides and what is the bandwidth of it etc,like this i want to know all limitations of this free hosting on heroku.
Check the following link it breaks the heroku plans down for you.
The free plan which is Hobby Tier for example
has an enforced row limits of 10,000 rows in your database for hobby-dev
No in-memory cache
No fork/follow support: Fork and follow, used to create replica
databases and master-slave setups, are not supported
Expected uptime of 99.5% each month.

Google Compute Instance 100% CPU Utilisation

I am running n1-standard-1 (1 vCPU, 3.75 GB memory) Compute Instance , In my android app around 80 users are online write now and cpu Utilisation of instance is 99% and my app became less responsive. Kindly suggest me the workaround and If i need to upgrade , can I do that with same instance or new instance needs to be created.
Since your app is running already and users are connecting to it, you don't want to do the following process:
shut down the VM instance, keeping the boot disk and other disks
boot a more powerful instance, using the boot disk from step (1)
attach and mount any additional disks, if applicable
Instead, you might want to do the following:
create an additional VM instance with similar software/configuration
create a load balancer and add both the original and new VM to it as a backend
change your DNS name to point to the load balancer IP instead of the original VM instance
Now, your users will be randomly sent to a VM that's least-loaded to see the application, and you can add more VMs if your traffic increases.
You did not describe your application in detail, so it's unclear if each VM has local state (e.g., runs a database) or there's a database running externally. You will still need to figure out how to manage the stateful systems such as database or user-uploaded data from all the VM instances, which is hard to advise on given the little information in your quest.

Can I install MySQL on the VMs provided in Azure Cloud Services?

From what I gather, the only way to use a MySQL database with Azure websites is to use Cleardb but can I install MySQL on VMs provided in Azure Cloud Services. And if so how?
This question might get closed and moved to ServerFault (where it really belongs). That said: ClearDB provides MySQL-as-a-Service in Azure. It has nothing to do with what you can install in your own Virtual Machines. You can absolutely do a VM-based MySQL install (or any other database engine that you can install on Linux or Windows). In fact, the Azure portal even has a tutorial for a MySQL installation on OpenSUSE.
If you're referring to installing in web/worker roles: This simply isn't a good fit for database engines, due to:
the need to completely script/automate the install with zero interaction (which might take a long time). This includes all necessary software being downloaded/installed to the vm images every time a new instance is spun up.
the likely inability for a database cluster to cope with arbitrary scale-out (the typical use case for web/worker roles). Database clusters may or may not work well when a scale-out occurs (adding an additional vm). Same thing when scaling in (removing a vm).
less-optimal attached-storage configuration
inability to use Linux VMs
So, assuming you're still ok with Virtual Machines (vs stateless Cloud Service vm's): You'll need to carefully plan your deployment, with decisions such as:
Distro (Ubuntu, CentOS, etc). Azure-supported Linux distro list here
Selecting proper VM size (the DS series provide SSD attached disk support; the G series scale to 448GB RAM)
Azure Storage attached disks being non-Premium or Premium (premium disks are SSD-backed, durable disks scaling to 1TB/5000 IOPS per disk, up to 32 disks per VM depending on VM size)
Virtual network configuration (for multi-node cluster)
Accessibility of database cluster (whether your app is in the vnet or accesses it through a public endpoint; and if the latter, setting up ACL's)
Backup / HA / DR planning
Someone else mentioned using a pre-built VM image from VM Depot. Just realize that, if you go that route, you're relying on someone else to configure the database engine install for you. This may or may not be optimal for what you're trying to achieve. And the images may or may not be up-to-date with the latest versions, patches, etc.
Of course, what I wrote applies to any database engine you install in your own virtual machines, where a service provider (such as ClearDB) tends to take care of most of these things for you.
If you are talking about standard VMs then you can use a pre-built images on VMDepot for that.
If you are talking about web or worker roles (PaaS) I wouldn't recommend it, but if you really want to you could. You would need to fully script the install of the solution on the host. The only downside (and it's a big one) you would have would be the that the host will be moved to a new host at some point which would mean your MySQL data files would be lost - if you backed up frequently and were happy to lose some data then this option may work for you.
I think, that the main question is "what You want to achieve?". As I see, You want to use PaaS solution with Web Apps or Cloud Service and You need a MySQL database. If Yes, You have two options (both technically as David Makogon said). First one is to deploy Your own (one) server with MySQL and connect to it from the outside (internet side). Second solution is to create one MySQL server or cluster and connect Your application internally in Azure virtual network. WIth Cloud Service it is simple but with Web App it is not. You must create VPN gateway in Azure VM and connect Your Web App to this gateway. In this way You will have internal connection wfrom Your application to Your own MySQL cluster.

Cloning error Openshift Tomcat Mysql App

I am using Openshift and installed Tomcat 7 (JBoss EWS 2.0) and Mysql 5.5, Jenkins and PHPMyadmin. i am using free version which is basically small gears. Actually i am facing difficulty in uploading my war file every now and then. then i have to clean up the space only then it will allow me to deploy the war file.
My question is that is it the case of small gears or something else. Going for a paid plan can solve my plan or not.
Between, my application is small (30MB War) plus small DB.
Please respond
The free account gives you three gears each with 1GB of disk space. Your application gear is hosting Tomcat, MySQL, and PHPMyAdmin cartridges so they will consume the disk space. Also, if you are storing multiple deployments than they all will consume space. Can you check the disk quota of your application? SSH into the application gear and run quota -s command. The paid plan offering will solve this problem because you can get more storage upto 6GB per gear. You can run rhc tidy command to clean out your gear as well.

Development Environment for Testing MySQL Replication

Is there an easy way to setup an environment on one machine (or a VM) with MySQL replication? I would like to put together a proof of concept of MySQL replication with one Master write instance and two slave instances for reads.
I can see doing it across 2 or 3 VMs running on my computer, but that would really bog down my system. I'd rather have everything running on the same VM. What's the best way to proof out scalability solutions like this in a local dev environment?
Thanks for your help,
Dave
I think to truly test MySQL Replication it is important to do so in realistic constraints.
If you put all the replicate nodes under one operating system then you no longer have the bandwidth constraint, the data transfer speed would be much higher that what you would get if those replicate DBs are on different sites.
Everything under one VM is a shortcut to configurations, for instance it does not make you go through the configuration of the networking.
I suggest you use multiple VMs, even if you have to put them under one physical machine, you can always configure the hypervisor to make the packets go through a router, in which case the I/O will be bound by whatever the network interface has as throughput.
I can see doing it across 2 or 3 VMs
running on my computer, but that would
really bog down my system.
You can try and make a few VMs with JeOS (Just Enough OS) versions of the operating system you want. I know Ubuntu has one and it can boot on 128 RAM, which makes it convenient to deploy lots of cloned VMs under one physical machine without monster RAM.
Next step would be doing the same thing on a cloud (Infrastructure as a Service, IaaS) provider, and try your setup on different geographical sites.
If what you're testing is machine-to-machine replication, then setting up multiple VMs on a virtual private network would be the correct environment to test it. If you use Ubuntu Server, you don't have to install more than you actually need -- just give the VMs enough space for a base install + MySQL + your data. Memory usage can be as little as 256MB per VM. All you have to do is suspend or shutdown the VMs when you're not running a full-up test.
I've had situations where I was running 4 or more VMs simultaneously on my workstation, either for development or testing purposes -- it's not that taxing unless you're trying to do video rendering in each VM.