2024年3月

1)High disk watermark exceeded even when there is not much data in my index

# 解决方法一
curl -XPUT "http://localhost:9200/_cluster/settings" \
 -H 'Content-Type: application/json' -d'
{
  "persistent": {
    "cluster": {
      "routing": {
        "allocation.disk.threshold_enabled": false
      }
    }
  }
}'
 
# 解决方法二
curl -X PUT "localhost:9200/_cluster/settings" -H 'Content-Type: application/json' -d'
{
  "transient": {
    "cluster.routing.allocation.disk.watermark.low": "2gb",
    "cluster.routing.allocation.disk.watermark.high": "1gb",
    "cluster.routing.allocation.disk.watermark.flood_stage": "500mb",
    "cluster.info.update.interval": "1m"
  }
}

yum update -y
yum install -y java-1.8.0-openjdk.x86_64 java-1.8.0-openjdk-devel.x86_64 \
    lrzsz lsof net-tools bind-utils iputils traceroute telnet curl wget vim \
    gzip tar zip unzip git htop perf gcc gcc-c++ openssl openssl-devel patch tree \
    tcpdump iftop iotop sysstat nethogs

修改/etc/resolv.conf

chattr -i /etc/resolv.conf
sed -i '1i nameserver 8.8.8.8' /etc/resolv.conf
chattr +i /etc/resolv.conf

修改/etc/security/limits.conf

cat >>/etc/security/limits.conf<<EOF

root soft nofile 100001
root hard nofile 100002
* soft nofile 100001
* hard nofile 100002
* soft memlock unlimited
* hard memlock unlimited
EOF

修改/etc/sysctl.conf

sysctl -p

安装命令

sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io
sudo systemctl start docker
sudo systemctl enable docker

设置registry-mirrors

vim /etc/docker/daemon.json,添加以下内容:

{
    "registry-mirrors": [
        "https://xxx.mirror.xxx.com"
    ]
}

重启服务

sudo systemctl daemon-reload
sudo systemctl restart docker

gitlab配置文件:/etc/gitlab/gitlab.rb

启动服务 sudo gitlab-ctl start
停止服务 sudo gitlab-ctl stop
重启服务 sudo gitlab-ctl restart

修改配置后,执行以下命令:

sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart(可选,建议执行)

备份gitlab

sudo gitlab-rake gitlab:backup:create
备份目录:/var/opt/gitlab/backups/

恢复gitlab备份

把备份文件放到/var/opt/gitlab/backups/

sudo gitlab-ctl stop
sudo gitlab-rake gitlab:backup:restore BACKUP=备份文件名称
sudo gitlab-ctl start

配置:

back_log    1000
character_set_server    utf8mb4
collation_server    utf8mb4_general_ci
interactive_timeout 3600
max_connections 1000
wait_timeout    3600

创建数据库和用户:

CREATE DATABASE abc CHARACTER SET utf8mb4;
CREATE USER 'user1'@'localhost' IDENTIFIED BY 'xxx';
GRANT ALL PRIVILEGES ON abc.* TO 'user1'@'localhost';
FLUSH PRIVILEGES;