systemctl stop firewalld.service
Category Archives: linux
elasticsearch cluster.routing.allocation.disk.watermark.low
curl -X PUT "localhost:9200/_cluster/settings?pretty" -H 'Content-Type: application/json' -d ' { "transient": { "cluster.routing.allocation.disk.watermark.low": "90%", "cluster.routing.allocation.disk.watermark.high": "95%", "cluster.routing.allocation.disk.watermark.flood_stage": "98%" } } '
change nameserver 127.0.0.53
rm -f /etc/resolv.conf
ln -sv /run/systemd/resolve/resolv.conf /etc/resolv.conf
SSH Received disconnect from 192.168.0.100 port 22:2: Too many authentication failures
ssh -o IdentitiesOnly=yes 192.168.0.100
certbot renew reload nginx
For older OS setup cron:
certbot renew –post-hook “nginx -s reload”
Daemons using outdated libraries
List the services that need restart:
vim /etc/needrestart/needrestart.conf
$nrconf{restart} = 'l';
cPanel find user by domain
/scripts/whoowns domain
or
grep domain /etc/userdomains
ERROR 2061 (HY000): Authentication plugin ‘caching_sha2_password’ reported error: Authentication requires secure connection.
mysql> ALTER USER 'some_user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'some_password';
visudo: /etc/sudoers busy, try again later
lsof /etc/sudoers
kill -9 process_id
test root password
bash to verify root password:
sshpass -p testword ssh [email protected]
or:
pamtester system-auth root authenticate
Password:
pamtester: successfully authenticated
setlocale: No such file or directory
locale -a | grep LT
if nothing found:
locale-gen lt_LT.UTF-8
Generating locales (this might take a while)...
lt_LT.UTF-8... done
Generation complete.
filebeat custom index name
filebeat output to elasticsearch indices
filebeat separate index
filebeat log different index
filebeat.inputs:
- type: log
enabled: true
paths:
- /var/log/some/path/*.log
fields:
type: "query"
- type: log
enabled: true
paths:
- /var/log/another.path/*.log
fields:
type: "error"
filebeat.config.modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: false
setup.template.settings:
index.number_of_shards: 3
setup.kibana:
output.elasticsearch:
hosts: ["192.168.1.100:9200"]
index: "newindex-%{[fields.type]:other}-%{+yyyy.MM.dd}"
setup.template.name: "newindex"
setup.template.pattern: "newindex-*"
ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repository
[Repl] Slave SQL for channel '': Slave failed to initialize relay log info structure from the repository, Error_code: MY-013124
mysql> start slave;
ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repository
mysql> reset slave;
Query OK, 0 rows affected, 1 warning (0.01 sec)
mysql> CHANGE MASTER TO MASTER_HOST='172.17.0.2', MASTER_USER='repl', MASTER_PASSWORD='mypassword', MASTER_LOG_FILE='binlog.000008', MASTER_LOG_POS=157;
Query OK, 0 rows affected, 8 warnings (0.01 sec)
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
[Repl] Slave I/O thread for channel '': connected to master '[email protected]:3306',replication started in log 'binlog.000008' at position 157
E: Unable to locate package percona-xtrabackup-80
To enable Percona tools:
percona-release enable tools release
* Enabling the Percona Tools repository
<*> All done
apt update
apt install percona-xtrabackup-80
cpu usage make graph bash
vmstat -n 1 | gawk '{ print 100-int($(NF-2)); fflush(); }' | ttyplot