10

YugabyteDB on OCI Free Tier - DEV Community

 3 years ago
source link: https://dev.to/yugabyte/yugabytedb-on-oci-free-tier-52cm
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

YugabyteDB on OCI Free Tier

Jul 21

・3 min read

I have many friends with an always free tier VM on the Oracle Cloud. 1/8th of Intel Core, 1GB RAM... that's not a lot but sufficient to get a try at YugabyteDB. Having a VM always up is very handy. I use one of them to validate my blog posts and even let the credentials public if someone wants to try.

So here it is, you probably know how to create a free-tier VM. I create one from the Oracle Linux Cloud Developer (a OL8 with GCC toolset 10, go, python, GraalVM,...). The only additional thing I do is open the ports 5433, 7000, 9000, 13000 to connect to the database and to access the master and tserver metrics.

free-tier VM

Once created (few minutes) you can ssh to it with the key for which you uploaded the the public key:

ssh -i ~/.ssh/id_rsa [email protected]
Enter fullscreen modeExit fullscreen mode

Because I'm lazy, I retrieve the last version number from the latest releases web page:

ver=$(curl -s https://docs.yugabyte.com/latest/releases/whats-new/latest-release/ | awk -F"-" '/https:[/][/]downloads.yugabyte.com[/]yugabyte-.*linux.tar.gz/{sub(/-linux.tar.gz.*/,"");print $NF;exit}' | tee /dev/stderr )
Enter fullscreen modeExit fullscreen mode

I use this $ver environment variable to get the software and untar it, and go to the directory:

curl https://downloads.yugabyte.com/yugabyte-${ver}-linux.tar.gz | tar zxf -
cd yugabyte-$ver
Enter fullscreen modeExit fullscreen mode

Run the setup:

bin/post_install.sh
Enter fullscreen modeExit fullscreen mode

Now as root I increase the limits:

sudo echo '* - nofile 1048576' | sudo tee /etc/security/limits.d/99-yugabyte.conf
Enter fullscreen modeExit fullscreen mode

And still as root I open the ports:

sudo firewall-cmd --zone=public --permanent --add-port=5433/tcp
sudo firewall-cmd --zone=public --permanent --add-port=7000/tcp
sudo firewall-cmd --zone=public --permanent --add-port=9000/tcp
sudo firewall-cmd --zone=public --permanent --add-port=13000/tcp
sudo firewall-cmd --reload
Enter fullscreen modeExit fullscreen mode

That's all for the install. I can start the node:

bin/yugabyted start --listen 0.0.0.0
Enter fullscreen modeExit fullscreen mode

I listen on all interfaces enable password authentication. This takes a few seconds and the database is ready, listening on port 5433 for any PostgreSQL compatible client. The displayed address is localhost but as I listen on 0.0.0.0 you can connect from the internet.

I can also connect locally, like here to change the default password and create a user for myself:

bin/yugabyted connect ysql <<< "alter role yugabyte with password 'yb-oci-franck'; create user franck with password 'YugabyteDB';"
Enter fullscreen modeExit fullscreen mode

Note that for the moment there's no authentication. We will restart the server with --ysql_enable_auth=true later

There is also a command to create the Northwind demo schema:

bin/yugabyted demo connect <<< "grant all privileges on all tables in schema public to franck;"
Enter fullscreen modeExit fullscreen mode

This creates the demo schema the first time (a few minutes on this free instance with limited CPU) and connects, and this is where I grant all privileges to my user.

I restart now enabling authentication:

bin/yugabyted stop
bin/yugabyted start --tserver_flags="ysql_enable_auth=true"
Enter fullscreen modeExit fullscreen mode

Let's show the connection string:

echo "psql postgres://franck:YugabyteDB@$(curl -s ifconfig.me):5433/yb_demo_northwind"
Enter fullscreen modeExit fullscreen mode

You can connect from internet with this psql command. Or DBeaver providing this host, port and credentials. Or actually anything where you can choose the PostgreSQL driver. Please give me some feedback, here in comments, or on Twitter. And of course our yugabyte-db Slack where we can answer your questions. And I forgot the most important: when you start the server you may find a link to get your T-Shirt 👕

Want to run a K8s cluster? Stay tuned on https://blog.yugabyte.com/ I'll explain how to install YugabyteDB on OKE. Want a larger free VM? Again, follow to see how to install on the free 4 vCPU Ampere...


Recommend

  • 10
    • jarneil.wordpress.com 4 years ago
    • Cache

    OCI 1st Year Ramp-Up Savings

    OCI 1st Year Ramp-Up Savings In this simple example of the benefit of an Annual Universal Credit, imagine a customer who is looking to build infrastructure that has a total cost of 40,000 a month, it doesn’t matter the curre...

  • 17
    • jarneil.wordpress.com 4 years ago
    • Cache

    OCI Bare Metal Pricing

    OCI Bare Metal Pricing In the same vein as the VM shapes, the available OCI Bare Metal shapes that you can use are hardly a secret and are easily obtainable from the Oracle

  • 13
    • jarneil.wordpress.com 4 years ago
    • Cache

    OCI VM Shape Pricing

    OCI VM Shape Pricing While the available OCI VM shapes that you can use is hardly a secret and is easily obtainable from the oracle cloud website I find it frus...

  • 13
    • jarneil.wordpress.com 4 years ago
    • Cache

    OCI Annual Universal Credit

    OCI Annual Universal Credit This is potentially delving too deep into the contracting weeds than most folks of a technical nature would wish. But as I’ve indicated in the

  • 10
    • jarneil.wordpress.com 4 years ago
    • Cache

    OCI Discount Levels

    OCI Discount Levels One of the biggest drivers in any cloud migration are the economics. Customers are continually pushing to save on IT spending and any cloud migration that I’ve come across has to show a reduction in spend as compa...

  • 8

    OCI Image Format Specification The OCI Image Format project creates and maintains the software shipping container image format spec (OCI Image Format).

  • 11

    Signing OCI Images with Cosign! 9 minute read Cosign is a fairly new (v1 release 28 July 2021) project which is a part of the sigstore project to ease signing, storing and verifying s...

  • 2
    • www.thorsten-hans.com 3 years ago
    • Cache

    Distribute WebAssembly modules as OCI artifacts

    Distribute WebAssembly modules as OCI artifacts Read how to leverage Azure Container Registry (ACR), to distribute WebAssembly (Wasm) modules as OCI artifacts. Published Tue, Nov 2, 2021 | by...

  • 2
    • my.oschina.net 3 years ago
    • Cache

    OCI 与容器镜像构建

    大家好,我是张晋涛。 这篇文章中我将介绍 OCI 及容器镜像相关的内容,欢迎留言讨论。 OCI 的前世今生 2013 年 3 月 dotCloud 公司在 PyCon 上进行了 Docker 的首次展示,随后宣布开源。自此 Docker 开始被众...

  • 9

    Dear free tier users of the SAP BTP ABAP Environment,Please be advised of an important upcoming change affecting the free tier option for SAP BTP ABAP Environment.SummaryChange effective April...

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK