Инструменты пользователя

Инструменты сайта


wiki:technical:percona

Различия

Показаны различия между двумя версиями страницы.

Ссылка на это сравнение

Предыдущая версия справа и слеваПредыдущая версия
Следующая версия
Предыдущая версия
wiki:technical:percona [2023/05/23 16:23] – [Установка кластера] Dimanwiki:technical:percona [2023/05/23 23:32] (текущий) – [Генерация сертификатов] Diman
Строка 76: Строка 76:
 </code> </code>
 ====Добавляем пользователя MySQL==== ====Добавляем пользователя MySQL====
- CREATE USER 'sstuser'@'localhost' IDENTIFIED BY 'verySt0ngPa$$wd'; 
- GRANT RELOAD, LOCK TABLES, PROCESS, REPLICATION CLIENT ON *.* TO 'sstuser'@'localhost'; 
- FLUSH PRIVILEGES; 
 Останавливаем MySQL Останавливаем MySQL
- service mysql stop+service mysql stop 
 Bootstrat-им ноду Bootstrat-им ноду
 +<code bash>
 +# В этот момент текущая нода определяет переменную wsrep_cluster_conf_id в 1
 +systemctl start mysql@bootstrap.service
 +# Подключаемся в mysql и добавляем пользователя с паролем
 +mysql -p
 +</code>
 +
 +<code mysql>
 +CREATE USER 'sstuser'@'localhost' IDENTIFIED BY 'verySt0ngPa$$wd';
 +GRANT RELOAD, LOCK TABLES, PROCESS, REPLICATION CLIENT ON *.* TO 'sstuser'@'localhost';
 +FLUSH PRIVILEGES;
 +</code>
 +==== Генерация сертификатов ====
 +
 +<code bash>
 +# Генерация сертификатов
 +mkdir /etc/mysql/certs; cd /etc/mysql/certs
 +
 +# Generate CA key and certificate
 +# Generate the CA key file:
 +openssl genrsa 2048 > ca-key.pem
 +# Generate the CA certificate file:
 +openssl req -new -x509 -nodes -days 9999 -key ca-key.pem -out ca.pem
 +
 +# Generate server key and certificate
 +# Generate the server key file:
 +openssl req -newkey rsa:2048 -days 9999 -nodes -keyout server-key.pem -out server-req.pem
 +# Remove the passphrase:
 +openssl rsa -in server-key.pem -out server-key.pem
 +# Generate the server certificate file:
 +openssl x509 -req -in server-req.pem -days 9999 -CA ca.pem -CAkey ca-key.pem -set_serial 01 -out server-cert.pem
 +
 +# Generate client key and certificate
 +# Generate the client key file:
 +openssl req -newkey rsa:2048 -days 9999 -nodes -keyout client-key.pem -out client-req.pem
 +# Remove the passphrase:
 +openssl rsa -in client-key.pem -out client-key.pem
 +# Generate the client certificate file:
 +openssl x509 -req -in client-req.pem -days 9999 -CA ca.pem -CAkey ca-key.pem -set_serial 01 -out client-cert.pem
 +
 +</code>
 +
 +
 +
  root@db4 ~ # /etc/init.d/mysql bootstrap-pxc  root@db4 ~ # /etc/init.d/mysql bootstrap-pxc
  Bootstrapping Percona XtraDB Cluster database server: mysqld ..  Bootstrapping Percona XtraDB Cluster database server: mysqld ..
wiki/technical/percona.1684848214.txt.gz · Последнее изменение: 2023/05/23 16:23 — Diman

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki