Migrar para o RHEL 8/9Last Updated February 5, 2025
Depois de criar e preparar sua infraestrutura Salt para os novos sistemas RHEL 8/9, você pode realizar estas etapas de migração para concluir o upgrade para o RHEL 8/9.
Preparar e realizar a migração
- Pare o serviço RaaS nos sistemas RHEL 7 e RHEL 8/9.
- Copie o arquivo de backup gz do servidor antigo para o novo servidor . O arquivo gz deve ser armazenado no diretório/var/lib/pgsqlcom ownership=postgres:postgres.
- No usuário postgres, execute estes comandos para remover o diretório do banco de dados:
- Crie um banco de dados vazio e verifique o usuário:
- Copie os arquivos/etc/raas/pki/.raas.keye/etc/raas/pki/.instance_iddo servidor RaaS antigo para o novo Servidor RaaS.
- Execute os comandos de upgrade para o novo banco de dados Postgresql:
Automation Config
no seu navegador. Em seguida, você deve configurar o master plugin no novo Mestre Salt RHEL 8/9.Configurar o Master Plugin no novo Mestre Salt
Realize estas etapas no novo nó rhel9-master.
- Log in to your Salt master and verify the/etc/salt/master.ddirectory exists, or create it.
- Generate the master configuration settings.If you want to preserve your settings when upgrading your installation, make a backup of your existing Master Plugin configuration file before running this step. Then copy relevant settings from your existing configuration to the newly generated file.If you installed Salt using onedir, the path to this executable is/opt/saltstack/salt/extras-3.10/bin/sseapi-config.
- Edit the generatedraas.conffile and update the values as follows:ValueDescriptionsseapi_ssl_validate_certValidates the certificate the API (RaaS) uses. The default isTrue.If you are using your own CA-issued certificates, set this value toTrueand configure thesseapi_ssl_ca,sseapi_ssl_cert, andsseapi_ssl_cert:settings.Otherwise, set this toFalseto not validate the certificate.sseapi_serverHTTP IP address of your RaaS node, for example,http://example.com, orhttps://example.comif SSL is enabled.sseapi_command_age_limitSets the age (in seconds) after which old, potentially stale jobs are skipped. For example, to skip jobs older than a day, set it to:Skipped jobs continue to exist in the database and display with a status ofCompletedin theAutomation Configuser interface.Some environments might need the Salt master to be offline for long periods of time and will need the Salt master to run any jobs that were queued after it comes back online. If this applies to your environment, set the age limit to0.sseapi_windows_minion_deploy_delaySets a delay to allow all requisite Windows services to become active. The default value is 180 seconds.sseapi_linux_minion_deploy_delaySets a delay to allow all requisite Linux services to become activate. The default value is 90 seconds.Sets the length of time that certain data is cached locally on each salt master. Values are in seconds. The example values are recommended values.
- load- salt save_load() payloads
- tgt- SSE target groups
- pillar- SSE pillar data (encrypted)
- exprmatch- SSE target expression matching data
- tgtmatch- SSE target group matching data
- OPTIONAL:This step is necessary for manual installations only. To verify you can connect to SSL before connecting the Master Plugin, edit the generatedraas.conffile to update the following values. If you do not update these values, the Master Plugin uses the default generated certificate.ValueDescriptionsseapi_ssl_caThe path to a CA file.sseapi_ssl_certThe path to the certificate. The default value is/etc/pki/raas/certs/localhost.crt.sseapi_ssl_keyThe path to the certificate’s private key. The default value is/etc/pki/raas/certs/localhost.key.idComment this line out by adding a#at the beginning. It is not required.
- OPTIONAL:Update performance-related settings. For large or busy environments, you can improve the performance of the communications between the Salt master andAutomation Configby adjusting the following settings.
- Configure the master plugin engines:The master plugineventqueueandrpcqueueengines offload some communications withAutomation Configfrom performance-critical code paths to dedicated processes. While the engines are waiting to communicate withAutomation Config, payloads are stored in the Salt master’s local filesystem so the data can persist across restarts of the Salt master. Thetgtmatchengine moves the calculation of minion target group matches from the RaaS server to the salt-masters.To enable the engines, ensure that the following settings are present in the Salt Master Plugin configuration file (raas.conf):To configure theeventqueueengine, verify that the following settings are present:The queue parameters can be adjusted with consideration to how they work together. For example, assuming an average of 400 events per second on the Salt event bus, the settings shown above allow for about 24 hours of queued event traffic to collect on the Salt master before the oldest events are discarded due to size or age limits.To configure therpcqueueengine, verify the following settings in raas.conf:Para configurar o mecanismo tgtmatch, certifique-se de que essas configurações estejam presentes no arquivo de configuração do Master Plugin (/etc/salt/master.d/raas.conf)To make use of target matching on the salt-masters, the following config setting must also be present in the RaaS configuration:target_groups_from_master_only: true.
- Limit minion grains payload sizes:
- Enable skipping jobs that are older than a defined time (in seconds). For example, use86400to set it to skip jobs older than a day. When set to0, this feature is disabled:During system upgrades, enabling this setting is useful to prevent old commands stored in the database from running unexpectedly.
Together, event queuing in Salt and the queuing engines, salt-master target matching, grains payload size limit, and command age limit in the Salt Master Plugin increase the throughput and reduce the latency of communications between the Salt master andAutomation Configin the most performance-sensitive code paths. - Restart the master service.
- OPTIONAL:You might want to run a test job to ensure the Master Plugin is now enabling communication between the master and the RaaS node.
O Mestre RHEL 8/9 agora aparece na página
Chaves Mestres
. Não aceite a chave do mestre neste momento.
Configurar o agente subordinado
Siga estas etapas para configurar o agente subordinado no nó rhel9-master para apontar para si mesmo.
- Entre via SSH no nó rhel9-master e navegue até o diretório/etc/salt/minion.d.
- Edite o arquivominion.confe altere a configuração mestre paramaster:localhost.
- Navegue até o diretório/etc/salt/pki/minione exclua o arquivominion_master.pub.
- Reinicie o serviço salt-minion usando o
- Visualize e aceite a chave de subordinado no rhel9-master executando:
- NoAutomation Config, navegue até e aceite a Chave Mestre.O Mestre RHEL8/9 agora deve aparecer na páginaDestinos.
- Entre por SSH no Mestre RHEL7 e exclua a chave para o subordinado rhel9-master.
Migrar sistemas Salt-Minion
Há várias maneiras de migrar seus sistemas gerenciados . Se você já tiver um processo configurado, siga esse processo. Caso contrário, use estas instruções para migrar seus salt-minions de um Mestre Salt antigo para um novo Mestre Salt.
Essas etapas não se aplicam a sistemas de vários mestres.
- Crie um arquivo de orquestração. Por exemplo:
- Crie um arquivomap.yamlque inclua (consulte o exemplo de código acima):
- <mestre salt antigo> endereço IP/FQDN
- <novo mestre salt> endereço IP/FQDN
- Lista de saltminionIDs a serem movidos.
- Crie um arquivo de estado (consulte o exemplo de código acima) para processar a migração . Por exemplo,move_minions_map.sls.
- Adicione esses arquivos a um diretório (por exemplo,/srv/salt/switch_mastersno Mestre Salt RHEL7.
- Execute o arquivo de orquestração no Mestre Salt RHEL7. Isso resulta em alguns erros quando o serviço de subordinado Salt é reiniciado e não volta a ficar online para o Mestre Salt RHEL7.
- Monitore o progresso noAutomation Config. Aceite os IDs de subordinado Salt de migração conforme eles são preenchidos na UI.
- Depois que todos os sistemas tiverem migrado, execute um trabalhotest.pingpara verificar se tudo está se comunicando corretamente.
Migrar arquivos existentes
Esse processo depende completamente de como sua organização cria, armazena e gerencia seu arquivo de estado e configuração. Os casos de uso mais comuns são descritos abaixo como referência.
Caso de uso 1: servidor de arquivos do
Automation Config
Nesse caso de uso, seus arquivos
Automation Config
são armazenados no banco de dados Postgres e aparecem na UI do Automation Config
.Durante a restauração do banco de dados Postgres, esses arquivos são recuperados e migrados. Não há etapas adicionais necessárias para migrar esses arquivos para o seu ambiente RHEL8/9.
Caso de uso 2: servidor de arquivos Github/Gitlab
Nesse caso de uso, seus arquivos de estado
Automation Config
e de configuração são armazenados no Github/Gitlab/Bitbucket ou em algum outro sistema de controle de versão de código.Como esses arquivos são armazenados em uma ferramenta de terceiros, você precisa configurar seu novo Mestre RHEL8/9 para se conectar ao seu sistema de repositório. Essa configuração espelhará a configuração do repositório RHEL7 .
Caso de uso 3: raízes de arquivo locais do Mestre Salt
Nesse caso de uso, seu
Automation Config
é armazenado em um diretório do servidor de arquivos local no Mestre Salt.Para migrar esses arquivos para o seu Mestre RHEL8/9, copie os diretórios apropriados do seu Mestre RHEL7 para o seu Mestre RHEL8/9.
- Os arquivos são armazenados em/srv/salte/srv/pillarpara arquivos de estado e de pilar, respectivamente.
- Execute uma cópia segura desses diretórios do seu Mestre RHEL7 para o seu Mestre RHEL8/9 usando uma ferramenta de cópia segura, como winscp ou a linha de comando.
- Atualizar data do pilar usandoSalt \* saltutil.refresh_pillar