Blog Nodeloc

记录一些NodeLoc发展中遇到的问题及解决方法

Debian 12 安装 Redis 和 MariaDB 和 MeiliSearch


安装 Redis

apt install redis

安装 MariaDB

apt install mariadb-server -y

安装设置

mariadb-secure-installation

安装MeiliSearch

curl -L https://install.meilisearch.com | sh
chmod +x meilisearch
mv ./meilisearch /usr/local/bin/

创建用户

useradd -d /var/lib/meilisearch -b /bin/false -m -r meilisearch

配置文件

curl https://raw.githubusercontent.com/meilisearch/meilisearch/latest/config.toml > /etc/meilisearch.toml

修改以下配置

env = "production"
master_key = "YOUR_MASTER_KEY_VALUE"
db_path = "/var/lib/meilisearch/data"
dump_dir = "/var/lib/meilisearch/dumps"
snapshot_dir = "/var/lib/meilisearch/snapshots"

增加相应目录

mkdir /var/lib/meilisearch/data /var/lib/meilisearch/dumps /var/lib/meilisearch/snapshots
chown -R meilisearch:meilisearch /var/lib/meilisearch
chmod 750 /var/lib/meilisearch

创建服务

cat << EOF > /etc/systemd/system/meilisearch.service
[Unit]
Description=Meilisearch
After=systemd-user-sessions.service
[Service]
Type=simple
WorkingDirectory=/var/lib/meilisearch
ExecStart=/usr/local/bin/meilisearch --config-file-path /etc/meilisearch.toml
User=meilisearch
Group=meilisearch
[Install]
WantedBy=multi-user.target
EOF

开机启动

systemctl enable meilisearch
systemctl start meilisearch

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注