Oct 16, 2020
TechnologyServer side(k8s)
kkk.yaml
defined the subnet created via kubeovn
apiVersion: kubeovn.io/v1
kind: Subnet
metadata:
name: etc
spec:
protocol: IPv4
default: false
namespaces:
- etl
- etl1
cidrBlock: 100.64.0.0/16
gateway: 100.64.0.1
excludeIps:
- 100.64.0.1
private: false
gatewayType: distributed
natOutgoing: false
Create the subnet via kubectl create -f kkk.yaml
, then you could view the subnet via:
# kubectl get subnet
NAME PROTOCOL CIDR PRIVATE NAT DEFAULT GATEWAYTYPE USED AVAILABLE
etc IPV4 100.64.0.0/16 false false false distributed 1 65532
Create namespace via kubectl create ns etl
and kubectl create ns etl1
, then run a deployment in these 2 namespace:
# kubectl run nginxetl --image=nginx:1.17 --namespace etl
# kubectl get pod -n etl -o wide
The pod's ip address is 100.64.0.3
Client Side(outer space machines)
Add route via:
# route add -net 100.64.0.0/16 gw 192.192.xxx.xxx
# curl 100.64.0.3
Sep 28, 2020
TechnologyTips
Version: ATTITUDE ADJUSTMENT (12.09, r36088)
, so we have to login into this box via:
$ ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 root@192.168.2.1
Luckly we got the dhcp enabled in this equipment!!! Otherwise this equipment is bricked.
Change wifi setting under Network->Wifi->Interface Configuration->General Setup
:
Sep 27, 2020
Technology主节点操作:
root@newnode-1:/home/test# ETCDCTL_API=3 etcdctl --endpoints=https://192.168.122.21:2379 --cacert="/etc/ssl/etcd/ssl/ca.pem" --cert="/etc/ssl/etcd/ssl/member-newnode-1.pem" --key="/etc/ssl/etcd/ssl/member-newnode-1-key.pem" member list
4047613ce64ac480, started, etcd2, https://192.168.122.58:2380, https://192.168.122.58:2379
ac76e9faf75cf70f, started, etcd3, https://192.168.122.75:2380, https://192.168.122.75:2379
e99611c964d08e01, started, etcd1, https://192.168.122.21:2380, https://192.168.122.21:2379
root@newnode-1:/home/test# ETCDCTL_API=2 etcdctl --endpoints=https://192.168.122.21:2379 --ca-file="/etc/ssl/etcd/ssl/ca.pem" --cert-file="/etc/ssl/etcd/ssl/member-newnode-1.pem" --key-file="/etc/ssl/etcd/ssl/member-newnode-1-key.pem" cluster-health
member 4047613ce64ac480 is healthy: got healthy result from https://192.168.122.58:2379
failed to check the health of member ac76e9faf75cf70f on https://192.168.122.75:2379: Get https://192.168.122.75:2379/health: dial tcp 192.168.122.75:2379: connect: connection refused
member ac76e9faf75cf70f is unreachable: [https://192.168.122.75:2379] are all unreachable
member e99611c964d08e01 is healthy: got healthy result from https://192.168.122.21:2379
cluster is degraded
删除问题节点:
root@newnode-1:/home/test# ETCDCTL_API=2 etcdctl --endpoints=https://192.168.122.21:2379 --ca-file="/etc/ssl/etcd/ssl/ca.pem" --cert-file="/etc/ssl/etcd/ssl/member-newnode-1.pem" --key-file="/etc/ssl/etcd/ssl/member-newnode-1-key.pem" member remove ac76e9faf75cf70f
Removed member ac76e9faf75cf70f from cluster
root@newnode-1:/home/test# ETCDCTL_API=2 etcdctl --endpoints=https://192.168.122.21:2379 --ca-file="/etc/ssl/etcd/ssl/ca.pem" --cert-file="/etc/ssl/etcd/ssl/member-newnode-1.pem" --key-file="/etc/ssl/etcd/ssl/member-newnode-1-key.pem" member list
4047613ce64ac480: name=etcd2 peerURLs=https://192.168.122.58:2380 clientURLs=https://192.168.122.58:2379 isLeader=true
e99611c964d08e01: name=etcd1 peerURLs=https://192.168.122.21:2380 clientURLs=https://192.168.122.21:2379 isLeader=false
问题节点上操作:
systemctl stop etcd
mv /var/lib/etcd /var/lib/etcd.back
mkdir /var/lib/etcd
systemctl start etcd
新增:
root@newnode-1:/home/test# ETCDCTL_API=2 etcdctl --endpoints=https://192.168.122.21:2379 --ca-file="/etc/ssl/etcd/ssl/ca.pem" --cert-file="/etc/ssl/etcd/ssl/member-newnode-1.pem" --key-file="/etc/ssl/etcd/ssl/member-newnode-1-key.pem" member add etcd3 https://192.168.122.75:2380
Added member named etcd3 with ID 318e07d1cc0d3933 to cluster
ETCD_NAME="etcd3"
ETCD_INITIAL_CLUSTER="etcd3=https://192.168.122.75:2380,etcd2=https://192.168.122.58:2380,etcd1=https://192.168.122.21:2380"
ETCD_INITIAL_CLUSTER_STATE="existing"
root@newnode-1:/home/test# ETCDCTL_API=2 etcdctl --endpoints=https://192.168.122.21:2379 --ca-file="/etc/ssl/etcd/ssl/ca.pem" --cert-file="/etc/ssl/etcd/ssl/member-newnode-1.pem" --key-file="/etc/ssl/etcd/ssl/member-newnode-1-key.pem" member list
318e07d1cc0d3933[unstarted]: peerURLs=https://192.168.122.75:2380
4047613ce64ac480: name=etcd2 peerURLs=https://192.168.122.58:2380 clientURLs=https://192.168.122.58:2379 isLeader=true
e99611c964d08e01: name=etcd1 peerURLs=https://192.168.122.21:2380 clientURLs=https://192.168.122.21:2379 isLeader=false
如果是unstarted 状态,则到有问题节点:
systemctl stop etcd
rm -rf /var/lib/etcd/member
systemctl start etcd
回到主节点, 观察集群状态是否回复成功
root@newnode-1:/home/test# ETCDCTL_API=2 etcdctl --endpoints=https://192.168.122.21:2379 --ca-file="/etc/ssl/etcd/ssl/ca.pem" --cert-file="/etc/ssl/etcd/ssl/member-newnode-1.pem" --key-file="/etc/ssl/etcd/ssl/member-newnode-1-key.pem" member list
4047613ce64ac480: name=etcd2 peerURLs=https://192.168.122.58:2380 clientURLs=https://192.168.122.58:2379 isLeader=true
531c8ba1dbabce70: name=etcd3 peerURLs=https://192.168.122.75:2380 clientURLs=https://192.168.122.75:2379 isLeader=false
e99611c964d08e01: name=etcd1 peerURLs=https://192.168.122.21:2380 clientURLs=https://192.168.122.21:2379 isLeader=false
root@newnode-1:/home/test# ETCDCTL_API=2 etcdctl --endpoints=https://192.168.122.21:2379 --ca-file="/etc/ssl/etcd/ssl/ca.pem" --cert-file="/etc/ssl/etcd/ssl/member-newnode-1.pem" --key-file="/etc/ssl/etcd/ssl/member-newnode-1-key.pem" cluster-health
member 4047613ce64ac480 is healthy: got healthy result from https://192.168.122.58:2379
member 531c8ba1dbabce70 is healthy: got healthy result from https://192.168.122.75:2379
member e99611c964d08e01 is healthy: got healthy result from https://192.168.122.21:2379
cluster is healthy
Sep 27, 2020
TechnologyReflash latest firmware
Examine the disk and write the image to disk:
Disk /dev/sdd:1.88 GiB,2021654528 字节,3948544 个扇区
磁盘型号:
单元:扇区 / 1 * 512 = 512 字节
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
磁盘标签类型:dos
磁盘标识符:0x2fbbe9fe
设备 启动 起点 末尾 扇区 大小 Id 类型
/dev/sdd1 * 0 1390591 1390592 679M 0 空
/dev/sdd2 264 131335 131072 64M ef EFI (FAT-12/16/32)
dash@archnvme:/media/sda $ cd ~/Downloads
dash@archnvme:~/Downloads $ sudo su
[root@archnvme Downloads]# gzip -dc reflash111_of.img.gz | dd of=/dev/sdd bs=1M
Mount reflash’s usb disk into computer:
Mount the USB device on your system; you should see a volume named rfl-boot.
On the rfl-boot volume there is a directory named reflash.
Download the operating system image you would like to write, along with its MD5 file.
Copy both the compressed .img.gz file and its .img.gz.md5 counterpart into the reflash directory.
Now insert the flashed usb disk into joggler, then flash will begin.
After flashing, could poweron from flash.
Sep 24, 2020
TechnologyInstallation
Install microsoft visual studio code via:
$ sudo vim /etc/pacman.conf
[archlinuxcn]
#The Chinese Arch Linux communities packages.
SigLevel = Never
Server = http://repo.archlinuxcn.org/$arch
$ sudo pacman -Sy
$ sudo pacman -S visual-studio-code-bin
Install Plugin
Install via:
Install prince(for converting to pdf)via:
$ sudo pacman -S prince-bin
Configure the stylesheet for prince’s generated output:
$ cat ~/.mume/style.less
/* Please visit the URL below for more information: */
/* https://shd101wyy.github.io/markdown-preview-enhanced/#/customize-css */
.markdown-preview.markdown-preview {
// modify your style here
// eg: background-color: blue;
&.prince {
@page {
//size: A4 landscape
size: A4 PortraitModes
}
@font-face {
font-family: sans-serif;
font-style: normal;
font-weight: normal;
src: url("/usr/share/fonts/adobe-source-han-sans/SourceHanSansCN-Regular.otf")
}
@font-face {
font-family: sans-serif;
font-style: normal;
font-weight: bold;
src: url("/usr/share/fonts/adobe-source-han-sans/SourceHanSansCN-Bold.otf")
}
@font-face {
font-family: sans-serif;
font-style: italic;
font-weight: normal;
src: url("/usr/share/fonts/adobe-source-code-pro/SourceCodePro-It.otf")
//src: url("/usr/share/fonts/adobe-source-han-sans/SourceHanSansCN-Regular.otf")
}
@font-face {
font-family: sans-serif;
font-style: italic;
font-weight: bold;
src: url("/usr/share/fonts/adobe-source-code-pro/SourceCodePro-BoldIt.otf")
//src: url("/usr/share/fonts/adobe-source-han-sans/SourceHanSansCN-Bold.otf")
}
}
}
Or edit the css via ctrl+shift+p
and Run Markdown Preview Enhanced: Customize Css
, Insert the above code.