radosgw单机多怎么实现
发表于:2026-11-03 作者:千家信息网编辑
千家信息网最后更新 2026年11月03日,本篇内容主要讲解"radosgw单机多怎么实现",感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习"radosgw单机多怎么实现"吧!/etc/init.d/ra
千家信息网最后更新 2026年11月03日radosgw单机多怎么实现
本篇内容主要讲解"radosgw单机多怎么实现",感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习"radosgw单机多怎么实现"吧!
/etc/init.d/radosgw#! /bin/sh### BEGIN INIT INFO# Provides: radosgw# Required-Start: $remote_fs $named $network $time# Required-Stop: $remote_fs $named $network $time# Default-Start: 2 3 4 5# Default-Stop: 0 1 6# Short-Description: radosgw RESTful rados gateway# Description: radosgw RESTful rados gateway### END INIT INFOPATH=/sbin:/bin:/usr/binif [ -x /sbin/start-stop-daemon ]; then DEBIAN=1 . /lib/lsb/init-functionselse . /etc/rc.d/init.d/functions DEBIAN=0 # detect systemd, also check whether the systemd-run binary exists SYSTEMD_RUN=$(which systemd-run 2>/dev/null) grep -qs systemd /proc/1/comm || SYSTEMD_RUN=""fidaemon_is_running() { daemon=$1 if pidof $daemon >/dev/null; then echo "$daemon is running." exit 0 else echo "$daemon is not running." exit 1 fi}VERBOSE=0for opt in $*; do if [ "$opt" = "-v" ] || [ "$opt" = "--verbose" ]; then VERBOSE=1 fidone# prefix for radosgw instances in ceph.confPREFIX='client.radosgw.'# user to run radosgw as (if not specified in ceph.conf)DEFAULT_USER='root'RADOSGW=`which radosgw`if [ ! -x "$RADOSGW" ]; then [ $VERBOSE -eq 1 ] && echo "$RADOSGW could not start, it is not executable." exit 1fi# list daemons, old-style and new-style# NOTE: no support for cluster names that aren't "ceph"dlist=`ceph-conf --list-sections $PREFIX`if [ -d "/var/lib/ceph/radosgw" ]; then for d in `ls /var/lib/ceph/radosgw | grep ^ceph-`; do if [ -e "/var/lib/ceph/radosgw/$d/sysvinit" ]; then id=`echo $d | cut -c 6-` dlist="client.$id $dlist" fi doneficase "$1" in start) for name in $dlist do auto_start=`ceph-conf -n $name 'auto start'` if [ "$auto_start" = "no" ] || [ "$auto_start" = "false" ] || [ "$auto_start" = "0" ]; then continue fi shortname=`echo $name | cut -c 8-` if [ ! -e "/var/lib/ceph/radosgw/ceph-$shortname/sysvinit" ]; then # mapped to this host? host=`ceph-conf -n $name host` hostname=`hostname -s` if [ "$host" != "$hostname" ]; then [ $VERBOSE -eq 1 ] && echo "hostname $hostname could not be found in ceph.conf:[$name], not starting." continue fi fi user=`ceph-conf -n $name user` if [ -z "$user" ]; then user="$DEFAULT_USER" fi log_file=`$RADOSGW -n $name --show-config-value log_file` if [ -n "$log_file" ]; then if [ ! -e "$log_file" ]; then touch "$log_file" fi chown $user $log_file fi echo "Starting $name..." if [ $DEBIAN -eq 1 ]; then start-stop-daemon --start -u $user -x $RADOSGW -p /var/run/ceph/client-$name.pid -- -n $name elif [ -n "$SYSTEMD_RUN" ]; then $SYSTEMD_RUN -r su "$user" -c "ulimit -n 32768; $RADOSGW -n $name" else ulimit -n 32768 daemon --user="$user" "$RADOSGW -n $name" fi done ;; reload) echo "Reloading $name..." if [ $DEBIAN -eq 1 ]; then start-stop-daemon --stop --signal HUP -x $RADOSGW --oknodo else killproc $RADOSGW -SIGHUP fi ;; restart|force-reload) $0 stop $0 start ;; stop) timeout=0 for name in $dlist do t=`$RADOSGW -n $name --show-config-value rgw_exit_timeout_secs` if [ $t -gt $timeout ]; then timeout=$t; fi done if [ $DEBIAN -eq 1 ]; then if [ $timeout -gt 0 ]; then TIMEOUT="-R $timeout"; fi start-stop-daemon --stop -x $RADOSGW -t start-stop-daemon --stop -x $RADOSGW --oknodo $TIMEOUT else killproc $RADOSGW while pidof $RADOSGW >/dev/null && [ $timeout -gt 0 ] ; do sleep 1 timeout=$(($timeout - 1)) done fi ;; status) daemon_is_running $RADOSGW ;; *) echo "Usage: $0 {start|stop|restart|force-reload|reload|status} [-v|--verbose]" >&2 exit 3 ;;esac默认的启动脚本是以hostname为判断变量,我这里跳过了这个步骤。
使用流程
新建ceph auth新建radosgw用户
添加用户keyring
在ceph.conf里面添加radosgw服务配置信息
使用脚本启动服务
到此,相信大家对"radosgw单机多怎么实现"有了更深的了解,不妨来实际操作一番吧!这里是网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!
单机
内容
用户
脚本
学习
服务
实用
更深
信息
兴趣
变量
实用性
实际
操作简单
方法
更多
朋友
服务配置
步骤
流程
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
手冲咖啡和咖啡机区别
盈实互联网科技
美国互联网科技巨头监管
北京互联网科技有限公司
无线互联网科技
伴你行互联网科技有限公司
互联网科技的未来发展
互联网科技公司做什么
镁科技互联网资讯平台
互联网公司会议桌创意科技软装饰
互联网科技公司需要的职位
科技与互联网哪个更好
南山科技园互联网公司有哪些
智腾互联网科技有限公司
移动互联网年度科技创新
互联网科技人工智能实验室
昆明中奇联合互联网科技
山东蛋芒互联网科技有限公司
东风日产互联网科技公司叫什么
科技发展第三阶段互联网时代
互联网科技海报
麻工互联网科技
互联网科技公司发展
速维有品互联网信息科技(苏州)有限公司
广州市恰铎互联网科技有限公司
广西互联网科技孵化中心
中国互联网十大科技股排名
美国互联网科技实力
中国互联网公司的科技投入
科技互联网专业工作会议发言稿