Archive for 2017

A Clone of the STRING_SPLIT MSSQL 2016 Function

I have recently been developing some stuff using MSSQL 2016 and used the STRING_SPLIT function. This doesn’t exist in earlier versions and I discovered I would be required to deploy to 2008 or 2012. So here’s a my own version of the STRING_SPLIT function I have developed and tested on MSSQL 2008 (may also work […]

A simple MariaDB deployment with Ansible

Here’s a simple Ansible Playbook to create a basic MariaDB deployment. The basic steps the playbook will attempt are: Install a few libraries Setup Repos Install MariaDB packages Install Percona software Create MariaDB directories Copy my.cnf to server (note this is a template file and not supplied here) Run mysql_install_db if needed Start MariaDB Set […]

A dockerized mongod instance with authentication enabled

Here’s just a quick walkthrough showing how to create a dockerized instance of a standalone MongoDB instance. First, from within a terminal, create a folder to hold the Dockerfile… ?View Code BASHmkdir Docker_MongoDB_Image cd Docker_MongoDB_Image touch Dockerfile Edit the Dockerfile… ?View Code BASHvi Dockerfile Enter the following text. You may wish to modify the file […]

Check MariaDB replication status inside Ansible

I needed a method to check replication status inside Ansible. The method I came up with uses the shell module… ?View Code YAML— – hosts: mariadb vars_prompt: – name: "mariadb_user" prompt: "Enter MariaDB user" – name: "mariadb_password" prompt: "Enter MariaDB user password"   tasks: – name: "Check MariaDB replication state" shell: "test 2 -eq $(mysql […]

my: a command-line tool for MariaDB Clusters

I’ve posted the code for my MariaDB Cluster command-line tool called my. It does a bunch of stuff but the main purpose is to allow you to easily monitor replication cluster-wide while working in the shell. Here’s an example of this screen… hostname port cons u_cons role repl_detail lag gtid read_only master1 3306 7 0 ms […]