将设为首页浏览此站
开启辅助访问 天气与日历 收藏本站联系我们切换到窄版

易陆发现论坛

 找回密码
 开始注册
查看: 219|回复: 2
收起左侧

gwcli命令报错REST API failure, code : 500 Unable to access the configuration object

[复制链接]
发表于 2021-7-15 17:31:43 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?开始注册

x
/usr/lib/python2.7/site-packages/ceph_iscsi-3.5-py2.7.egg/ceph_iscsi_config/client.py:1: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release.
& |( c; m! M2 i% G8 rREST API failure, code : 500# K* s7 u% X/ J9 z; P
Unable to access the configuration object
7 l: v$ B8 I: H+ kUnable to contact the local API endpoint (https://localhost:5000/api)
( \  A7 |& f6 O% }
 楼主| 发表于 2021-7-15 17:45:01 | 显示全部楼层
! G7 H9 e' U, v

8 m5 H% A" D' A. [6 T$ N) B0 l( E; v" I% ~: k3 E& c6 S8 ^$ |: p

) ^7 j1 Z! `4 K

Installing:

If you are using the upstream ceph-iscsi package follow the [url=https://docs.ceph.com/en/latest/rbd/iscsi-target-cli-manual-install]manual install instructions.

3 W& f: U; U) J, `9 I

For rpm based instructions execute the following commands:

  • As root, on all iSCSI gateway nodes, install the ceph-iscsi package:

    yum install ceph-iscsi
  • As root, on all iSCSI gateway nodes, install the tcmu-runner package:

    yum install tcmu-runner
      t. u. L3 g9 i+ q$ L

Setup:

  • gwcli requires a pool with the name rbd, so it can store metadata like the iSCSI configuration. To check if this pool has been created run:

    ceph osd lspools+ `1 E0 ^+ e/ G: m. W- Q2 V1 p

    : `3 Z' k6 q% I& M. S' _9 V2 _

    If it does not exist instructions for creating pools can be found on the RADOS pool operations page.

  • As root, on a iSCSI gateway node, create a file named iscsi-gateway.cfg in the /etc/ceph/ directory:

    touch /etc/ceph/iscsi-gateway.cfg
    7 T' X7 h( S5 ], M/ U8 {+ V
    • Edit the iscsi-gateway.cfg file and add the following lines:

      [config]# Name of the Ceph storage cluster. A suitable Ceph configuration file allowing# access to the Ceph storage cluster from the gateway node is required, if not# colocated on an OSD node.cluster_name = ceph# Place a copy of the ceph cluster's admin keyring in the gateway's /etc/ceph# drectory and reference the filename heregateway_keyring = ceph.client.admin.keyring# API settings.# The API supports a number of options that allow you to tailor it to your# local environment. If you want to run the API under https, you will need to# create cert/key files that are compatible for each iSCSI gateway node, that is# not locked to a specific node. SSL cert and key files *must* be called# 'iscsi-gateway.crt' and 'iscsi-gateway.key' and placed in the '/etc/ceph/' directory# on *each* gateway node. With the SSL files in place, you can use 'api_secure = true'# to switch to https mode.# To support the API, the bare minimum settings are:api_secure = false# Additional API configuration options are as follows, defaults shown.# api_user = admin# api_password = admin# api_port = 5001# trusted_ip_list = 192.168.0.10,192.168.0.11
      ! O5 ]% ~8 N/ ~" n9 Z! [" o1 M9 u* o  @) i" J
      Note

      trusted_ip_list is a list of IP addresses on each iSCSI gateway that will be used for management operations like target creation, LUN exporting, etc. The IP can be the same that will be used for iSCSI data, like READ/WRITE commands to/from the RBD image, but using separate IPs is recommended.


        w3 a( B  t; Y4 I0 e8 L
      Important

      The iscsi-gateway.cfg file must be identical on all iSCSI gateway nodes.

    • As root, copy the iscsi-gateway.cfg file to all iSCSI gateway nodes.

      6 D0 L, A7 [+ p. b  ^! \) u/ p
  • As root, on all iSCSI gateway nodes, enable and start the API service:

    systemctl daemon-reloadsystemctl enable rbd-target-gwsystemctl start rbd-target-gwsystemctl enable rbd-target-apisystemctl start rbd-target-api3 i7 ^" v/ y! N% C$ ^

Configuring:

gwcli will create and configure the iSCSI target and RBD images and copy the configuration across the gateways setup in the last section. Lower level tools including targetcli and rbd can be used to query the local configuration, but should not be used to modify it. This next section will demonstrate how to create a iSCSI target and export a RBD image as LUN 0.

  • As root, on a iSCSI gateway node, start the iSCSI gateway command-line interface:

    gwcli
  • Go to iscsi-targets and create a target with the name iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw:

    > /> cd /iscsi-target> /iscsi-target>  create iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw
  • Create the iSCSI gateways. The IPs used below are the ones that will be used for iSCSI data like READ and WRITE commands. They can be the same IPs used for management operations listed in trusted_ip_list, but it is recommended that different IPs are used.

    > /iscsi-target> cd iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw/gateways> /iscsi-target...-igw/gateways>  create ceph-gw-1 10.172.19.21> /iscsi-target...-igw/gateways>  create ceph-gw-2 10.172.19.22
    ( p% w4 i1 M# Q
    1 u6 `! i1 a/ f7 K2 a" a

    If not using RHEL/CentOS or using an upstream or ceph-iscsi-test kernel, the skipchecks=true argument must be used. This will avoid the Red Hat kernel and rpm checks:

    > /iscsi-target> cd iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw/gateways> /iscsi-target...-igw/gateways>  create ceph-gw-1 10.172.19.21 skipchecks=true> /iscsi-target...-igw/gateways>  create ceph-gw-2 10.172.19.22 skipchecks=true
  • Add a RBD image with the name disk_1 in the pool rbd:

    > /iscsi-target...-igw/gateways> cd /disks> /disks> create pool=rbd image=disk_1 size=90G
  • Create a client with the initiator name iqn.1994-05.com.redhat:rh7-client:

    > /disks> cd /iscsi-target/iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw/hosts> /iscsi-target...eph-igw/hosts>  create iqn.1994-05.com.redhat:rh7-client
  • Set the client’s CHAP username to myiscsiusername and password to myiscsipassword:

    > /iscsi-target...at:rh7-client>  auth username=myiscsiusername password=myiscsipassword
      g4 L0 U. O! @- y
    3 ]4 f7 R# u, a2 U- J, C5 [/ I7 D
    Warning

    CHAP must always be configured. Without CHAP, the target will reject any login requests.

  • Add the disk to the client:

    > /iscsi-target...at:rh7-client> disk add rbd/disk_1
    / j1 P% @, _1 T$ p, Z' |/ ~

The next step is to configure the iSCSI initiators.


0 ?2 Z# `3 B; U# y* a2 p( w' f8 @( b; q4 B2 L

  x# V! Q" r* b0 X+ r
% ~4 Q( o+ k1 Y* P& c
' @( F) |8 A* z5 \, m$ c

$ x  }: _  d5 J& K8 C. z  a# |$ i! m
 楼主| 发表于 2021-7-16 14:52:56 | 显示全部楼层
As root, on all iSCSI gateway nodes, enable and start the API service:/ E5 d; C1 q8 A8 l$ A

/ X' A! A6 G0 N  ?systemctl daemon-reload$ F& b+ D  y1 \
5 |# |  y& ~% t( {0 J
systemctl enable rbd-target-gw, F' J, m, V, e2 l% o3 ?
systemctl start rbd-target-gw, ~' D2 `) P& c) q6 E
. ~0 r- a9 Y- ]- o# F! t
systemctl enable rbd-target-api* f, Q7 ]0 d' T0 M" \
systemctl start rbd-target-api
  ]/ R2 c" T3 D0 B% x: K  `Configuring:
9 h3 l# s$ z) z7 J' v% p
$ l; g( L* f7 }0 x& J6 ]gwcli will create and configure the iSCSI target and RBD images and copy the configuration across the gateways setup in the last section. Lower level tools including targetcli and rbd can be used to query the local configuration, but should not be used to modify it. This next section will demonstrate how to create a iSCSI target and export a RBD image as LUN 0.+ O1 B- Q% T" w4 N; I2 U
8 J4 M5 e; s- K: h4 h7 }
As root, on a iSCSI gateway node, start the iSCSI gateway command-line interface:
- H+ q- r" I# r4 F7 C
3 P# x; v8 p- [; c9 A* t' Rgwcli+ n5 ?) p0 W! [& j  N% G
Go to iscsi-targets and create a target with the name iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw:' C( C+ {; w# b- K1 w4 b/ w! g# G
( n. r5 f0 }* h' x
> /> cd /iscsi-target
9 L& ]( F! ~+ h: q# a" d+ z+ a> /iscsi-target>  create iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw
8 r  l. r# ]8 g6 i. BCreate the iSCSI gateways. The IPs used below are the ones that will be used for iSCSI data like READ and WRITE commands. They can be the same IPs used for management operations listed in trusted_ip_list, but it is recommended that different IPs are used.
/ }7 K; K* O5 t0 E0 i9 V' n/ R& g0 t) f
> /iscsi-target> cd iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw/gateways5 g0 k% y1 \) S+ J( b5 I# }9 b" Y0 x- \
> /iscsi-target...-igw/gateways>  create ceph-gw-1 10.172.19.21
1 s9 R% I: V" i. Z. A9 p  o2 c> /iscsi-target...-igw/gateways>  create ceph-gw-2 10.172.19.224 y+ m9 m5 \2 u  H5 `. A
If not using RHEL/CentOS or using an upstream or ceph-iscsi-test kernel, the skipchecks=true argument must be used. This will avoid the Red Hat kernel and rpm checks:1 |4 J% h* T) }

: O  d' a! M/ P5 g5 [' a, A4 M! k> /iscsi-target> cd iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw/gateways. ]* Q$ X- Z* N/ E* Z7 |) @4 B
> /iscsi-target...-igw/gateways>  create ceph-gw-1 10.172.19.21 skipchecks=true: Z0 B1 B8 q$ }7 c5 @- [& o
> /iscsi-target...-igw/gateways>  create ceph-gw-2 10.172.19.22 skipchecks=true/ Q% w  M! {% U
Add a RBD image with the name disk_1 in the pool rbd:" Q+ O( @: X+ ^+ T/ Z& C) Y
* g( Y! \2 g0 a' `' z+ B
> /iscsi-target...-igw/gateways> cd /disks- i7 i* }+ F" L/ r
> /disks> create pool=rbd image=disk_1 size=90G
: e5 C/ O$ [* Q6 l6 r0 Q. XCreate a client with the initiator name iqn.1994-05.com.redhat:rh7-client:/ i+ ^1 E0 J+ K9 `/ B  f
. G- n1 R2 y3 W' g9 l- H* ~% ~
> /disks> cd /iscsi-target/iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw/hosts
5 p9 A' K% `! {/ f> /iscsi-target...eph-igw/hosts>  create iqn.1994-05.com.redhat:rh7-client) C7 p* c4 Q; \7 r3 m( v
Set the client’s CHAP username to myiscsiusername and password to myiscsipassword:( `3 D/ E! N4 d6 X

7 ]) h: q1 {  f> /iscsi-target...at:rh7-client>  auth username=myiscsiusername password=myiscsipassword0 w. l( Z& R( F0 @
Warning' T4 u4 y; ^5 C8 z8 K  s# I

, z' Q9 S' j5 Q/ u( \0 x- O! KCHAP must always be configured. Without CHAP, the target will reject any login requests.
" Z( c. k* s: F
1 `6 j3 T8 Z, y* o' @5 _* a& PAdd the disk to the client:5 N1 N9 z% F4 Z' O; a
7 S1 J5 A. N- n- N5 z0 h6 c7 M3 L1 i( Q
> /iscsi-target...at:rh7-client> disk add rbd/disk_1
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

站长推荐上一条 /4 下一条

如有购买积分卡请联系497906712

QQ|返回首页|Archiver|手机版|小黑屋|易陆发现 点击这里给我发消息

GMT+8, 2021-9-27 03:12 , Processed in 0.417560 second(s), 21 queries .

Powered by LR.LINUX.cloud bbs168x X3.2 Licensed

© 2012-2022 Comsenz Inc.

快速回复 返回顶部 返回列表