10 Ocak 2024 Çarşamba

Google Cloud - gcloud Kurulum

Windows
GoogleCloudSDKInstaller.exe ile kuruluyor

Google Cloud - gcloud components seçeneği

components install
Örnek
Şöyle yaparız
gcloud components install gke-gcloud-auth-plugin

Google Cloud - gcloud projects seçeneği

projects undelete
Örnek
Şöyle yaparız
gcloud projects undelete example-foo-bar-1
projects list
Projeleri listeler
Örnek
Şöyle yaparız
gcloud projects list
Proje seçmek veya değiştirmek için şöyle yaparız
gcloud config set project <project_id>

Google Cloud - gcloud auth seçeneği

Giriş
"gcloud auth" komutunun açıklaması şöyle
manage oauth2 credentials for the Google Cloud CLI
auth activate-service-account seçeneği
activate-service-account yazısına taşıdım

auth configure docker seçeneği
Örnek
Şöyle yaparız
stage("Docker Image") {
  withEnv(['http_proxy=', 'https_proxy=']) {
    sh "gcloud auth activate-service-account --key-file=.gcp/product-foo.json"
sh "gcloud auth configure-docker" // Build image and upload to GCP sh "docker build -t us.gcr.io/product-foo/oracle-db docker/uc-custdb/oracle-db"
sh "docker push us.gcr.io/product-foo/oracle-db:latest"
// Build image and upload to GCP int basetime = currentBuild.startTimeInMillis / 1000 sh "docker build -t us.gcr.io/product-foo/uc-farm docker/uc-farm"
sh "docker tag us.gcr.io/product-foo/uc-farm:latest us.gcr.io/product-foo/uc-farm:$basetime"
sh "docker push us.gcr.io/product-foo/uc-farm:$basetime"
sh "docker push us.gcr.io/product-foo/uc-farm:latest"
} }
auth list seçeneği
Hesap ismlerini gösterir. Etkin olunan hesap ismi yanında * karakteri vardır
Örnek
Şöyle yaparız
gcloud auth list
      Credentialed Accounts
ACTIVE  ACCOUNT
*       myname.mylastname@foo.com

To set the active account, run:
    $ gcloud config set account `ACCOUNT`
auth login seçeneği
Yeni bir hesap ile login olmak içindir
Örnek
Şöyle yaparız
gcloud auth login myaccount@gmail.com
Örnek
Şöyle yaparız
gcloud init
gcloud auth application-default login

2 Ocak 2024 Salı

AWS Redshift - OLAP Datawarehouse İçindir

Giriş
Açıklaması şöyle. Yani AWS Aurora'dan daha gelişmiş.
Like Amazon Aurora, Amazon Redshift is used by large enterprises. However, Redshift is more complex, can handle more data, and is referred to as a data warehouse. This is because Redshift is built for OLAP (Online Analytical Processing).

Furthermore, Redshift can scale up to Petabytes of data and supports up to 60 user-defined databases per cluster. On the other hand, Aurora can only scale to terabytes and support up to 40. Besides this, the security and the maintenance of both the database services are pretty much the same.

A few use cases of Amazon Redshift are creating machine models for forecasting operations, optimizing your company's business intelligence, and increasing developer productivity.
Benefits
  1. Redshift possesses the highest scaling capabilities amongst the three options we've examined.
  2. Its performance is much faster and more durable.
  3. Amazon Redshift can also handle a more significant amount of data and analyze it within a shorter period.
Redshift vs PostgreSQL
Açıklaması şöyle. Altta PostgreSQL 8 kullanıyor.
I mean, as much as I love AWS services, setting up Redshift as our data warehouse was a mistake and Postgres would have been a much better alternative.

Let’s be honest, unless you have massive amounts of data, more than hundreds of To’s of data, all these fancy data warehouses like Redshift just aren’t worth the cost. Redshift isn’t open source, so you can’t have a complete mini-data stack on your local computer for testing purposes. Plus, Redshift, being built on top of Postgres 8, sometimes lacks the cool features that the newer releases of Postgres have.

I know Postgres is a transactional database, but I think it’s a solid first approach for a data warehouse. If you’re dealing with tables with less than 50 million rows and under 10 terabytes of data (which is the case for most startups), Postgres might outperform Redshift. And the best part is, you can have it up and running on your local computer, making it incredibly convenient for quick iterations.

Örnek
Açıklaması şöyle
Redshift supports some SQL functions and queries which would generally only be necessary with large data warehouse applications. For example, PERCENTILE_CONT computes a linear interpolation to return a percentile.
Şöyle yaparız
SELECT
    TOP 10 salesid,
    sum(pricepaid),
    percentile_cont(0.6) WITHIN GROUP (
        ORDER BY 
            salesid
    ),
    median (salesid)
FROM
    sales
GROUP BY
    salesid,
    pricepaid;

19 Aralık 2023 Salı

gcloud container clusters delete seçeneği - Cluster Siler

Giriş
gcloud container clusters create ile yaratılan cluster silinir

Örnek
Şöyle yaparız
gcloud container clusters delete <my-cluster>


gcloud container clusters get-credentials seçeneği - Kubeconfig Entry yaratır

Giriş
Bu komutu çalıştırdıktan sonra yeni bir Kubeconfig yaratılır. Context listesini görmek için şöyle yaparız
kubectl config get-contexts
CURRENT   NAME                                        CLUSTER                                     AUTHINFO                                    NAMESPACE
          docker-desktop                              docker-desktop                              docker-desktop
*         gke_hazelcast-33_us-central1-c_orcun-test   gke_hazelcast-33_us-central1-c_orcun-test   gke_hazelcast-33_us-central1-c_orcun-test
Context değiştirmek için şöyle yaparız
kubectl config use-context my-context-name
Örnek
Şöyle yaparız
gcloud container clusters get-credentials <my-cluster>
-project seçeneği
Örnek
Şöyle yaparız
gcloud container clusters get-credentials orcun-test 
--zone us-central1-c 
--project hazelcast-33
--zone seçeneği
Örnek
cluster'a login olmak için şöyle yaparız
gcloud container clusters get-credentials mycluster --zone us-central1-a