Initial commit

This commit is contained in:
Вячеслав Белов 2024-11-08 20:18:03 +03:00 committed by belov-ve
parent e37f08a207
commit 324d034131
2674 changed files with 8071 additions and 2 deletions

3
.env Normal file
View File

@ -0,0 +1,3 @@
MQTT_PORT=1883
MQTT_MNG=18083
HTTP_PORT=8001

30
.gitignore vendored Normal file
View File

@ -0,0 +1,30 @@
# ---> macOS
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
inspark-license.lic

9
Install_for_Linux.txt Normal file
View File

@ -0,0 +1,9 @@
1. На Linux сервере должен присутствовать docker
2. Распакуйте архив командой: tar -xvf inspark-docker.tar
3. Положите файл лицензии inspark-license.lic выданный вам, в корень директории inspark-docker
4. Запустите приложение командой: docker compose up -d
5. Теперь в браузере, перейдите на адрес сервера на котором был запушена команда docker compose с указанием порта 8001. Если все происходит на одном сервере, адрес будет выглядеть следующим образом: http://localhost:8001

10
Install_for_Windows.txt Normal file
View File

@ -0,0 +1,10 @@
1. Установите себе на компьютер программное обеспечение Docker Desktop
https://www.docker.com/products/docker-desktop/
2. Положите файл лицензии inspark-license.lic выданный вам, в корень директории inspark-docker
3. Из директории inspark-docker откройте cmd(командную строку) и введите команду: docker compose up -d
4. Подождите пока скачаются все образы и запустятся все контейнеры
5. Теперь в браузере, перейдите на адрес сервера на котором был запушена команда docker compose с указанием порта 8001. Если все происходит на одном сервере, адрес будет выглядеть следующим образом: http://localhost:8001

View File

@ -1,3 +1,55 @@
# inspark-data-center
# Платформа Inspark Data Center
## Введение
Проект включает в себя конфигурации docker compose для быстрой настройки платформы Inspark Data Center.
Проект запускает платформу исключительно для тестовых целей и для краткого знакомства. Некоторые модули требуют лицензии, которую необходимо получить по запросу. (support@multi-sys.ru)
## Клонирование проекта из репозитория
Клонируйте репозиторий Inspark Data Center в своем терминале с помощью следующей команды:
```
git clone https://git.multi-sys.ru/Multi-Sys/inspark-data-center.git
```
Как только эта команда будет успешно завершена, вы должны увидеть новую папку inspark-data-center в вашем текущем каталоге.
## Запуск платформы через docker compose
Перейдите к папке, которую вы создали на шаге 1:
```
cd inspark-data-center
```
скопируйте полученный файл лицензии inspark-license.lic в корень папки.
При работе с главной веткой репозитория выполните следующие команды для запуска режима разработки с помощью docker compose:
```
docker compose up
```
СОВЕТ Платформа будет запущена с параметрами, указанными в таких файлах, как .env и ./docker/.env. Если вам нужно изменить параметры порта, которые должны получить доступ через http, вы можете изменить номер порта в файле .env в переменной HTTP_PORT.
## Настройка состава докера
Вы можете настроить переменные среды Docker Compose для docker/.env соответственно. Эти файлы окружения задают среду для большинства контейнеров в настройке Docker Compose, и некоторые переменные влияют на несколько контейнеров, а другие — только на отдельные.
## Подключение к Inspark Data Center
Теперь вы можете получить доступ к Inspark Data Center через веб-браузер, посетив http://localhost:HTTP_PORT (по умолчанию это 8001). Обратите внимание, что теперь многие браузеры по умолчанию используют подключение по https - если ваш браузер является одним из них, пожалуйста, убедитесь, что он использует http.
Войдите в систему с именем пользователя и паролем по умолчанию:
- **имя пользователя**: root
- **пароль**: masterkey
---
На данный момент **Inspark Data Center** полностью настроен и готов к использованию!
Проект включает в себя конфигурации docker compose для быстрой настройки платформы Inspark Data Center

6
controller-emulator.sh Normal file
View File

@ -0,0 +1,6 @@
#!/bin/sh
SERIAL=$1
HOST=$2
docker run --name="$SERIAL-$HOST" -d --restart=unless-stopped --add-host="emqx:$HOST" -e "WB_SERIAL=$SERIAL" -e "COLLECTOR=$HOST:1883" insparkplatform/plc_emulator:latest

119
docker-compose.yml Normal file
View File

@ -0,0 +1,119 @@
x-semona-depends-on: &semona-depends-on
- db
- redis
- artemis
- emqx
version: '3.1'
services:
emqx:
restart: always
image: emqx:4.3
container_name: emqx
environment:
EMQX_MQTT__MAX_PACKET_SIZE: "2MB"
EMQX_ALLOW__ANONYMOUS: "true"
ports:
- ${MQTT_PORT}:1883
- ${MQTT_MNG}:18083
redis:
image: redis:6
container_name: dbmemory
command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
restart: unless-stopped
volumes:
- ./docker/redis:/data
- ./docker/redis:/usr/local/etc/redis
db:
image: postgis/postgis:14-3.4
restart: unless-stopped
container_name: semona_db
environment:
POSTGRES_DB: semdb
POSTGRES_PASSWORD: postgres
volumes:
- ./docker/db_home:/var/lib/postgresql/data
- ./docker/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
artemis:
image: insparkplatform/apache-artemis
restart: unless-stopped
container_name: jmsserver
volumes:
- ./docker/artemis-etc:/var/lib/artemis-instance/etc-override
semona-init:
image: insparkplatform/semona-migrator
container_name: migrator
env_file: ./docker/.env
depends_on: *semona-depends-on
volumes:
- ./docker/docker-entrypoint.d:/docker-entrypoint.d
semona-engine:
image: insparkplatform/semona-engine
container_name: engine
env_file: ./docker/.env
ports:
- 9810:8746
depends_on:
semona-init:
condition: service_completed_successfully
volumes:
- ./inspark-license.lic:/opt/sem-engine/inspark-license.lic
semona-periodic:
image: insparkplatform/semona-periodic
container_name: periodic
env_file: ./docker/.env
ports:
- 9811:8080
depends_on:
semona-init:
condition: service_completed_successfully
semona-restservices:
image: insparkplatform/semona-webservices
container_name: restservices
env_file: ./docker/.env
ports:
- 9812:8080
depends_on:
semona-init:
condition: service_completed_successfully
volumes:
- ./docker/inspark-files:/files
- ./inspark-license.lic:/opt/sem-restservices/inspark-license.lic
semux:
restart: always
image: insparkplatform/semux
container_name: semux
env_file: ./docker/.env
environment:
HTTP_PORT: $HTTP_PORT
ports:
- ${HTTP_PORT}:80
volumes:
- ./docker/proxy-semona/default.conf.template:/etc/nginx/conf.d/default.conf
- ./docker/proxy-semona/semona-cors.conf:/etc/nginx/semona-cors.conf
handler:
restart: always
image: insparkplatform/semona-handler
container_name: handler
env_file: ./docker/.env
depends_on:
semona-init:
condition: service_completed_successfully
volumes:
semona_home:
external: false
db_home:
external: false
redis:
external: false
inspark-files:

36
docker/.env Normal file
View File

@ -0,0 +1,36 @@
SYS_CORE=3.8
SYS_WEB=2.30.0
PG_HOST=semona_db
PG_PORT=5432
PG_DB=semdb
PG_SCHEMA=sem
PG_USER=postgres
PG_PASS=postgres
JMS_HOST=jmsserver
JMS_PORT=61616
JMS_USER=artemis
JMS_PASSWORD=SuperHot
REDIS_URI=redis://dbmemory:6379
# параметры подключения сервиса handler к MQTT
MQTT_HOST=emqx
MQTT_PORT=1883
MQTT_USER="admin"
MQTT_PASSWORD="admin"
MQTT_THREADS=32
INSTANCE_NAME="demo"
CTRL_MQTT_LOGIN="demo"
CTRL_MQTT_PASSWORD="password"
#тип хранилища (POSTGRES, CASSANDRA)
STORE_TYPE=POSTGRES
STORE_NODES=1.2.3.4:9042,1.2.3.4:9042
STORE_DATACENTER=datacenter1
STORE_USER=cassandra
STORE_PASSWORD=cassandra
# ссылка на магазин виджетов и порт вызова приложения
WIST_URL=https://widget.inspark.ru

View File

@ -0,0 +1,231 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq /schema/artemis-configuration.xsd">
<core xmlns="urn:activemq:core">
<name>artemis</name>
<bindings-directory>data/messaging/bindings</bindings-directory>
<journal-directory>data/messaging/journal</journal-directory>
<large-messages-directory>data/messaging/largemessages</large-messages-directory>
<paging-directory>data/messaging/paging</paging-directory>
<!-- Connectors -->
<connectors>
<connector name="netty-connector">tcp://artemis:61616</connector>
</connectors>
<!-- Acceptors -->
<acceptors>
<!-- Acceptor for every supported protocol -->
<acceptor name="netty-acceptor">tcp://0.0.0.0:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;amqpMinLargeMessageSize=102400;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpDuplicateDetection=true;supportAdvisory=false;suppressInternalManagementObjects=false</acceptor>
<!-- AMQP Acceptor. Listens on default AMQP port for AMQP traffic.-->
<acceptor name="amqp">tcp://0.0.0.0:5672?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=AMQP;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpMinLargeMessageSize=102400;amqpDuplicateDetection=true</acceptor>
<!-- STOMP Acceptor. -->
<acceptor name="stomp">tcp://0.0.0.0:61613?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=STOMP;useEpoll=true</acceptor>
<!-- HornetQ Compatibility Acceptor. Enables HornetQ Core and STOMP for legacy HornetQ clients. -->
<acceptor name="hornetq">tcp://0.0.0.0:5445?anycastPrefix=jms.queue.;multicastPrefix=jms.topic.;protocols=HORNETQ,STOMP;useEpoll=true</acceptor>
</acceptors>
<!-- Federation -->
<!--No federation configuration necessary as the other brokers will be creating downstreams/upstreams
to this broker-->
<!-- Other config -->
<security-settings>
<security-setting match="#">
<permission type="createNonDurableQueue" roles="amq"/>
<permission type="deleteNonDurableQueue" roles="amq"/>
<permission type="createDurableQueue" roles="amq"/>
<permission type="deleteDurableQueue" roles="amq"/>
<permission type="createAddress" roles="amq"/>
<permission type="deleteAddress" roles="amq"/>
<permission type="consume" roles="amq"/>
<permission type="browse" roles="amq"/>
<permission type="send" roles="amq"/>
<!-- we need this otherwise ./artemis data imp wouldn't work -->
<permission type="manage" roles="amq"/>
</security-setting>
</security-settings>
<address-settings>
<!-- if you define auto-create on certain queues, management has to be auto-create -->
<address-setting match="activemq.management#">
<dead-letter-address>DLQ</dead-letter-address>
<expiry-address>ExpiryQueue</expiry-address>
<max-delivery-attempts>1</max-delivery-attempts>
<!-- with -1 only the global-max-size is in use for limiting -->
<max-size-bytes>524288</max-size-bytes>
<page-size-bytes>524288</page-size-bytes>
<address-full-policy>DROP</address-full-policy>
</address-setting>
<!--default for catch all-->
<address-setting match="#">
<dead-letter-address>DLQ</dead-letter-address>
<expiry-address>ExpiryQueue</expiry-address>
<redelivery-delay>5000</redelivery-delay>
<max-delivery-attempts>2</max-delivery-attempts>
<max-size-bytes>10485760</max-size-bytes>
<page-size-bytes>10485760</page-size-bytes>
<address-full-policy>BLOCK</address-full-policy>
<default-group-rebalance>true</default-group-rebalance>
<default-group-rebalance-pause-dispatch>true</default-group-rebalance-pause-dispatch>
</address-setting>
<address-setting match="jms.queue.Notify">
<!-- через час сообщения устаревают и переносятся в очередь ExpiredNotifications -->
<expiry-address>jms.queue.ExpiredNotifications</expiry-address>
<expiry-delay>3600000</expiry-delay>
<!-- повторная отправка через: 20 sec, 30 sec, 45 sec, ..., 300 sec -->
<redelivery-delay>20000</redelivery-delay>
<redelivery-delay-multiplier>1.5</redelivery-delay-multiplier>
<max-redelivery-delay>300000</max-redelivery-delay>
<!-- 50 неудачных отправок достаточно будет -->
<max-delivery-attempts>50</max-delivery-attempts>
</address-setting>
</address-settings>
<addresses>
<address name="DLQ">
<anycast>
<queue name="DLQ"/>
</anycast>
</address>
<address name="ExpiryQueue">
<anycast>
<queue name="ExpiryQueue"/>
</anycast>
</address>
<address name="jms.queue.Aggregation">
<anycast>
<queue name="jms.queue.Aggregation"/>
</anycast>
</address>
<address name="jms.queue.Event">
<anycast>
<queue name="jms.queue.Event"/>
</anycast>
</address>
<address name="jms.queue.Measure">
<anycast>
<queue name="jms.queue.Measure"/>
</anycast>
</address>
<address name="jms.queue.Command">
<anycast>
<queue name="jms.queue.Command"/>
</anycast>
</address>
<address name="jms.queue.CalcParam">
<anycast>
<queue name="jms.queue.CalcParam"/>
</anycast>
</address>
<address name="jms.queue.Collector">
<anycast>
<queue name="jms.queue.Collector"/>
</anycast>
</address>
<address name="jms.queue.RuleExec">
<anycast>
<queue name="jms.queue.RuleExec"/>
</anycast>
</address>
<address name="jms.queue.SetValue">
<anycast>
<queue name="jms.queue.SetValue"/>
</anycast>
</address>
<address name="jms.queue.Notify">
<anycast>
<queue name="jms.queue.Notify"/>
</anycast>
</address>
<address name="jms.queue.EventExport">
<multicast>
<queue name="jms.queue.EventExport"/>
</multicast>
</address>
<address name="jms.queue.ExpiredNotifications">
<anycast>
<queue name="jms.queue.ExpiredNotifications"/>
</anycast>
</address>
<address name="jms.queue.NbiotCommand">
<anycast>
<queue name="jms.queue.NbiotCommand"/>
</anycast>
</address>
<address name="jms.queue.GlobalRuleExec">
<anycast>
<queue name="jms.queue.GlobalRuleExec"/>
</anycast>
</address>
<address name="jms.queue.RuleAction">
<anycast>
<queue name="jms.queue.RuleAction"/>
</anycast>
</address>
<address name="jms.queue.ActionCondition">
<anycast>
<queue name="jms.queue.ActionCondition"/>
</anycast>
</address>
<address name="jms.queue.ParamChange">
<multicast>
<queue name="jms.queue.ParamChange"/>
</multicast>
</address>
<address name="jms.queue.WidgetEvent">
<multicast>
<queue name="jms.queue.WidgetEvent"/>
</multicast>
</address>
<address name="jms.queue.HierarchyMeasure">
<multicast>
<queue name="jms.queue.HierarchyMeasure"/>
</multicast>
</address>
<address name="jms.queue.HierarchyMetaData">
<multicast>
<queue name="jms.queue.HierarchyMetaData"/>
</multicast>
</address>
<address name="jms.queue.HierarchyEvent">
<multicast>
<queue name="jms.queue.HierarchyEvent"/>
</multicast>
</address>
<address name="jms.queue.HierarchyCommand">
<multicast>
<queue name="jms.queue.HierarchyCommand"/>
</multicast>
</address>
</addresses>
</core>
</configuration>

View File

@ -0,0 +1 @@
14

BIN
docker/db_home/base/1/112 Normal file

Binary file not shown.

BIN
docker/db_home/base/1/113 Normal file

Binary file not shown.

BIN
docker/db_home/base/1/1247 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
docker/db_home/base/1/1249 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
docker/db_home/base/1/1255 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
docker/db_home/base/1/1259 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
docker/db_home/base/1/13575 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

BIN
docker/db_home/base/1/13579 Normal file

Binary file not shown.

BIN
docker/db_home/base/1/13580 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

BIN
docker/db_home/base/1/13584 Normal file

Binary file not shown.

BIN
docker/db_home/base/1/13585 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

BIN
docker/db_home/base/1/13589 Normal file

Binary file not shown.

BIN
docker/db_home/base/1/13590 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

BIN
docker/db_home/base/1/13594 Normal file

Binary file not shown.

View File

View File

BIN
docker/db_home/base/1/174 Normal file

Binary file not shown.

BIN
docker/db_home/base/1/175 Normal file

Binary file not shown.

BIN
docker/db_home/base/1/2187 Normal file

Binary file not shown.

View File

BIN
docker/db_home/base/1/2228 Normal file

Binary file not shown.

View File

View File

BIN
docker/db_home/base/1/2337 Normal file

Binary file not shown.

BIN
docker/db_home/base/1/2579 Normal file

Binary file not shown.

BIN
docker/db_home/base/1/2600 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
docker/db_home/base/1/2601 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
docker/db_home/base/1/2602 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
docker/db_home/base/1/2603 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

BIN
docker/db_home/base/1/2605 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
docker/db_home/base/1/2606 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
docker/db_home/base/1/2607 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
docker/db_home/base/1/2608 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
docker/db_home/base/1/2609 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
docker/db_home/base/1/2610 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

BIN
docker/db_home/base/1/2612 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

BIN
docker/db_home/base/1/2615 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
docker/db_home/base/1/2616 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
docker/db_home/base/1/2617 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More