This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# main.go | |
- docker-compose.yaml | |
## bin | |
- server | |
## cmd | |
- root.go | |
- server.go | |
- setup.go |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse | |
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse | |
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse | |
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse | |
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse | |
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse | |
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"errors" | |
"fmt" | |
"log" | |
"sync" | |
"time" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:1.11.0 as builder | |
RUN apt-get -y update && apt-get install -y sqlite3 libsqlite3-dev | |
COPY . /go/src/sqltest | |
WORKDIR /go/src/sqltest | |
RUN go build -o sqltest main.go |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"encoding/json" | |
"errors" | |
"fmt" | |
"log" | |
"os" | |
"reflect" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/xml" | |
"fmt" | |
) | |
type Envelop struct { | |
XMLName xml.Name | |
Body Body `xml:"Body"` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
// type number uint8 | |
const ( | |
zero int = 0x7E // 0b1111110 => 6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CLUSTER=ceph | |
ID=${1:-0} | |
NAME=${CLUSTER}-${ID} | |
MON_HOST=192.168.0.3 | |
MON_PORT=6789 | |
mkdir -p /var/lib/ceph/mds/${CLUSTER}-{ID} | |
ceph-authtool --create-keyring /var/lib/ceph/mds/$NAME/keyring --gen-key -n mds.${ID} | |
ceph auth add mds.${ID} osd "allow rwx" mds "allow" mon "allow profile mds" -i /var/lib/ceph/mds/$NAME/keyring |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UUID=$(uuidgen) | |
OSD_SECRET=$(ceph-authtool --gen-print-key) | |
NAME=centos_$HOSTNAME | |
DEV=/dev/mapper/$NAME-data | |
ID=$(echo "{\"cephx_secret\": \"$OSD_SECRET\"}" | \ | |
ceph osd new $UUID -i - \ | |
-n client.admin -k /etc/ceph/ceph.client.admin.keyring) | |
mkdir /var/lib/ceph/osd/ceph-$ID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MEMBERS=192.168.0.4,192.168.0.5 | |
HOST=192.168.0.3 | |
CEPH_USER_ID=`id -u ceph` | |
MASTER=k8smaster | |
ID=`uuidgen` | |
NODE=${1:-0} | |
CLUSTER=ceph | |
NETWORK=192.168.0.0/24 | |
osd journal size = 1024 | |
osd pool default size = 3 |
NewerOlder