CentOS8 memcachedをインストールする

環境
OSバージョンを確認します
# cat /etc/redhat-release
CentOS Stream release 8

操作方法
1.memcachedをインストールします
# sudo dnf install memcached libmemcached

2.memcachedのインストール詳細情報を確認します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# rpm -qi memcached
Name : memcached
Epoch : 0
Version : 1.5.22
Release : 2.el8
Architecture: x86_64
Install Date: 20221113125353
Group : System Environment/Daemons
Size : 414767
License : BSD
Signature : RSA/SHA256, 20200618025720秒, Key ID 05b555b38483c65d
Source RPM : memcached-1.5.22-2.el8.src.rpm
Build Date : 20200618021921
Build Host : x86-02.mbox.centos.org
Relocations : (not relocatable)
Packager : CentOS Buildsys <bugs@centos.org>
Vendor : CentOS
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.
# rpm -qi memcached Name : memcached Epoch : 0 Version : 1.5.22 Release : 2.el8 Architecture: x86_64 Install Date: 2022年11月13日 12時53分53秒 Group : System Environment/Daemons Size : 414767 License : BSD Signature : RSA/SHA256, 2020年06月18日 02時57分20秒, Key ID 05b555b38483c65d Source RPM : memcached-1.5.22-2.el8.src.rpm Build Date : 2020年06月18日 02時19分21秒 Build Host : x86-02.mbox.centos.org Relocations : (not relocatable) Packager : CentOS Buildsys <bugs@centos.org> Vendor : CentOS 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.
# rpm -qi memcached
Name        : memcached
Epoch       : 0
Version     : 1.5.22
Release     : 2.el8
Architecture: x86_64
Install Date: 2022年11月13日 12時53分53秒
Group       : System Environment/Daemons
Size        : 414767
License     : BSD
Signature   : RSA/SHA256, 2020年06月18日 02時57分20秒, Key ID 05b555b38483c65d
Source RPM  : memcached-1.5.22-2.el8.src.rpm
Build Date  : 2020年06月18日 02時19分21秒
Build Host  : x86-02.mbox.centos.org
Relocations : (not relocatable)
Packager    : CentOS Buildsys <bugs@centos.org>
Vendor      : CentOS
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.

4.memcached設定を変更します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# sudo nano /etc/sysconfig/memcached
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="64"
OPTIONS="-l 127.0.0.1,::1"
# sudo nano /etc/sysconfig/memcached PORT="11211" USER="memcached" MAXCONN="1024" CACHESIZE="64" OPTIONS="-l 127.0.0.1,::1"
# sudo nano /etc/sysconfig/memcached
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="64"
OPTIONS="-l 127.0.0.1,::1"

説明
PORT ポート
USER プロセス名
MAXCONN 最大接続数
memcachedを再起動します
# sudo systemctl restart memcached

5.memcachedを起動します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# sudo systemctl start memcached
# sudo systemctl start memcached
# sudo systemctl start memcached

自動起動を設定します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# sudo systemctl enable memcached
# sudo systemctl enable memcached
# sudo systemctl enable memcached

ステータスを確認します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# sudo systemctl status memcached
● memcached.service - memcached daemon
Loaded: loaded (/usr/lib/systemd/system/memcached.service; disabled; vendor preset: disabled)
Active: active (running) since Sun 2022-11-13 13:01:16 JST; 48s ago
# sudo systemctl status memcached ● memcached.service - memcached daemon Loaded: loaded (/usr/lib/systemd/system/memcached.service; disabled; vendor preset: disabled) Active: active (running) since Sun 2022-11-13 13:01:16 JST; 48s ago
# sudo systemctl status memcached
● memcached.service - memcached daemon
   Loaded: loaded (/usr/lib/systemd/system/memcached.service; disabled; vendor preset: disabled)
   Active: active (running) since Sun 2022-11-13 13:01:16 JST; 48s ago

 

CentOS Stream 8

Posted by arkgame