Sunday, May 24, 2020

Mounting azure file share on your linux/unix machine

So once you create file share in azure, and need to access from linux server how to do that?

In azure portal , click on the file share and you will get an option named - Connect

Go to linux VM , you will see a script that needs to be run on azure linux vm to mount the fileshare.  

In my case i ran the script on my azure vm and file share got mounted without any issues.



Filesystem syntax will be in the form of :

//yourstorageaccount.file.core.windows.net/filesharename




Saturday, May 16, 2020

Azure Storage - Containers,blobs,file shares

Microsoft Azure Cloud can store data in a storage account, once a storage account is created we get different options to store data:

1. Containers for blob storage - Blob storage is designed for storing unstructured data , designed mainly for images, or documents directly from browser , video, audio,storing data for backups and recovery etc..

To create blobs, click on container and you will can add new container to hold blob data along with access level




Friday, May 15, 2020

aws s3 command to list and copy files from and to AWS s3 Bucket

AWS S3 command is used to copy data from AWS bucket to a location - say a mountpoint on unix 

box or vice-versa or buckets

This command is similar to Unix cp command. I used aws s3 ls and aws s3 cp to copy files from S3 bucket sometime back.

buckets to a mount point in the server. 

Below are some examples and syntax for the same:

1. List directories and files :

 aws s3 ls s3://path/file 

ls command with list objects and common prefixes under a specified bucket and prefix.

2. List content in a directory:

aws s3 ls s3://path/directory --recursive 

with above command all contents in directory are listed.

3. Copy files from S3 bucket to a mount point :

aws s3 cp://file path /tmp

in above command aws s3 copy command copies a file from S3 bucket to a local mountpoint /tmp

4. Copy files from mount point to s3 bucket:

aws s3 cp /tmp/file1.txt s3://path/fil1,txt

5. Delete files in bucket :

aws s3 rm s3://path/file1.txt


6. Display file with file size in human readable format:

aws s3 ls  s3://path --recursive --human-readable --summarize




Thursday, May 14, 2020

Mariabackup for taking backup of mariadb databases

Today i have taken backup using mariabackup, with this utility you can take online full and incremental backups.
Below are the steps to be followed:

1. Create user as for backup:

MariaDB [(none)] > Create user 'mariabackup'@'localhost' identified by 'password';

MariaDB [(none)] > Grant reload,process,lock tables, replication client on *.* to 'mariabackup'@'localhost';

2. Install Maria backup:

#yum install MariaDB-backup

you will observe packages being installed and at the end will get message Complete !

3. Create a directory for backups, in my case i created /backup

4. take backups :

   #mariabackup --backup --target-dir=/backup --user=mariabackup --password=password

Backup will start and at the end you will get a message completed OK !

now we can go to the directory and check files created, you will see multiple files along with DB files that have backup related info -

backup-my.cnf,  xtrabackup_info, xtrabackup_checkpoints 


Wednesday, May 6, 2020

Mariadb Installation on Centos7

I recently installed Mariadb10.0 on Centos , this was on Azure. To start with i have created a VM on AZURE with centos and post Completion installed Mariadb.

Installing mariadb is fairly simple and below are the steps to be followed..:

1. Enable Mariadb Repository , create a file /etc/yum.repos.d/MariaDB.repo and add:
      name = MariaDB
    baseurl = http://yum.mariadb.org/10.4/centos7-amd64
    gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
    gpgcheck=1

2. Next step is to install MariaDB server and Client packages , use yum:

     # yum install Mariadb-Server MariaDB-Client 

    this will download the required packages and complete the installation. Galera packages are also installed as it comes bundled in this version.

3. Start Mariadb :

    # Systemctl start Mariadb
    # Systemctl status Mariadb

At this point Mariadb should be up and running. Configuration file can be found in /etc/mariadb.d/server.cnf and default directory 
is in /var/lib/mysql.

With Mariadb 10.4 you can login to database without root password:

  #mysql -uroot

  Mariadb> 



Saturday, April 25, 2020

Docker Commands

I worked on docker and am sharing basic docker commands for reference:

1. To check running containers : This command lists running docker container

$ docker ps

CONTAINER ID        IMAGE               COMMAND                  CREATED              STATUS              PORTS                  NAMES
df3589d324rg        ubuntu           "docker-entrypoint.s…"   About a minute ago   Up About a minute   80    ubuntu
2e0eabc266d9        postgres            "docker-entrypoint.s…"   5 minutes ago        Up 5 minutes        5432/tcp               db

2. To stop running containers: This command stops running container, i have taken first 4 characters of the first container from above commands

$ docker stop ContainerID

$ docker stop df35

3. To remove a container : After stopping the container, remove with the below commands

$ docker rm df35


4. Lists all the network

$docker network ls

NETWORK ID          NAME                DRIVER              SCOPE
eaa996cb5b14        bridge              bridge              local
f46cc1338e5a        host                host                local
9e826c05fcfd        none                null                local