• etcd etcd on unsupported platform without ETCD_UNSUPPORTED_ARCH=arm64 set


    oot@ubuntu:~/cfssl/etcd# /usr/bin/etcd version
    2021-07-01 16:00:41.185752 W | etcdmain: running etcd on unsupported architecture "arm64" since ETCD_UNSUPPORTED_ARCH is set
    2021-07-01 16:00:41.185945 E | etcdmain: error verifying flags, 'version' is not a valid flag. See 'etcd --help'.
    root@ubuntu:~/cfssl/etcd# 

    根据提示设置环境变量

    # export ETCD_UNSUPPORTED_ARCH=arm64

    也可以加入到vi ~/.bash_profile中然后source ~/.bash_profile固化下来

    root@ubuntu:~/cfssl/etcd# /usr/bin/etcd version
    2021-07-01 16:01:14.205081 W | etcdmain: running etcd on unsupported architecture "arm64" since ETCD_UNSUPPORTED_ARCH is set
    2021-07-01 16:01:14.205273 E | etcdmain: error verifying flags, 'version' is not a valid flag. See 'etcd --help'.
    root@ubuntu:~/cfssl/etcd# 

    下载

    etcd-v3.3.11
    root@ubuntu:~/cfssl/etcd# ls etcd-v3.3.11-linux-arm64
    Documentation  etcd  etcdctl  README-etcdctl.md  README.md  READMEv2-etcdctl.md
    root@ubuntu:~/cfssl/etcd# ./etcd-v3.3.11-linux-arm64/etcd --version
    2021-07-01 16:06:22.589156 W | etcdmain: running etcd on unsupported architecture "arm64" since ETCD_UNSUPPORTED_ARCH is set
    etcd Version: 3.3.11
    Git SHA: 2cf9e51d2
    Go Version: go1.10.7
    Go OS/Arch: linux/arm64

     采用3.5的可以了

    /etcd-v3.5.0-linux-arm64# ./etcd version
    {"level":"info","ts":1625128352.6903818,"caller":"etcdmain/etcd.go:72","msg":"Running: ","args":["./etcd","version"]}
    {"level":"warn","ts":1625128352.6904616,"caller":"etcdmain/etcd.go:74","msg":"failed to verify flags","error":"'version' is not a valid flag"}

    Jul 01 16:28:54 ubuntu etcd[19548]: {"level":"fatal","ts":1625128134.5026824,"caller":"flags/flag.go:85","msg":"conflicting environment variable is shadowed by corresponding command-line flag (either unset environment variable or disable flag))","envir
    Jul 01 16:28:54 ubuntu systemd[1]: etcd.service: Main process exited, code=exited, status=1/FAILURE
    Jul 01 16:28:54 ubuntu systemd[1]: etcd.service: Failed with result 'exit-code'.
    Jul 01 16:28:54 ubuntu systemd[1]: Failed to start Etcd Server.

    etcd 3.4注意事项:

    ETCD3.4版本ETCDCTL_API=3 etcdctl 和 etcd --enable-v2=false 成为了默认配置,如要使用v2版本,执行etcdctl时候需要设置ETCDCTL_API环境变量,例如:ETCDCTL_API=2 etcdctl
    ETCD3.4版本会自动读取环境变量的参数,所以EnvironmentFile文件中有的参数,不需要再次在ExecStart启动参数中添加,二选一,如同时配置,会触发以下类似报错“etcd: conflicting environment variable “ETCD_NAME” is shadowed by corresponding command-line flag (either unset environment variable or disable flag)”
    flannel操作etcd使用的是v2的API,而kubernetes操作etcd使用的v3的API
    注意:flannel操作etcd使用的是v2的API,而kubernetes操作etcd使用的v3的API,为了兼容flannel,将默认开启v2版本,故需要配置文件/opt/soft/etcd/etcd.conf中设置 ETCD_ENABLE_V2=“true”

    root@ubuntu:~/cfssl/etcd# etcd version
    {"level":"info","ts":1625130858.3037004,"caller":"etcdmain/etcd.go:72","msg":"Running: ","args":["etcd","version"]}
    {"level":"warn","ts":1625130858.3037755,"caller":"etcdmain/etcd.go:74","msg":"failed to verify flags","error":"'version' is not a valid flag"}
    root@ubuntu:~/cfssl/etcd# cat /etc/etcd/etcd.conf 
    DATA_DIR="/data/k8s/etcd/data"
    ETCD_WAL_DIR="/data/k8s/etcd/wal"
    ETCD_LISTEN_PEER_URLS="https://10.10.16.82:2380"
    ETCD_LISTEN_CLIENT_URLS="https://10.10.16.82:2379"
    ETCD_MAX_SNAPSHOTS="5"
    ETCD_MAX_WALS="5"
    ETCD_NAME="etcd3"
    ETCD_SNAPSHOT_COUNT="100000"
    ETCD_HEARTBEAT_INTERVAL="100"
    ETCD_ELECTION_TIMEOUT="1000"
    
    ETCD_INITIAL_ADVERTISE_PEER_URLS="https://10.10.16.82:2380"
    ETCD_ADVERTISE_CLIENT_URLS="https://10.10.16.82:2379"
    
    ETCD_INITIAL_CLUSTER="etcd1=https://10.10.16.251:2380,etcd2=https://10.10.16.47:2380,etcd3=https://10.10.16.82:2380"
    ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster"
    ETCD_INITIAL_CLUSTER_STATE="new"
    root@ubuntu:~/cfssl/etcd# cat /lib/systemd/system/etcd.service
    [Unit]
    Description=Etcd Server
    After=network.target
    After=network-online.target
    Wants=network-online.target
    
    [Service]
    Type=notify
    EnvironmentFile=/etc/etcd/etcd.conf
    ExecStart=/usr/bin/etcd   --cert-file=/opt/etcd/ssl/server.pem --key-file=/opt/etcd/ssl/server-key.pem --peer-cert-file=/opt/etcd/ssl/server.pem --peer-key-file=/opt/etcd/ssl/server-key.pem --trusted-ca-file=/opt/etcd/ssl/ca.pem --peer-trusted-ca-file=/opt/etcd/ssl/ca.pem
    Restart=on-failure
    LimitNOFILE=65536
    
    [Install]
    WantedBy=multi-user.target
    root@ubuntu:~/cfssl/etcd# ps -elf | grep etcd
    4 S root     31272     1  1  80   0 - 2803937 futex_ 17:10 ?      00:00:03 /usr/bin/etcd --cert-file=/opt/etcd/ssl/server.pem --key-file=/opt/etcd/ssl/server-key.pem --peer-cert-file=/opt/etcd/ssl/server.pem --peer-key-file=/opt/etcd/ssl/server-key.pem --trusted-ca-file=/opt/etcd/ssl/ca.pem --peer-trusted-ca-file=/opt/etcd/ssl/ca.pem
    0 S root     32305 12244  0  80   0 -  1096 pipe_w 17:14 pts/1    00:00:00 grep etcd
    root@ubuntu:~/cfssl/etcd# systemctl status etcd
    ● etcd.service - Etcd Server
       Loaded: loaded (/lib/systemd/system/etcd.service; enabled; vendor preset: enabled)
       Active: active (running) since Thu 2021-07-01 17:10:55 HKT; 4min 4s ago
     Main PID: 31272 (etcd)
        Tasks: 28 (limit: 9830)
       CGroup: /system.slice/etcd.service
               └─31272 /usr/bin/etcd --cert-file=/opt/etcd/ssl/server.pem --key-file=/opt/etcd/ssl/server-key.pem --peer-cert-file=/opt/etcd/ssl/server.pem --peer-key-file=/opt/etcd/ssl/server-key.pem --trusted-ca-file=/opt/etcd/ssl/ca.pem --peer-trusted-c
    root@ubuntu:~/cfssl/etcd# ETCDCTL_API=3 ./etcdctl --cacert  ./etcd2/ca.pem  --cert   ./etcd2/server.pem --key   ./etcd2/server-key.pem  --endpoints=https://10.10.16.47:2379,https://10.10.16.251:2379,https://10.10.16.82:2379  endpoint status --write-out=table
    +---------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
    |         ENDPOINT          |        ID        | VERSION | DB SIZE | IS LEADER | IS LEARNER | RAFT TERM | RAFT INDEX | RAFT APPLIED INDEX | ERRORS |
    +---------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
    |  https://10.10.16.47:2379 | e3cc7a0fe07ff87b |   3.5.0 |   20 kB |      true |      false |       622 |         15 |                 15 |        |
    | https://10.10.16.251:2379 | 4b30b4d0c524f887 |  3.3.11 |  262 kB |     false |      false |       622 |         15 |                  0 |        |
    |  https://10.10.16.82:2379 | 7f3a1eceedfff110 |   3.5.0 |   20 kB |     false |      false |       622 |         15 |                 15 |        |
    +---------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
    root@ubuntu:~/cfssl/etcd# 
    root@ubuntu:~/cfssl/etcd# ETCDCTL_API=3 ./etcdctl --cacert  ./etcd2/ca.pem  --cert   ./etcd2/server.pem --key   ./etcd2/server-key.pem  --endpoints=https://10.10.16.47:2379,https://10.10.16.251:2379,https://10.10.16.82:2379  endpoint status --write-out=table
    +---------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
    |         ENDPOINT          |        ID        | VERSION | DB SIZE | IS LEADER | IS LEARNER | RAFT TERM | RAFT INDEX | RAFT APPLIED INDEX | ERRORS |
    +---------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
    |  https://10.10.16.47:2379 | e3cc7a0fe07ff87b |   3.5.0 |  4.7 MB |      true |      false |       622 |       7260 |               7260 |        |
    | https://10.10.16.251:2379 | 4b30b4d0c524f887 |  3.3.11 |  6.1 MB |     false |      false |       622 |       7260 |                  0 |        |
    |  https://10.10.16.82:2379 | 7f3a1eceedfff110 |   3.5.0 |  4.7 MB |     false |      false |       622 |       7260 |               7260 |        |
    +---------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
    root@ubuntu:~/cfssl/etcd# ETCDCTL_API=3 ./etcdctl --cacert  ./etcd2/ca.pem  --cert   ./etcd2/server.pem --key   ./etcd2/server-key.pem  --endpoints=https://10.10.16.47:2379,https://10.10.16.251:2379,https://10.10.16.82:2379  endpoint health
    https://10.10.16.82:2379 is healthy: successfully committed proposal: took = 27.201802ms
    https://10.10.16.47:2379 is healthy: successfully committed proposal: took = 27.041661ms
    https://10.10.16.251:2379 is healthy: successfully committed proposal: took = 35.976114ms
    root@ubuntu:~/cfssl/etcd# ETCDCTL_API=3 ./etcdctl --cacert  ./etcd2/ca.pem  --cert   ./etcd2/server.pem --key   ./etcd2/server-key.pem  --endpoints=https://10.10.16.47:2379,https://10.10.16.251:2379,https://10.10.16.82:2379  member list
    4b30b4d0c524f887, started, etcd1, https://10.10.16.251:2380, https://10.10.16.251:2379, false
    7f3a1eceedfff110, started, etcd3, https://10.10.16.82:2380, https://10.10.16.82:2379, false
    e3cc7a0fe07ff87b, started, etcd2, https://10.10.16.47:2380, https://10.10.16.47:2379, false
    root@ubuntu:~/cfssl/etcd# 
  • 相关阅读:
    JS仿淘宝网顶部的导航菜单
    JS+CSS打造高仿XP默认主题菜单样式
    Jquery打造网页右上角可伸缩关闭的菜单
    来自百度百科的目录显示/隐藏效果
    Jquery打造的下拉层式菜单
    javascript小數位四舍五入[IE5.5+]
    css外容器margin問題[IE中height:100%]
    EXEC执行动态SQL时取出变量值[EXEC函数只能是局部变量]
    sql一列变多列
    判斷日期,輸出成YYYY/MM/DD形式
  • 原文地址:https://www.cnblogs.com/dream397/p/14959232.html
Copyright © 2020-2023  润新知