463

Centos8编译安装Beanstalkd

安装编译工具

yum instlal make gcc

下载Beanstalkd源码并编译安装

进入/tmp目录,然后执行下载命令

wget https://github.com/beanstalkd/beanstalkd/archive/v1.12.zip

解压下载的文件

unzip v1.12.zip

进入beanstalkd-1.12目录后再执行编译安装命令

make && make install

创建Beanstalkd配置文件

vi /etc/beanstalkd

写入以下内容

ADDR=-l 127.0.0.1
PORT=-p 11300
USER=-u root

# Job size is left to the default. Uncomment and set it
# to a value to have it take affect.
#MAX_JOB_SIZE=-z 65535
MAX_JOB_SIZE=-z 524280

# Using the binlog is off by default.
#
# The direcory to house the binlog.
BINLOG_DIR=-b /var/lib/beanstalkd/binlog
#
# fsync the binlog at most once every N milliseconds.
# setting this to 0 means 'always fsync'. If this is unset,
# and the binlog is used, then no explicit fsync is ever
# performed.  That is, the -F option is used.
#BINLOG_FSYNC_PERIOD=-f some-value
#
# The size of each binlog file.  This is rounded
# up to the nearest 512 byte boundary.
BINLOG_SIZE=-s 10485760

创建binlog目录

mkdir /var/lib/beanstalkd
mkdir /var/lib/beanstalkd/binlog

创建Beanstalkd启动文件

vi /usr/lib/systemd/system/beanstalkd.service

写入以下内容

[Unit]
Description=Beanstalkd Fast Workqueue Service
After=network.target

[Service]
User=root
Type=simple
EnvironmentFile=-/etc/beanstalkd
ExecStart=/usr/local/bin/beanstalkd $ADDR $PORT $USER $MAX_JOB_SIZE $BINLOG_DIR $BINLOG_SIZE $BINLOG_FSYNC_PERIOD
Restart=always

[Install]
WantedBy=multi-user.target

更新服务文件

systemctl daemon-reload

启动Beanstalkd

systemctl start beanstalkd
文章作者:DOTATONG
发布日期:2023-03-08

评论

暂无

添加新评论