Install beanstalkd in CentOS

Source: Internet
Author: User
The beanstalkd service beanstalkd is installed in CentOS without the default installation package. you need to manually compile and install it. The latest version is 1.6. However, after version 1.5, the libevent dependency is canceled, but it cannot be started directly as the daemon process. 1.4.6 can still be started with the parameter-d...
The beanstalkd service beanstalkd is installed in CentOS without the default installation package. you need to manually compile and install it. The latest version is 1.6. However, after version 1.5, the libevent dependency is canceled, however, you cannot start the daemon process directly. you can use the-d parameter to start the daemon process in 1.4.6. Therefore, compile 1.4.6. The startup script is not provided by default after installation, but can be installed using yum in fedora./etc/init is generated after installation. d/beanstalkd startup script. Therefore, livecd is specially used to start fedora17 in the virtual machine. after installation, the beanstalkd startup script is dug out. Switch to the root user: yum install libevent-devel www.2cto.com for all versions: https://github.com/kr/beanstalkd/downloads : Wget http://cloud.github.com/downloads/kr/beanstalkd/beanstalkd-1.4.6.tar.gz Unzip: tar xzf beanstalkd-1.4.6.tar.gz cd beanstalkd-1.4.6. /configure make install default installation path:/usr/local/bin/View version:/usr/local/bin/beanstalkd-v www.2cto.com 1.4.6 add User group: groupadd beanstalkd add User: adduser-M-g beanstalkd-s/sbin/nologin beanstalkd add the startup script and put it in/etc/init. d/chmod 755/etc/init. d/beanstalkd add boot start: www.2cto.com chkconfig beanstalkd on start: service beanstalkd start has been installed. attachment: Dug from Fedora Startup script: 001 #! /Bin/sh002 #003 # beanstalkd-a simple, fast workqueue service004 www.2cto.com #005 # chkconfig:-57 47006 # description: a simple, fast workqueue service007 # processname: beanstalkd008 # config: /etc/sysconfig/beanstalkd009 #010 011 ### begin init INFO012 # Provides: beanstalkd013 # Required-Start: $ local_fs $ network $ remote_fs014 # Required-Stop: $ local_fs $ network $ remote_fs015 # Default-Stop: 0 1 2 601 6 # Short-Description: start and stop beanstalkd017 # Description: a simple, fast work-queue service018 ### end init INFO019 020 # Source function library=21./etc/rc. d/init. d/functions022 www.2cto.com 023 # Source networking configuration24./etc/sysconfig/network025 026 # Check that networking is upgrade27 ["$ NETWORKING" = "no"] & exit028exec = "/usr/ local/bin/beanstalkd "029 prog =$ (basename $ exec) 030 0 31 # default options, overruled by items in container = 127.0.0.1033BEANSTALKD _ PORT = 11300034BEANSTALKD_USER = beanstalkd035 036 [-e/etc/sysconfig/beanstalkd] & amp; /etc/sysconfig/beanstalkd037 www.2cto.com 038 lockfile =/var/lock/subsys/beanstalkd039 040 start () {041 [-x $ exec] | exit 5042 echo-n $ "Starting $ prog:" 043 # if not running, start it up here, usually something like "daem On $ exec "044 options ="-l $ {BEANSTALKD_ADDR}-p $ {BEANSTALKD_PORT}-u $ {BEANSTALKD_USER} "045 if [" $ {BEANSTALKD_MAX_JOB_SIZE }"! = ""]; Then046 options = "$ {options}-z $ {BEANSTALKD_MAX_JOB_SIZE}" 047 fi048 049 if ["$ {BEANSTALKD_BINLOG_DIR }"! = ""]; Then050 www.2cto.com if [! -D "$ {region}"]; then051 echo "Creating binlog directory ($ {region})" 052 mkdir-p $ {BEANSTALKD_BINLOG_DIR} & chown $ {BEANSTALKD_USER }: $ {BEANSTALKD_USER }$ {BEANSTALKD_BINLOG_DIR} 053 fi054 options = "$ {options}-B $ {BEANSTALKD_BINLOG_DIR}" 055 if ["$ {users }"! = ""]; Then056 options = "$ {options}-f $ {answer}" 057 else058 options = "$ {options}-F" 059 fi060 if ["$ {BEANSTALKD_BINLOG_SIZE }"! = ""]; Then061 options = "$ {options}-s $ {BEANSTALKD_BINLOG_SIZE}" 062 fi063 fi064 065 daemon $ exec-d $ options066 www.2cto.com retval = $? 067 echo068 [$ retval-eq 0] & touch $ lockfile069 return $ retval070} 071 072 stop () {073 echo-n $ "Stopping $ prog: "074 # stop it here, often" killproc $ prog "075 killproc $ prog-INT076 retval =$? 077 www.2cto.com echo078 [$ retval-eq 0] & rm-f $ lockfile079 return $ retval080} 081 082 restart () {083 stop084 start085} 086 087 reload () {088 restart089} 090 091force_reload () {092 www.2cto.com restart093} 094 095rh_status () {096 # run checks to determine if the service is running or use generic status097 status $ pro000098} 099 100rh_status_q () {101 rh_status>/dev/null 2> & 1102} 103 104 case "$1" in1 06 www.2cto.com start) 107 rh_status_q & exit 0108 $1109; 110 stop) 111 rh_status_q | exit 0112 $1113; 114 restart) 115 $1116; 117 reload) 118 rh_status_q | exit 7119 www.2cto.com $1120; 121 force-reload) 122 force_reload123; 124 status) 125 rh_status126; 127 condrestart | try-restart) 128 rh_status_q | exit 0129 restart130 www.2cto.com; 131 *) 132 echo $ "Usage: $0 {start | stop | status | restart | cond Restart | try-restart | reload | force-reload} "133 exit when 4esac135exit $?
 
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.