Countly / countly-server

Countly is a product analytics platform that helps teams track, analyze and act-on their user actions and behaviour on mobile, web and desktop applications.
https://countly.com
Other
5.58k stars 972 forks source link

issues with installation via docker compose #4299

Closed holdbar closed 1 year ago

holdbar commented 1 year ago

I tried to install countly with docker compose according to guide:

curl -O https://raw.githubusercontent.com/Countly/countly-server/master/docker-compose.yml
curl -O https://raw.githubusercontent.com/Countly/countly-server/master/bin/docker/nginx.server.conf
sed -i '' 's/bin\/docker\/nginx.server.conf/nginx.server.conf/g' docker-compose.yml
docker-compose up

when I got to browser and try to open country page I see 502 Bad Gateway Page, and in the logs I got this:

nginx 12:08:41.53 INFO  ==> ** NGINX setup finished! **

nginx 12:08:41.53 INFO  ==> ** Starting NGINX **

2023-06-09T12:08:43.081Z: INFO  [jobs:manager]  Starting job manager in 10

Starting Countly version 23.03.9 package 23.03.0

Starting Countly version 23.03.9 package 23.03.0

2023/06/09 12:09:02 [error] 35#35: *2 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.128.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://192.168.128.4:6001/", host: "127.0.0.1"

2023/06/09 12:09:03 [error] 35#35: *2 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.128.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", upstream: "http://192.168.128.4:6001/favicon.ico", host: "127.0.0.1", referrer: "http://127.0.0.1/"

Any idea how to fix this?

ar2rsawseen commented 1 year ago

@Countly/devops :)

kaanklky commented 1 year ago

hello @holdbar ,

I created a new Ubuntu 22.04 LTS server and installed latest Docker(Docker version 24.0.2, build cb74dfc) so I could not reproduce the issue by following 3 commands that you shared. I can try to reproduce one more time if you can share OS and Docker version info.

jikuanyu commented 1 year ago

I found countly-api install run fail install countly

curl -O https://raw.githubusercontent.com/Countly/countly-server/master/docker-compose.yml
curl -O https://raw.githubusercontent.com/Countly/countly-server/master/bin/docker/nginx.server.conf
sed -i   's/bin\/docker\/nginx.server.conf/nginx.server.conf/g' docker-compose.yml
docker compose up -d

f5874a5c506e countly/api:latest "/tini -v -- /opt/co…" 13 minutes ago Exited (1) 12 minutes ago countlyinstall-countly-api-1

docker-compose.yml

version: "3.7"

volumes:
  mongodb_data:

networks:
  countly:

services:
  mongodb:
    image: 'bitnami/mongodb:latest'
    volumes:
      - 'mongodb_data:/bitnami'
    networks:
      countly:

  countly-api:
    image: 'countly/api:latest'
    # Enterprise Edition: image: 'gcr.io/countly-01/api:20.11.2'
    environment:
      - COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,views,logger,systemlogs,populator,reports,crashes,push,star-rating,slipping-away-users,compare,server-stats,dbviewer,times-of-day,compliance-hub,alerts,onboarding,consolidate,remote-config,hooks,dashboards,sdk,data-manager
      # Enterprise Edition: - COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,views,drill,funnels,retention_segments,flows,cohorts,surveys,remote-config,ab-testing,formulas,activity-map,concurrent_users,revenue,logger,systemlogs,populator,reports,crashes,push,geo,block,restrict,users,star-rating,slipping-away-users,compare,server-stats,assistant,dbviewer,crash_symbolication,crashes-jira,groups,white-labeling,alerts,times-of-day,compliance-hub,onboarding,active_users,performance-monitoring,config-transfer,consolidate,data-manager,hooks,dashboards,sdk
      - COUNTLY_CONFIG__MONGODB_HOST=mongodb
      - COUNTLY_CONFIG_API_MONGODB_HOST=mongodb
    deploy:
      restart_policy:
        condition: on-failure
        delay: 5s
        max_attempts: 3
        window: 400s
    networks:
      countly:
    depends_on:
      - mongodb

  countly-frontend:
    image: 'countly/frontend:latest'
    # Enterprise Edition: image: 'gcr.io/countly-01/frontend:20.11.2'
    environment:
      - COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,views,logger,systemlogs,populator,reports,crashes,push,star-rating,slipping-away-users,compare,server-stats,dbviewer,times-of-day,compliance-hub,alerts,onboarding,consolidate,remote-config,hooks,dashboards,sdk,data-manager
      # Enterprise Edition: - COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,views,drill,funnels,retention_segments,flows,cohorts,surveys,remote-config,ab-testing,formulas,activity-map,concurrent_users,revenue,logger,systemlogs,populator,reports,crashes,push,geo,block,restrict,users,star-rating,slipping-away-users,compare,server-stats,assistant,dbviewer,crash_symbolication,crashes-jira,groups,white-labeling,alerts,times-of-day,compliance-hub,onboarding,active_users,performance-monitoring,config-transfer,consolidate,data-manager,hooks,dashboards,sdk
      - COUNTLY_CONFIG__MONGODB_HOST=mongodb
      - NODE_OPTIONS="--max-old-space-size=2048"
    networks:
      countly:
    depends_on:
      - mongodb
    deploy:
      # There is usually no need in multiple frontends, so throttling down resources for it
      mode: global
      resources:
        limits:
          cpus: '0.5'
      restart_policy:
        condition: on-failure
        delay: 5s
        max_attempts: 3
        window: 400s

  nginx:
    image: 'bitnami/nginx'
    ports:
      - '80:8080'
    volumes:
      - './nginx.server.conf:/opt/bitnami/nginx/conf/server_blocks/countly.conf:ro'
    networks:
      countly:
    depends_on:
      - countly-api
      - countly-frontend

Docker version 24.0.2, build cb74dfc cat /etc/redhat-release CentOS Stream release 9

Any idea how to fix this? Looking forward to your reply.

docker logs emote-config,hooks,dashboards,sdk,data-manager [docker] Installing mobile: [docker] Done installing mobile. [docker] Installing web: Installing web plugin { MongoNetworkError: failed to connect to server [localhost:27017] on first connect [MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017]

jikuanyu commented 1 year ago

我发现的问题是,估计是里面的镜像通过加速器尽管为latest下载的依然是旧的:后来我加上版本号,可以了。

version: "3.7"

volumes:
  mongodb_data:

networks:
  countly:

services:
  mongodb:
    image: 'bitnami/mongodb:latest'
    volumes:
      - 'mongodb_data:/bitnami'
    networks:
      countly:

  countly-api:
    image: 'countly/api:23.06'
    # Enterprise Edition: image: 'gcr.io/countly-01/api:20.11.2'
    environment:
      - COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,views,logger,systemlogs,populator,reports,crashes,push,star-rating,slipping-away-users,compare,server-stats,dbviewer,times-of-day,compliance-hub,alerts,onboarding,consolidate,remote-config,hooks,dashboards,sdk,data-manager
      # Enterprise Edition: - COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,views,drill,funnels,retention_segments,flows,cohorts,surveys,remote-config,ab-testing,formulas,activity-map,concurrent_users,revenue,logger,systemlogs,populator,reports,crashes,push,geo,block,restrict,users,star-rating,slipping-away-users,compare,server-stats,assistant,dbviewer,crash_symbolication,crashes-jira,groups,white-labeling,alerts,times-of-day,compliance-hub,onboarding,active_users,performance-monitoring,config-transfer,consolidate,data-manager,hooks,dashboards,sdk
      - COUNTLY_CONFIG__MONGODB_HOST=mongodb
    deploy:
      restart_policy:
        condition: on-failure
        delay: 5s
        max_attempts: 3
        window: 400s
    networks:
      countly:
    depends_on:
      - mongodb

  countly-frontend:
    image: 'countly/frontend:23.06'
    # Enterprise Edition: image: 'gcr.io/countly-01/frontend:20.11.2'
    environment:
      - COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,views,logger,systemlogs,populator,reports,crashes,push,star-rating,slipping-away-users,compare,server-stats,dbviewer,times-of-day,compliance-hub,alerts,onboarding,consolidate,remote-config,hooks,dashboards,sdk,data-manager
      # Enterprise Edition: - COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,views,drill,funnels,retention_segments,flows,cohorts,surveys,remote-config,ab-testing,formulas,activity-map,concurrent_users,revenue,logger,systemlogs,populator,reports,crashes,push,geo,block,restrict,users,star-rating,slipping-away-users,compare,server-stats,assistant,dbviewer,crash_symbolication,crashes-jira,groups,white-labeling,alerts,times-of-day,compliance-hub,onboarding,active_users,performance-monitoring,config-transfer,consolidate,data-manager,hooks,dashboards,sdk
      - COUNTLY_CONFIG__MONGODB_HOST=mongodb
      - NODE_OPTIONS="--max-old-space-size=2048"
    networks:
      countly:
    depends_on:
      - mongodb
    deploy:
      # There is usually no need in multiple frontends, so throttling down resources for it
      mode: global
      resources:
        limits:
          cpus: '0.5'
      restart_policy:
        condition: on-failure
        delay: 5s
        max_attempts: 3
        window: 400s

  nginx:
    image: 'bitnami/nginx'
    ports:
      - '80:8080'
    volumes:
      - './nginx.server.conf:/opt/bitnami/nginx/conf/server_blocks/countly.conf:ro'
    networks:
      countly:
    depends_on:
      - countly-api
      - countly-frontend