AlmaLinux8.4にmemcachedをインストールする方法

1.OSバージョンの確認

# cat /etc/redhat-release
AlmaLinux release 8.4 (Electric Cheetah)

2.libmemcachedモジュールをインストール

# sudo dnf install libmemcached
略
インストール済み:
libmemcached-1.0.18-15.el8.x86_64 libmemcached-libs-1.0.18-15.el8.x86_64

3.memcachedをインストール
# sudo dnf install memcached

4.memcached詳細情報を確認
# rpm -qi memcached

Name        : memcached
Epoch       : 0
Version     : 1.5.22
Release     : 2.el8
Architecture: x86_64
Install Date: 2021年10月03日 12時25分13秒
Group       : System Environment/Daemons
Size        : 414839
License     : BSD
Signature   : RSA/SHA256, 2021年01月14日 19時02分51秒, Key ID 51d6647ec21ad6ea
Source RPM  : memcached-1.5.22-2.el8.src.rpm
Build Date  : 2020年08月31日 01時57分34秒
Build Host  : build.cloudlinux.com
Relocations : (not relocatable)
Packager    : CloudLinux Packaging Team <packager@cloudlinux.com>
Vendor      : CloudLinux
URL         : https://www.memcached.org/
Summary     : High Performance, Distributed Memory Object Cache
Description :
memcached is a high-performance, distributed memory object caching
system, generic in nature, but intended for use in speeding up dynamic
web applications by alleviating database load.

5.memcachedを設定

# sudo vim /etc/sysconfig/memcached
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="64"
OPTIONS="-l 127.0.0.1,::1"
修正前
127.0.0.1
修正後
172.17.2.xxx

memcached を再起動
# sudo systemctl restart memcached

6.ファイアウォールを設定

# sudo firewall-cmd --add-port=11211/tcp --zone=public --permanent
success
# sudo firewall-cmd --reload
success

7.memcachedを起動
起動
# sudo systemctl start memcached
自動起動

# sudo systemctl enable memcached
Created symlink /etc/systemd/system/multi-user.target.wants/memcached.service → /usr/lib/systemd/system/memcached.service.

状態の確認
# sudo systemctl status memcached

● memcached.service - memcached daemon
   Loaded: loaded (/usr/lib/systemd/system/memcached.service; enabled; vendor p>
   Active: active (running) since Sun 2021-10-03 12:43:43 JST; 1min 52s ago
 Main PID: 10127 (memcached)
    Tasks: 10 (limit: 11074)
   Memory: 2.0M
   CGroup: /system.slice/memcached.service
           mq10127 /usr/bin/memcached -p 11211 -u memcached -m 64 -c 1024 -l 12>

 

AlmaLinux

Posted by arkgame