My Certification

Oracle Database 10g OCP
Oracle Database 11g OCP
Oracle Database 12c OCP
Oracle GoldenGate 10 OCS
Oracle 11gR2 RAC OCE
MySQL 5.6 Database OCP
Novell SUSE Linux 10 CLA
IBM Power System AIX 7.1



MariaDB ColumnStore DataRedundancy Module Installation and configuration on CentOS 7

columnstore-cluster架构
pm1 172.172.20.33
pm2 172.172.20.34
pm3 172.172.20.35
pm4 172.172.20.36
pm5 172.172.20.37
 
 
在每台node上执行下列操作
ssh-keygen
ssh-copy-id -i ~/.ssh/id_rsa.pub pm1
ssh-copy-id -i ~/.ssh/id_rsa.pub pm2
ssh-copy-id -i ~/.ssh/id_rsa.pub pm3
ssh-copy-id -i ~/.ssh/id_rsa.pub pm4
ssh-copy-id -i ~/.ssh/id_rsa.pub pm5
yum -y install boost expect perl perl-DBI openssl zlib file sudo libaio rsync snappy net-tools perl-DBD-MySQL epel-release
 

Continue reading MariaDB ColumnStore DataRedundancy Module Installation and configuration on CentOS 7

MariaDB ColumnStore Multi-Server distributed Module Installation and configuration on CentOS 7

columnstore-cluster架构
um1 192.168.3.201
um2 192.168.3.202
pm1 192.168.3.203
pm2 192.168.3.204

 

在每台node上执行下列操作
ssh-keygen
ssh-copy-id -i ~/.ssh/id_rsa.pub pm1
ssh-copy-id -i ~/.ssh/id_rsa.pub pm2
ssh-copy-id -i ~/.ssh/id_rsa.pub um2
ssh-copy-id -i ~/.ssh/id_rsa.pub um1
yum -y install boost expect perl perl-DBI openssl zlib file sudo libaio rsync snappy net-tools perl-DBD-MySQL epel-release

关闭防火墙
systemctl stop firewalld  
systemctl disable firewalld

Continue reading MariaDB ColumnStore Multi-Server distributed Module Installation and configuration on CentOS 7

MariaDB ColumnStore Multi-Server distributed Module Installation and configuration on CentOS 6

columnstore-cluster架构
um1 192.168.3.101
pm1 192.168.3.102
pm2 192.168.3.103
pm3 192.168.3.104

 

在每台node上执行下列操作
ssh-keygen
ssh-copy-id -i ~/.ssh/id_rsa.pub pm1
ssh-copy-id -i ~/.ssh/id_rsa.pub pm2
ssh-copy-id -i ~/.ssh/id_rsa.pub pm3
ssh-copy-id -i ~/.ssh/id_rsa.pub um1
yum -y install boost expect perl perl-DBI openssl zlib file sudo libaio rsync snappy net-tools perl-DBD-MySQL epel-release
yum -y groupinstall "Development Tools"
yum -y install jemalloc iftop iotop

Continue reading MariaDB ColumnStore Multi-Server distributed Module Installation and configuration on CentOS 6

MariaDB ColumnStore Multi-Server Combined Module Installation and configuration on CentOS 7

安装columnstore
yum -y remove "mariadb-*" "MariaDB-*"
yum -y remove "mariadb-columnstore-*"
[root@node5 /root/software/column]# ls -l
total 246336
-rw-rw-r– 1 webadmin mysql 12744368 Nov 16 23:09 mariadb-columnstore-1.1.2-1-x86_64-centos7-client.rpm
-rw-rw-r– 1 webadmin mysql   156672 Nov 16 23:09 mariadb-columnstore-1.1.2-1-x86_64-centos7-common.rpm
-rw-rw-r– 1 webadmin mysql    46444 Nov 16 23:09 mariadb-columnstore-1.1.2-1-x86_64-centos7-gssapi-server.rpm
-rw-rw-r– 1 webadmin mysql 57896264 Nov 16 23:20 mariadb-columnstore-1.1.2-1-x86_64-centos7-libs.rpm
-rw-rw-r– 1 webadmin mysql 27390928 Nov 16 23:20 mariadb-columnstore-1.1.2-1-x86_64-centos7-platform.rpm
-rw-rw-r– 1 webadmin mysql 68613100 Nov 16 23:09 mariadb-columnstore-1.1.2-1-x86_64-centos7-rocksdb-engine.rpm
-rw-rw-r– 1 webadmin mysql 72573960 Nov 16 23:09 mariadb-columnstore-1.1.2-1-x86_64-centos7-server.rpm
-rw-rw-r– 1 webadmin mysql   369708 Nov 16 23:09 mariadb-columnstore-1.1.2-1-x86_64-centos7-shared.rpm
-rw-rw-r– 1 webadmin mysql  7226732 Nov 16 23:20 mariadb-columnstore-1.1.2-1-x86_64-centos7-storage-engine.rpm
-rw-rw-r– 1 webadmin mysql  5202200 Nov 16 23:09 mariadb-columnstore-1.1.2-1-x86_64-centos7-tokudb-engine.rpm
[root@node5 /root/software/column]# 
[root@node5 /root/software/column]# yum localinstall *.rpm
Continue reading MariaDB ColumnStore Multi-Server Combined Module Installation and configuration on CentOS 7

MariaDB ColumnStore Single-Server Installation and configuration on CentOS 7

rpm安装columnstore
[root@node5 /root/software/column]# ls -l
total 246336
-rw-rw-r– 1 webadmin mysql 12744368 Nov 16 23:09 mariadb-columnstore-1.1.2-1-x86_64-centos7-client.rpm
-rw-rw-r– 1 webadmin mysql   156672 Nov 16 23:09 mariadb-columnstore-1.1.2-1-x86_64-centos7-common.rpm
-rw-rw-r– 1 webadmin mysql    46444 Nov 16 23:09 mariadb-columnstore-1.1.2-1-x86_64-centos7-gssapi-server.rpm
-rw-rw-r– 1 webadmin mysql 57896264 Nov 16 23:20 mariadb-columnstore-1.1.2-1-x86_64-centos7-libs.rpm
-rw-rw-r– 1 webadmin mysql 27390928 Nov 16 23:20 mariadb-columnstore-1.1.2-1-x86_64-centos7-platform.rpm
-rw-rw-r– 1 webadmin mysql 68613100 Nov 16 23:09 mariadb-columnstore-1.1.2-1-x86_64-centos7-rocksdb-engine.rpm
-rw-rw-r– 1 webadmin mysql 72573960 Nov 16 23:09 mariadb-columnstore-1.1.2-1-x86_64-centos7-server.rpm
-rw-rw-r– 1 webadmin mysql   369708 Nov 16 23:09 mariadb-columnstore-1.1.2-1-x86_64-centos7-shared.rpm
-rw-rw-r– 1 webadmin mysql  7226732 Nov 16 23:20 mariadb-columnstore-1.1.2-1-x86_64-centos7-storage-engine.rpm
-rw-rw-r– 1 webadmin mysql  5202200 Nov 16 23:09 mariadb-columnstore-1.1.2-1-x86_64-centos7-tokudb-engine.rpm
[root@node5 /root/software/column]# 
[root@node5 /root/software/column]# yum localinstall *.rpm
Continue reading MariaDB ColumnStore Single-Server Installation and configuration on CentOS 7

MySQL innodb Specified key was too long; max key length is 767 bytes

If you get this error, it means that you exceeded the limit of the maximum key length. A key can not be longer than 767 bytes for InnoDB (or 1000 for MyISAM). Please note that this limit is set in bytes, not in characters. So if you use a multi-byte character set (such as UTF8), you can get this error even if the sum of column lengths is less than the allowed value because column length is defined in characters. 
Innodb索引字段长度的上限是767字节所以对于多字节字符集的大字段创建索引就会出现Specified Key was Too Long; Max Key Length is 767 Bytes错误。

 

The utf8 Character Set (3-Byte UTF-8 Unicode Encoding)
utf8为3字节字符集,所以最大长度为767 / 3 ~= 255,大于255长度字段创建索引就会报错。

 

The utf8mb4 Character Set (4-Byte UTF-8 Unicode Encoding)
utf8mb4为4字节字符集,所以最大长度为767 / 4 ~= 191,大于191长度字段创建索引就会报错。

 

下面分别是utf8和utf8mb4字符集的例子
utf8

Continue reading MySQL innodb Specified key was too long; max key length is 767 bytes

Step by Step 使用kubeadm离线安装Kubernetes1.9.0集群

CentOS7.3
配置系统/etc/hosts

172.172.20.33    node1 (master)
172.172.20.34    node2
172.172.20.35    node3
172.172.20.36    node4
172.172.20.37    node5


关闭防火墙和selinux
systemctl stop firewalld
systemctl disable firewalld
setenforce 0


添加配置内核参数/etc/sysctl.d/k8s.conf文件
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
vm.swappiness = 0
sysctl -p /etc/sysctl.d/k8s.conf


官方Installing kubeadm推荐的参数配置
https://kubernetes.io/docs/setup/independent/install-kubeadm/


最新的kubernetes1.9版本中已经针对docker的1.11.2, 1.12.6, 1.13.1, 17.03等版本做了验证,这里选择17.03.2版本。
添加docker-ce源

yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager –add-repo https://download.docker.com/linux/centos/docker-ce.repo

Continue reading Step by Step 使用kubeadm离线安装Kubernetes1.9.0集群

Rancher Server Single / HA部署

Rancher Server Single安装

172.172.241.245 Rancher Server
172.172.241.161 Rancher Agent
172.172.241.162 Rancher Agent
172.172.241.163 Rancher Agent

#启动Rancher Server
docker run -d \
–restart always \
–name rancher_server \
-v /etc/localtime:/etc/localtime:ro \
-p 8080:8080 \
rancher/server:v1.6.11


#注册Rancher Agent
docker run -e CATTLE_AGENT_IP="172.172.241.161"  -e CATTLE_HOST_LABELS='host=golang-front-app-01'  –rm –privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.2.7 http://172.172.241.245:8080/v1/scripts/90A091C98940DFBB02EA:1483142400000:XBC98BDakjeoj9DcF25fynp1MfE

docker run -e CATTLE_AGENT_IP="172.172.241.162"  -e CATTLE_HOST_LABELS='host=golang-front-app-02'  –rm –privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.2.7 http://172.172.241.245:8080/v1/scripts/90A091C98940DFBB02EA:1483142400000:XBC98BDakjeoj9DcF25fynp1MfE

docker run -e CATTLE_AGENT_IP="172.172.241.163"  -e CATTLE_HOST_LABELS='host=golang-front-app-03'  –rm –privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.2.7 http://172.172.241.245:8080/v1/scripts/90A091C98940DFBB02EA:1483142400000:XBC98BDakjeoj9DcF25fynp1MfE

 

 

Rancher Server HA安装,使用外置MySQL

172.172.241.165 Rancher MySQL
172.172.241.245 HAProxy Server
172.172.241.164 Rancher Server1
172.172.241.165 Rancher Server2
172.172.241.161 Rancher Agent
172.172.241.162 Rancher Agent
172.172.241.163 Rancher Agent

#mysql5.6
CREATE DATABASE IF NOT EXISTS cattle COLLATE = 'utf8_general_ci' CHARACTER SET = 'utf8';
GRANT ALL ON cattle.* TO 'cattle'@'%' IDENTIFIED BY 'cattle';
GRANT ALL ON cattle.* TO 'cattle'@'localhost' IDENTIFIED BY 'cattle';

 

#启动Rancher Server1
docker run -d \
–restart=unless-stopped \
–name rancher_server_ha1 \
-p 8080:8080 \
-p 9345:9345 \
rancher/server:v1.6.11 \
–db-host 172.172.241.165 \
–db-port 3306 \
–db-user cattle \
–db-pass cattle \
–db-name cattle \
–advertise-address 172.172.241.164

#启动Rancher Server2
docker run -d \
–restart=unless-stopped \
–name rancher_server_ha2 \
-p 8080:8080 \
-p 9345:9345 \
rancher/server:v1.6.11 \
–db-host 172.172.241.165 \
–db-port 3306 \
–db-user cattle \
–db-pass cattle \
–db-name cattle \
–advertise-address 172.172.241.165


#HAProxy 配置
global
  maxconn 4096
  ssl-server-verify none
 
defaults
  mode http
  balance roundrobin
  option redispatch
  option forwardfor
 
  timeout connect 5s
  timeout queue 5s
  timeout client 36000s
  timeout server 36000s
 
frontend http-in
  mode http
  #bind *:443 ssl crt /etc/haproxy/certificate.pem
  bind *:8080
  default_backend rancher_servers
 
  # Add headers for SSL offloading
  http-request set-header X-Forwarded-Proto https if { ssl_fc }
  http-request set-header X-Forwarded-Ssl on if { ssl_fc }
 
  acl is_websocket hdr(Upgrade) -i WebSocket
  acl is_websocket hdr_beg(Host) -i ws
  use_backend rancher_servers if is_websocket
 
backend rancher_servers
  server websrv1 172.172.241.164:8080 weight 1 maxconn 1024
  server websrv2 172.172.241.165:8080 weight 1 maxconn 1024

  
  
#启动 HAProxy
haproxy -f /etc/haproxy/haproxy.cfg &


#注册Rancher Agent
docker run -e CATTLE_AGENT_IP="172.172.241.161"  -e CATTLE_HOST_LABELS='host=golang-front-app-01'  –rm –privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.2.7 http://172.172.241.245:8080/v1/scripts/90A091C98940DFBB02EA:1483142400000:XBC98BDakjeoj9DcF25fynp1MfE

docker run -e CATTLE_AGENT_IP="172.172.241.162"  -e CATTLE_HOST_LABELS='host=golang-front-app-02'  –rm –privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.2.7 http://172.172.241.245:8080/v1/scripts/90A091C98940DFBB02EA:1483142400000:XBC98BDakjeoj9DcF25fynp1MfE

docker run -e CATTLE_AGENT_IP="172.172.241.163"  -e CATTLE_HOST_LABELS='host=golang-front-app-03'  –rm –privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.2.7 http://172.172.241.245:8080/v1/scripts/90A091C98940DFBB02EA:1483142400000:XBC98BDakjeoj9DcF25fynp1MfE

 

rancher1

 

rancher2

rancher3

 

rancher4

 

#clean
docker rmi -f $(docker images|awk '{print $1":"$2}'|grep -v REP)
docker rm -f -v $(docker ps -aq) 
docker volume rm $(docker volume ls)
rm -rf /var/etcd/
rm -rf /var/lib/rancher/state/