EnterpriseApps/Ignite: различия между версиями

Материал из ALT Linux Wiki
Строка 46: Строка 46:


  chmod 755 /home/ignite/startIgnite.sh
  chmod 755 /home/ignite/startIgnite.sh
Создаем apache-ignite-config
<pre>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
      <section name="igniteConfiguration" type="Apache.Ignite.Core.IgniteConfigurationSection, Apache.Ignite.Core" />
  </configSections>
  <runtime>
      <gcServer enabled="true"/>
  </runtime>
  <igniteConfiguration xmlns="http://ignite.apache.org/schema/dotnet/IgniteConfigurationSection" gridName="myGrid1">
   
      <localhost></localhost>
 
      <networkTimeout>1000</networkTimeout>
     
      <networkSendRetryDelay>1000</networkSendRetryDelay>
         
      <jvmOptions>
          <string>-Xms512m</string>
          <string>-Xmx3g</string>
          <string>--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED</string>
          <string>--add-exports=java.base/sun.nio.ch=ALL-UNNAMED</string>
          <string>--add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED</string>
          <string>--add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED</string>
          <string>--add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED</string>
          <string>--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED</string>
          <string>-Djava.net.preferIPv4Stack=true</string>
          <string>--illegal-access=warn</string>
      </jvmOptions>
     
      <discoverySpi type="TcpDiscoverySpi">
          <ipFinder type="TcpDiscoveryStaticIpFinder">
              <endpoints>
                  <string>127.0.0.1</string>
              </endpoints>
          </ipFinder>
      </discoverySpi>
     
      <atomicConfiguration type="AtomicConfiguration">
          <atomicSequenceReserveSize>1000</atomicSequenceReserveSize>
          <cacheMode>Partitioned</cacheMode>
          <backups>1</backups>
      </atomicConfiguration>
      <dataStorageConfiguration type="DataStorageConfiguration">
          <walPath>wal/</walPath>
          <walArchivePath>wal/</walArchivePath>
          <defaultDataRegionConfiguration type="DataRegionConfiguration">
              <name>Default_Region</name>
              <persistenceEnabled>false</persistenceEnabled>
              <initialSize>10485760</initialSize>
              <maxSize>20971520</maxSize>
          </defaultDataRegionConfiguration>
          <dataRegionConfigurations type="DataRegionConfiguration">
                  <dataRegionConfiguration>
                      <name>Persistent</name>
                      <persistenceEnabled>true</persistenceEnabled>
                      <initialSize>10485760</initialSize>
                      <maxSize>1147483648</maxSize>
                      <pageEvictionMode>RandomLru</pageEvictionMode>
                  </dataRegionConfiguration>
                  <dataRegionConfiguration>
                      <name>InMemory</name>
                      <persistenceEnabled>false</persistenceEnabled>
                      <initialSize>10485760</initialSize>
                      <maxSize>50485760</maxSize>
                  </dataRegionConfiguration>
          </dataRegionConfigurations>
      </dataStorageConfiguration>
 
      <clientMode>false</clientMode>
      <includedEventTypes></includedEventTypes>
      <workDirectory>/home/ignite/apache-ignite-data/</workDirectory>
      <jvmDllPath></jvmDllPath>
      <igniteInstanceName>Comindware_Instance2</igniteInstanceName>
      <autoGenerateIgniteInstanceName>false</autoGenerateIgniteInstanceName>
</igniteConfiguration>
</configuration>
</pre>
Где <workDirectory>/home/ignite/apache-ignite-data/</workDirectory>  - одна из наших созданных папок.


==Запуск службы==
==Запуск службы==

Версия от 14:41, 30 ноября 2023

Stub.png
Данная страница находится в разработке.
Эта страница ещё не закончена. Информация, представленная здесь, может оказаться неполной или неверной.

Ignite - это ...

Установка

https://ignite.apache.org/download.cgi

Установка Java

  1. Установите Java 1.8
    # apt-get install java-1.8.0-openjdk java-1.8.0-openjdk-devel

Установка программы

  1. Скачайте архив с программой (bin)

Качаем бинарник

https://ignite.apache.org/download.cgi#binaries

  1. Распакуйте архив
    # unzip apache-ignite-*.zip
  2. Скопируйте каталог в /opt
    # mv apache-ignite-*/ /opt/ignite
  3. Сделайте файлы исполняемыми
    # chmod +x -R /opt/ignite

Создание файла профиля

Создаем файл с профилем:

# mcedit /etc/profile.d/ignite.sh

Со следующим содержимым:

export IGNITE_HOME=/opt/ignite

Создание служебного пользователя

Создаем системного пользователя для службы:

# useradd -m ignite
# passwd ignite
$ su - ignite
$ mkdir -p /home/ignite/apache-ignite-config  /home/ignite/apache-ignite-data

Назначаем права на нового системного пользователя

# chown ignite:ignite -R /opt/ignite

Создаем файл /home/ignite/startIgnite.sh

#!/bin/bash
IGNITE_HOME=/opt/ignite
export IGNITE_HOME
/opt/ignite/bin/ignite.sh /home/ignite/apache-ignite-config/production-config.xml
chmod 755 /home/ignite/startIgnite.sh

Создаем apache-ignite-config

<?xml version="1.0" encoding="utf-8"?> 
<configuration> 
  <configSections> 
      <section name="igniteConfiguration" type="Apache.Ignite.Core.IgniteConfigurationSection, Apache.Ignite.Core" /> 
  </configSections> 
  <runtime> 
      <gcServer enabled="true"/> 
  </runtime> 
  <igniteConfiguration xmlns="http://ignite.apache.org/schema/dotnet/IgniteConfigurationSection" gridName="myGrid1"> 
    
      <localhost></localhost> 
   
      <networkTimeout>1000</networkTimeout> 
      
      <networkSendRetryDelay>1000</networkSendRetryDelay> 
          
      <jvmOptions> 
          <string>-Xms512m</string> 
          <string>-Xmx3g</string> 
          <string>--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED</string> 
          <string>--add-exports=java.base/sun.nio.ch=ALL-UNNAMED</string> 
          <string>--add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED</string> 
          <string>--add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED</string> 
          <string>--add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED</string> 
          <string>--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED</string> 
          <string>-Djava.net.preferIPv4Stack=true</string> 
          <string>--illegal-access=warn</string> 
      </jvmOptions> 
      
      <discoverySpi type="TcpDiscoverySpi"> 
          <ipFinder type="TcpDiscoveryStaticIpFinder"> 
              <endpoints> 
                  <string>127.0.0.1</string> 
              </endpoints> 
          </ipFinder> 
      </discoverySpi> 
      
      <atomicConfiguration type="AtomicConfiguration"> 
          <atomicSequenceReserveSize>1000</atomicSequenceReserveSize> 
          <cacheMode>Partitioned</cacheMode> 
          <backups>1</backups> 
      </atomicConfiguration> 

      <dataStorageConfiguration type="DataStorageConfiguration"> 
          <walPath>wal/</walPath> 
          <walArchivePath>wal/</walArchivePath> 
          <defaultDataRegionConfiguration type="DataRegionConfiguration"> 
              <name>Default_Region</name> 
              <persistenceEnabled>false</persistenceEnabled> 
              <initialSize>10485760</initialSize> 
              <maxSize>20971520</maxSize> 
          </defaultDataRegionConfiguration> 
          <dataRegionConfigurations type="DataRegionConfiguration"> 
                  <dataRegionConfiguration> 
                      <name>Persistent</name> 
                      <persistenceEnabled>true</persistenceEnabled> 
                      <initialSize>10485760</initialSize> 
                      <maxSize>1147483648</maxSize> 
                      <pageEvictionMode>RandomLru</pageEvictionMode> 
                  </dataRegionConfiguration> 
                  <dataRegionConfiguration> 
                      <name>InMemory</name> 
                      <persistenceEnabled>false</persistenceEnabled> 
                      <initialSize>10485760</initialSize> 
                      <maxSize>50485760</maxSize> 
                  </dataRegionConfiguration> 
          </dataRegionConfigurations> 
      </dataStorageConfiguration> 
  
      <clientMode>false</clientMode> 

      <includedEventTypes></includedEventTypes> 

      <workDirectory>/home/ignite/apache-ignite-data/</workDirectory> 

      <jvmDllPath></jvmDllPath> 

      <igniteInstanceName>Comindware_Instance2</igniteInstanceName> 

      <autoGenerateIgniteInstanceName>false</autoGenerateIgniteInstanceName> 

</igniteConfiguration> 
</configuration>

Где <workDirectory>/home/ignite/apache-ignite-data/</workDirectory> - одна из наших созданных папок.

Запуск службы

$ su - ignite
$ /opt/ignite/bin/ignite.sh -v

Создание сервиса

Настраиваем запуск ignite в качестве сервиса.

Создаем файл:

# mcedit /etc/systemd/system/ignite.service

Со следующим содержимым:

[Unit]
Description=Apache Ignite service
After=network.target

[Service]
Type=forking
User=ignite
Group=ignite
ExecStart=/opt/ignite/bin/ignite.sh -v
#ExecStop=/opt/hadoop/sbin/stop-all.sh
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure

[Install]
WantedBy=multi-user.target

Перечитываем конфигурацию systemd:

# systemctl daemon-reload

Разрешаем автозапуск:

# systemctl enable --now ignite

Для проверки можно перезагрузить сервер.