千家信息网

radosgw的civetweb配置与排错方法

发表于:2025-02-01 作者:千家信息网编辑
千家信息网最后更新 2025年02月01日,这篇文章主要讲解了"radosgw的civetweb配置与排错方法",文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习"radosgw的civetweb配置与
千家信息网最后更新 2025年02月01日radosgw的civetweb配置与排错方法

这篇文章主要讲解了"radosgw的civetweb配置与排错方法",文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习"radosgw的civetweb配置与排错方法"吧!

在64bit debian8 下面使用的仍然是sysinit,运行ceph-deploy rgw create 新建rgw的时候,提示rgw服务无法启动,排查如下:

  1. 检查ceph auth配置

      root@demo:/etc/ceph# ceph auth list        ......        client.rgw.demo # 使用ceph-deploy rgw create的时候自动生成                key: AQB0NPlVEkpPExAAaOAkz+X6fB9sJaMdR+Bq4Q==                caps: [mon] allow rw                caps: [osd] allow rwx


    ceph auth已经生成了一个client.rgw.demo的用户,同时在/etc/ceph下面也生成了对于的keyring(没有,请手工添加)

         cat /etc/ceph/ceph.client.radosgw.demo.keyring        [client.rgw.demo]                key = AQB0NPlVEkpPExAAaOAkz+X6fB9sJaMdR+Bq4Q==


  2. 检查ceph.conf配置

        cat /etc/ceph/ceph.conf        [client.rgw.demo] #重点是这个sections        host = demo        keyring = /etc/ceph/ceph.client.radosgw.demo.keyring        rgw_frontends = civetweb port=80        rgw socket path = /var/run/ceph/ceph-client.rgw.demo.asok #这个socket文件关联服务运行状态        log file = /var/log/radosgw/client.radosgw.demo.log        rgw print continue = false        rgw enable ops log = false        rgw ops log rados = false        rgw ops log data bakclog = 4096


  3. 手工启动服务成功 手工启动命令,注意-n为ceph auth里面的用户名

            手工启动        radosgw  -n client.rgw.demo        检查端口及进程        netstat -talnp|grep rados        tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      6601/radosgw        tcp        0      0 10.0.2.15:58613         10.0.2.15:6789          ESTABLISHED 6601/radosgw        tcp        0      0 10.0.2.15:55465         10.0.2.15:6800          ESTABLISHED 6601/radosgw        tcp        0      0 10.0.2.15:51986         10.0.2.15:6804          ESTABLISHED 6601/radosgw        tcp        0      0 10.0.2.15:51098         10.0.2.15:6808          ESTABLISHED 6601/radosgw        ps aux|grep rados        root      6601  0.5  1.5 2165088 15692 ?       Ssl  11:11   0:00 radosgw -n client.rgw.demo


  4. init脚本启动与排错

           /etc/init.d/radosgw start        /usr/bin/radosgw is not running.


    启动失败,启动debug模式再来

       sh -x /etc/init.d/radosgw start        + PATH=/sbin:/bin:/usr/bin        + . /lib/lsb/init-functions        + run-parts --lsbsysinit --list /lib/lsb/init-functions.d        + [ -r /lib/lsb/init-functions.d/20-left-info-blocks ]        + . /lib/lsb/init-functions.d/20-left-info-blocks        + [ -r /lib/lsb/init-functions.d/40-systemd ]        + . /lib/lsb/init-functions.d/40-systemd        + _use_systemctl=0        + [ -d /run/systemd/system ]        + [ 0 = 1 ]        + FANCYTTY=        + [ -e /etc/lsb-base-logging.sh ]        + true        + VERBOSE=0        + [ start = -v ]        + [ start = --verbose ]        + PREFIX=client.radosgw.        + DEFAULT_USER=root        + which radosgw        + RADOSGW=/usr/bin/radosgw        + [ ! -x /usr/bin/radosgw ]        + ceph-conf --list-sections client.radosgw.        + daemon_is_running /usr/bin/radosgw        + daemon=/usr/bin/radosgw        + pidof /usr/bin/radosgw        + echo /usr/bin/radosgw is not running.        /usr/bin/radosgw is not running.        + exit 1


    重点就是ceph-conf --list-sections client.radosgw.,这里对ceph.conf配置文件的sections做了简单的检查,只认client.radosgw,而我们的ceph.conf里面写的是client.rgw,手工运行命令确认一下我们的判断

           ceph-conf --list-sections client.radosgw.        无返回        ceph-conf --list-sections client.rgw.        client.rgw.demo


  5. 解决问题

    我这里用方法1

            修改/etc/init.d/radosgw        # prefix for radosgw instances in ceph.conf        #PREFIX='client.radosgw.'        PREFIX='client.rgw.'        测试        /etc/init.d/radosgw start        Starting client.rgw.demo...        /usr/bin/radosgw is running.        ps -axu|grep radosgw        root      7045  1.7  1.5 2165080 15696 ?       Ssl  11:30   0:00 /usr/bin/radosgw -n client.rgw.demo        netstat -tuanlp|grep rados        tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      7045/radosgw        tcp        0      0 10.0.2.15:58617         10.0.2.15:6789          ESTABLISHED 7045/radosgw        tcp        0      0 10.0.2.15:51990         10.0.2.15:6804          ESTABLISHED 7045/radosgw        tcp        0      0 10.0.2.15:55469         10.0.2.15:6800          ESTABLISHED 7045/radosgw        tcp        0      0 10.0.2.15:51102         10.0.2.15:6808          ESTABLISHED 7045/radosgw


    • 方法1 修改启动脚本

    • 方法2 修改ceph.conf的sections为client.radosgw.xxxx,同时ceph auth里面的用户也要改

感谢各位的阅读,以上就是"radosgw的civetweb配置与排错方法"的内容了,经过本文的学习后,相信大家对radosgw的civetweb配置与排错方法这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是,小编将为大家推送更多相关知识点的文章,欢迎关注!

0