Skip to content

Instantly share code, notes, and snippets.

View wwwted's full-sized avatar

Ted Wennmark wwwted

  • Oracle/MySQL
  • Uppsala Sweden
View GitHub Profile
@wwwted
wwwted / ndb_collect_logs.sh
Last active October 20, 2023 05:33
Script to collect logs from NDB cluster running in K8s using the NDB Operator
#!/bin/bash
# From management nodes:
# - config-ini from configmap: kubectl get configmap ndb-demo-config -n ndb-cluster -o jsonpath='{.data.config\.ini}'
# - /var/lib/ndb/data/ndb_1_cluster.log
#
# From data nodes:
# - data node log from kubectl logs
#
# From MySQL API nodes:
@wwwted
wwwted / NDB80_FlexAsynch
Created May 30, 2022 07:06
FlexAsynch build for NDN 8.0 on Oracle Linux 8.0
My notes on building flexAsynch from source code on Oracle Linux 8.0.
Build MySQL Cluster from source docs:
- https://dev.mysql.com/doc/refman/8.0/en/mysql-cluster-install-linux-source.html
- https://dev.mysql.com/doc/refman/8.0/en/source-installation-prerequisites.html
On Oracle Linux 8.0
===================
Prerequisites for building our source code:
@wwwted
wwwted / Zeppelin_MySQL
Last active March 10, 2022 11:18
MySQL and Apache Zeppelin testing
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 / mysql_yum_install.txt
Created March 1, 2022 12:33
Install MySQL YUM repo on OL7 and OL8
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
[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
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 22, 2024 08:18
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
#!/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
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 / helloREST.c
Created April 24, 2020 11:08
Simple c program that listens to some port and prints "Hello World" as responce
#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>
/*