Skip to content

Instantly share code, notes, and snippets.

Avatar

Ted Wennmark wwwted

  • Oracle/MySQL
  • Uppsala Sweden
View GitHub Profile
@wwwted
wwwted / Zeppelin_MySQL
Last active March 10, 2022 11:18
MySQL and Apache Zeppelin testing
View Zeppelin_MySQL
Docs:
- https://zeppelin.apache.org/docs/0.10.1/quickstart/install.html
- https://www.apache.org/dyn/closer.cgi/zeppelin/zeppelin-0.10.1/zeppelin-0.10.1-bin-all.tgz
1) INSTALL Zeppelin
~~~~~~~~~~~~~~~~~~~
mkir /home/ted/demos/APACHE/Zeppelin
cd /home/ted/demos/APACHE/Zeppelin
wget https://dlcdn.apache.org/zeppelin/zeppelin-0.10.1/zeppelin-0.10.1-bin-all.tgz
tar xzf zeppelin-0.10.1-bin-all.tgz
@wwwted
wwwted / partitioning.sql
Last active March 9, 2022 18:11
MySQL Partitioning automation
View partitioning.sql
--
-- I tested at /home/ted/sandboxes/MySQL-HOWTOs
-- Start MySQL (/home/ted/sandboxes/MySQL-HOWTOs/scripts/start.sh) and bring up client: mysql -uroot -proot -h127.0.0.1 -P3306
-- Run script: source /home/ted/labb/partitioning/partitioning.sql
-- Also tested in OCI, host 130.61.35.76
--
-- Remember to set group_concat_max_len to a high enough value.
-- I recommend setting it to at least 50000.
--
@wwwted
wwwted / mysql_yum_install.txt
Created March 1, 2022 12:33
Install MySQL YUM repo on OL7 and OL8
View mysql_yum_install.txt
Docs: https://dev.mysql.com/downloads/repo/yum/
RPM packages:
OL8: https://dev.mysql.com/get/mysql80-community-release-el8-3.noarch.rpm
OL7: https://dev.mysql.com/get/mysql80-community-release-el7-5.noarch.rpm
OL8
wget https://dev.mysql.com/get/mysql80-community-release-el8-3.noarch.rpm
sudo yum install mysql80-community-release-el8-3.noarch.rpm
@wwwted
wwwted / my.cnf
Created February 25, 2021 10:17
MySQL configuration for InnoDB cluster sandbox
View my.cnf
[mysqld]
port=3311
mysqlx_port=33110
socket=/home/ted/sandboxes/cluster/node1/mysql.sock
mysqlx_socket=/home/ted/sandboxes/cluster/node1/mysqlx.sock
basedir=/home/ted/src/mysql-8.0.23-linux-glibc2.12-x86_64/
datadir=/home/ted/sandboxes/cluster/node1/data
server-id=1
View NDB-QUICK-DEMO.txt
1) Install MCM
- Download MCM install package from https://edelivery.oracle.com/
- Install MCM package
Guide on run MCM using systemd: https://github.com/wwwted/Install-MySQL-Cluster-Manager-using-Systemd
2) Configure MCM
- set manager-directory to where you want to store cluster data on disk
- set log-file to where you want to store the mcm logfile.
@wwwted
wwwted / partitionTest2.sql
Last active February 16, 2021 12:14
partitionTest2.sql
View partitionTest2.sql
-- I tested at /home/ted/sandboxes/MySQL-HOWTOs
-- Start MySQL (/home/ted/sandboxes/MySQL-HOWTOs/scripts/start.sh) and bring up client: mysql -uroot -proot -h127.0.0.1 -P3306
-- Run script: source /home/ted/labb/partitioning/partitioning.sql
-- Also tested in OCI, host 130.61.35.76
--
-- Remember to set group_concat_max_len to a high enough value.
-- I recommend setting it to at least 50000.
CREATE DATABASE IF NOT EXISTS ted2;
use ted2;
@wwwted
wwwted / createSimple.sh
Created February 15, 2021 14:23
script to fire up a MySQL instance
View createSimple.sh
#!/bin/bash
MySQL_BIN="/home/ted/src/mysql-8.0.22-linux-glibc2.12-x86_64"
MySQL_HOME="/home/ted/sandboxes/cluster/node1"
## Do not touch below ;)
echo "1) Create MySQL instance"
# If $MySQL_HOME/data exists, stop MySQL + remove all
if [ -d $MySQL_HOME/data ] ; then
@wwwted
wwwted / setenv
Last active February 3, 2021 08:51
setenv
View setenv
export WS_HOME=$PWD
export PATH=${WS_HOME}/mysqlsrc/bin:$PATH
[ ! -e ${WS_HOME}/mysqlsrc/bin/mysql ] && echo "Can not find MySQL binaries, please create mysqlsrc link (${WS_HOME}/mysqlsrc) to MySQL binaries" && return 1;
version=`${WS_HOME}/mysqlsrc/bin/mysql --version | sed -n 's/.*\([0-9]\.[0-9]\.[0-9][0-9]\).*/\1/p' | cut -d'.' -f1,2`
echo "MySQL Version ($version)"
MY_FILE="${WS_HOME}/my.cnf"
[ -e $MY_FILE ] && return
@wwwted
wwwted / mcm.cmds
Last active May 19, 2020 12:28
MCM commands to create cluster
View mcm.cmds
create site --hosts=127.0.0.1 mysite;
add package --basedir=/home/opc/workshop/cluster-7614 cluster7614;
create cluster --package=cluster7614 --processhosts=ndb_mgmd@127.0.0.1,ndbmtd@127.0.0.1,ndbmtd@127.0.0.1 mycluster;
add process --processhosts=mysqld@127.0.0.1,mysqld@127.0.0.1 mycluster;
add process --processhosts=ndbapi@127.0.0.1,ndbapi@127.0.0.1 mycluster;
add process --processhosts=ndbapi@127.0.0.1,ndbapi@127.0.0.1 mycluster;
set port:mysqld:50=3310 mycluster;
set port:mysqld:51=3311 mycluster;
set StopOnError:ndbmtd=0 mycluster;
@wwwted
wwwted / helloREST.c
Created April 24, 2020 11:08
Simple c program that listens to some port and prints "Hello World" as responce
View helloREST.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
/*