etcd学习教程

用于etcd的教程使用

  1. etcd开启授权需要单独的命令
    ./etcdctl –endpoint=127.0.0.1:2379 auth enable

  2. 添加用户
    ./etcdctl –endpoint=127.0.0.1:2379 user add

  3. 给用户添加角色
    ./etcdctl –endpoints=http://127.0.0.1:2379 –user=user:pass user grant-role root root

  4. 添加角色
    ./etcdctl –endpoints=http://127.0.0.1:2379 –user=user:pass role add role

  5. 添加读写权限 read_write, read_only
    ./etcdctl –endpoints=http://127.0.0.1:2379 –user=user:pass role grant-permission read_write –prefix=true readwrite /