Bug 1503034 - [DOCS] The default port is wrong in our ragosgw guide
Summary: [DOCS] The default port is wrong in our ragosgw guide
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Ceph Storage
Classification: Red Hat Storage
Component: Documentation
Version: 3.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: z1
: 3.2
Assignee: John Brier
QA Contact: Tejas
Bara Ancincova
URL:
Whiteboard:
: 1614552 1625723 (view as bug list)
Depends On:
Blocks: 1668330
TreeView+ depends on / blocked
 
Reported: 2017-10-17 08:53 UTC by liuwei
Modified: 2019-07-09 08:32 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-07-09 08:32:44 UTC
Embargoed:


Attachments (Terms of Use)

Description liuwei 2017-10-17 08:53:49 UTC
Description of problem:

In latest rgw version,  if we deploy the rgw with ceph-ansible tools.  The Civetweb default port is 8080, not 7480. 

So, I think we need to review all related rgw docs and modify it. 

For example:

https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/developer_guide/ceph-object-gateway-s3-api#s3-authentication

2.2.1. Prerequisites

DO NOT modify the Ceph configuration file to use port 80 and let Civetweb use the default port 7480  << here

https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/object_gateway_guide_for_red_hat_enterprise_linux/configuration#changing_your_default_port

2.1. Changing Your Default Port

Civetweb runs on port 7480 by default. << here


https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/object_gateway_guide_for_ubuntu/configuration

2.1. Changing Your Default Port

Civetweb runs on port 7480 by default << here


https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/ceph_object_gateway_for_production/configuring_gateways#configuring_civetweb

6.1. Configuring Civetweb

The most common configuration change from the default configuration is changing the default port 7480 to another port such as 8080 or 80


Version-Release number of selected component (if applicable):

grep 8080 /usr/share/ceph-ansible/* -n -R
/usr/share/ceph-ansible/group_vars/all.yml.sample:296:#radosgw_civetweb_port: 8080
/usr/share/ceph-ansible/group_vars/all.yml:296:#radosgw_civetweb_port: 8080
/usr/share/ceph-ansible/roles/ceph-common/defaults/main.yml:288:radosgw_civetweb_port: 8080
/usr/share/ceph-ansible/roles/ceph.ceph-common/defaults/main.yml:288:radosgw_civetweb_port: 8080
[root@admin ~]# rpm -qa | grep ceph-ansible
ceph-ansible-2.2.11-1.el7scon.noarch

 rpm -qa | grep ceph
ceph-installer-1.3.0-1.el7scon.noarch
rhscon-ceph-0.0.43-1.el7scon.x86_64
python-cephfs-10.2.7-32.el7cp.x86_64
ceph-ansible-2.2.11-1.el7scon.noarch
libcephfs1-10.2.7-32.el7cp.x86_64
ceph-iscsi-ansible-1.5-5.el7scon.noarch
ceph-common-10.2.7-32.el7cp.x86_64


How reproducible:

100%reproduced

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 5 John Wilkins 2018-03-15 20:26:42 UTC
This isn't a documentation problem per se. The default port for Civetweb is 7480, but perhaps in ceph-ansible it is 8080. That is an inconsistency in the code. The documentation should be consistent with the code. So the bug should be filed against ceph-ansible, not against Ceph docs.

Comment 6 John Brier 2018-08-10 21:00:12 UTC
I ran into this issue while using section "2.6. Testing the Object Gateway" in the "Object Gateway Guide for Red Hat Enterprise Linux."

https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/3/html-single/object_gateway_guide_for_red_hat_enterprise_linux/#testing_the_object_gateway

Under section "2.6.3. Testing S3 Access," when creating the s3test.py script it says "Replace {port} with the port number of the gateway." 

I wasn't sure what the port was so looking around further in the document I found "2.1. Changing Your Default Port" where it says "Civetweb runs on port 7480 by default."

So I set the port in s3test.py to 7480 and the script failed with the folowing:

[root@jb-rhel-rgw ~]$ python s3test.py 
Traceback (most recent call last):
  File "s3test.py", line 19, in <module>
    bucket = conn.create_bucket('jb-new-bucket')
  File "/usr/lib/python2.7/site-packages/boto/s3/connection.py", line 612, in create_bucket
    data=data)
  File "/usr/lib/python2.7/site-packages/boto/s3/connection.py", line 664, in make_request
    retry_handler=retry_handler
  File "/usr/lib/python2.7/site-packages/boto/connection.py", line 1068, in make_request
    retry_handler=retry_handler)
  File "/usr/lib/python2.7/site-packages/boto/connection.py", line 927, in _mexe
    request.authorize(connection=self)
  File "/usr/lib/python2.7/site-packages/boto/connection.py", line 377, in authorize
    connection._auth_handler.add_auth(self, **kwargs)
  File "/usr/lib/python2.7/site-packages/boto/auth.py", line 709, in add_auth
    **kwargs)
  File "/usr/lib/python2.7/site-packages/boto/auth.py", line 526, in add_auth
    canonical_request = self.canonical_request(req)
  File "/usr/lib/python2.7/site-packages/boto/auth.py", line 402, in canonical_request
    cr.append(self.canonical_headers(headers_to_sign) + '\n')
  File "/usr/lib/python2.7/site-packages/boto/auth.py", line 363, in canonical_headers
    if '"' in raw_value:
TypeError: argument of type 'int' is not iterable


but netstat shows it's using 8080:

netstat -tulnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 192.168.122.199:8080    0.0.0.0:*               LISTEN      1421/radosgw

So I updated the s3test.py script to use port 8080 and it started working.

Just like it says in the original report, 8080 is coming from ansible:

[admin@jb-rhel-admin ceph-ansible]$ grep 8080 /usr/share/ceph-ansible/* -n -R
/usr/share/ceph-ansible/group_vars/all.yml.sample:349:#radosgw_civetweb_port: 8080
/usr/share/ceph-ansible/group_vars/rhcs.yml.sample:349:#radosgw_civetweb_port: 8080
/usr/share/ceph-ansible/group_vars/all.yml:349:#radosgw_civetweb_port: 8080
[admin@jb-rhel-admin ceph-ansible]$ rpm -qa | grep ceph
ceph-ansible-3.0.33-1.el7cp.noarch

However John Wilkins shows that Ceph itself is supposed to be using 7480 for Civetweb:

<jowilkin> no. We have it embedded with our own daemons. our settings from upstream are in ceph/src/common/options.cc. 
<jowilkin>     Option("rgw_frontends", Option::TYPE_STR, Option::LEVEL_BASIC)
<jowilkin>     .set_default("civetweb port=7480")
<jowilkin>     .set_description("RGW frontends configuration")
<jowilkin>     .set_long_description(
<jowilkin>         "A comma delimited list of frontends configuration. Each configuration contains "
<jowilkin>         "the type of the frontend followed by an optional space delimited set of "
<jowilkin>         "key=value config parameters."),
<jowilkin> So we default to 7480, as shown in the code above from src/common/options.cc

<jowilkin> jbrier: They did it, because some deployments were using Apache, and would conflict with port 80 or 8080 if that's what they had set for Apache.

I wasn't able to verify that Ceph uses 7480 by default though. I tested this by removing the 8080 port setting in /etc/ceph/ceph.conf:

rgw frontends = civetweb num_threads=100
#rgw frontends = civetweb port=192.168.122.199:8080 num_threads=100

[root@jb-rhel-rgw ~]$ systemctl restart ceph-radosgw.service
[root@jb-rhel-rgw ~]$ netstat -tulnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1804/radosgw 

As you can see it is using port 80. 

In several places in the docs though it says the port is 7480. As I just showed, I can't see that even if I remove the setting to explicitly use port 8080. So something needs to change as this situation is confusing.

Other places in the docs where it says 7480:

== Ceph Object Gateway for Production ==
6.1. Configuring Civetweb

"The most common configuration change from the default configuration is changing the default port 7480 to another port such as 8080 or 80. See Changing the Default Port."

https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/3/html-single/ceph_object_gateway_for_production/#configuring_gateways


== Installation Guide for Red Hat Enterprise Linux ==

2.8. Configuring a Firewall for Red Hat Ceph Storage (optional)

"The Ceph Object Gateway nodes use port 7480 by default. However, you can change the default port, for example to port 80. "

6. On all Ceph Object Gateway nodes, open the relevant port or ports on the public network.

    To open the default port 7480: 
[root@gateway ~]# firewall-cmd --zone=public --add-port=7480/tcp
[root@gateway ~]# firewall-cmd --zone=public --add-port=7480/tcp --permanent
etc.

https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/3/html-single/installation_guide_for_red_hat_enterprise_linux/#configuring-a-firewall-for-red-hat-ceph-storage


3.5. Installing the Ceph Object Gateway

"The rgws.yml file may specify a different default port than the default port 7480. For example: "

https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/3/html-single/installation_guide_for_red_hat_enterprise_linux/#installing-the-ceph-object-gateway


*** Similar references to 7480 are in the Installation Guide for Ubuntu


== Container Guide ==
The container guide is different. We already changed a reference to port 7480 to 8080 as requested in this BZ/comment:
Bug 1514396 Comment 15
https://bugzilla.redhat.com/show_bug.cgi?id=1514396#c15

1.3. Installing the Ceph Object Gateway in a Container
7.iii

" From any client on the same network as the Ceph cluster, for example the Monitor node, use the curl command to send an HTTP request on port 8080 using the IP address of the Ceph Object Gateway host:

curl http://<ip-address>:8080

https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/3/html-single/container_guide/#installing-the-ceph-object-gateway-in-a-container

In my opinion we should just change the 7480 references to 8080 as we are already leaning toward that based on the change we made to the Container Guide, though I see the argument we should be consistent between the C/C++ code, Ansible playbooks, and the docs.

Comment 7 John Brier 2018-08-14 21:02:41 UTC
Ken Dreyer, what do you think we should do with this? Seems we should either change Ansible to not muck the port from default Civetweb port of 7480, or we should update the docs to say the port to use is 8080. IIUC, the only issue with the latter option is if people don't use Ansible and install Ceph manually RGW will use port 8080 (or 80?) and then docs will be confusing.

Comment 17 John Brier 2019-01-21 17:09:01 UTC
*** Bug 1614552 has been marked as a duplicate of this bug. ***

Comment 22 John Brier 2019-01-30 19:37:45 UTC
*** Bug 1625723 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.