[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 here gateway_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 bear 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
最后一行的trusted_ip_list修改为用来配置网关的主机IP,我的环境为
trusted_ip_list =192.168.219.128,192.168.219.129
所有网关节点的这个配置文件的内容需要一致,修改好一台直接scp到每个网关节点上
启动API服务
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
[root@lab101 install]# systemctl daemon-reload [root@lab101 install]# systemctl enable rbd-target-api [root@lab101 install]# systemctl start rbd-target-api [root@lab101 install]# systemctl status rbd-target-api ● rbd-target-api.service - Ceph iscsi target configuration API Loaded: loaded (/usr/lib/systemd/system/rbd-target-api.service; enabled; vendor preset: disabled) Active: active (running) since Thu 2018-03-15 09:44:34 CST; 18min ago Main PID: 1493 (rbd-target-api) CGroup: /system.slice/rbd-target-api.service └─1493 /usr/bin/python /usr/bin/rbd-target-api
Mar 15 09:44:34 lab101 systemd[1]: Started Ceph iscsi target configuration API. Mar 15 09:44:34 lab101 systemd[1]: Starting Ceph iscsi target configuration API... Mar 15 09:44:58 lab101 rbd-target-api[1493]: Started the configuration object watcher Mar 15 09:44:58 lab101 rbd-target-api[1493]: Checking for config object changes every 1s Mar 15 09:44:58 lab101 rbd-target-api[1493]: * Running on http://0.0.0.0:5000/
配置iscsi 执行gwcli命令
默认是这样的
进入icsi-target创建一个target
1 2 3
/> cd iscsi-target /iscsi-target> create iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw ok
Client authentication can be set to use CHAP by supplying the a string of the form <username>/<password>
e.g. auth chap=username/password | nochap
username ... the username is 8-64 character string. Each character may either be an alphanumeric or use one of the following special characters .,:,-,@. Consider using the hosts 'shortname' or the initiators IQN value as the username
password ... the password must be between 12-16 chars in length containing alphanumeric characters, plus the following special characters @,_,-
WARNING: Using unsupported special characters may result in truncation, resulting in failed logins.
Specifying 'nochap' will remove chap authentication for the client across all gateways.
增加磁盘到客户端
1 2
/iscsi-target...t:75c3d5efde0> disk add rbd.disk_1 ok
到这里就配置完成了,我们看下最终应该是怎么样的
windows客户端配置
这个地方我配置的时候用的win10配置的时候出现了无法连接的情况,可能是windows10自身的认证要求跟服务端冲突了,这里用windows server 2016 进行连接测试