Author Archives: Vitalijus Ryzakovas

Validation Failed: 1: this action would add [2] total shards, but this cluster currently has [xxx]/[xxx] maximum shards openValidation Failed: 1: this action would add [2] total shards, but this cluster currently has [xxx]/[xxx] maximum shards open

curl http://localhost:9200/_cluster/settings?pretty=true
{
"persistent" : {
"cluster" : {
"max_shards_per_node" : "xxxx"
}
},
"transient" : { }
}

curl -XPUT http://localhost:9200/_cluster/settings -H "Content-Type: application/json" -d '{ "persistent": { "cluster.max_shards_per_node": "xxxx" } }'

mysql export users and passwords to another server

mysqldump migrate users to new server


MySQL 5.6 and older

while read line; do mysql -B -N -e "SHOW GRANTS FOR $line"; done < <(mysql -B -N -e "SELECT CONCAT('\'', user,'\'@\'', host, '\'') FROM user WHERE user != 'debian-sys-maint' AND user != 'root' AND user != ''" mysql) | sed 's/$/;/' > mysql_all_users_grants.sql

if MySQL 5.7 and above

while read line; do mysql -B -N -e "SHOW CREATE USER $line"; done < <(mysql -B -N -e "SELECT CONCAT('\'', user,'\'@\'', host, '\'') FROM user WHERE user != 'mysql' AND user != 'root' AND user != ''" mysql) | sed 's/$/;/' > mysql_create_users.sql

while read line; do mysql -B -N -e "SHOW GRANTS FOR $line"; done < <(mysql -B -N -e "SELECT CONCAT('\'', user,'\'@\'', host, '\'') FROM user WHERE user != 'mysql' AND user != 'root' AND user != ''" mysql) | sed 's/$/;/' > mysql_all_users_grants.sql

Excludes some users like root

connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80

Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). – connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). – connect (101: Network is unreachable) Could not connect to archive.ubuntu.com:80 (91.189.88.152), connection timed out Could not connect to archive.ubuntu.com:80 (91.189.88.142), connection timed out
Err:7 http://archive.ubuntu.com/ubuntu bionic-updates InRelease

echo "Acquire::ForceIPv4 "true";" > /etc/apt/apt.conf.d/99force-ipv4