Giter VIP home page Giter VIP logo

Comments (6)

jaeyson avatar jaeyson commented on May 27, 2024 1

Ah missed the small part container_name: typesense. It should be typesense instead of localhost for the hostname. closing this now

from laravel-scout-typesense-driver.

dlogvin avatar dlogvin commented on May 27, 2024 1

update:

It now works. I missed one part in the configuation, which was adding

networks:
            - sail

Now it identifies it and works like a charm.

So, the whole thing should look like this:

typesense:
        image: typesense/typesense:0.23.0
        environment:
            TYPESENSE_DATA_DIR: /data
            TYPESENSE_API_KEY: xyz
        volumes:
            - /tmp/typesense-server-data:/data
        ports:
            - "8108:8108"
        restart: "no"
        networks:
            - sail

from laravel-scout-typesense-driver.

dlogvin avatar dlogvin commented on May 27, 2024

Ah missed the small part container_name: typesense. It should be typesense instead of localhost for the hostname. closing this now

Hey @jaeyson, I'm experiencing the same exact issue. What do you mean with "It should be typesense instead of localhost for the hostname"?

from laravel-scout-typesense-driver.

jaeyson avatar jaeyson commented on May 27, 2024

@dlogvin im using docker-compose.yml as an example:

networks:
  appname:

services:
  typsense:
    image: typesense/typesense:0.23.0
    container_name: typesense
    environment:
      TYPESENSE_DATA_DIR: /data
      TYPESENSE_API_KEY: xyz
    volumes:
      - /tmp/typesense-server-data:/data
    ports:
      - "8108:8108"
    restart: "no"
    networks:
      appname:

Here I'm using typesense (container name) as the hostname instead of localhost or 127.0.0.1

also in scout.php, specifically host key part:

    'typesense' => [
        'api_key'         => env('TYPESENSE_ADMIN_API_KEY', 'xyz'),
        'nodes'           => [
            [
                'host'     => env('TYPESENSE_NODE', 'typesense'),
                'port'     => env('TYPESENSE_PORT', '8108'),
                'path'     => '',
                'protocol' => env('TYPESENSE_PROTOCOL', 'http'),
            ],
        ],
        'nearest_node'    => [
            'host'     => env('TYPESENSE_NODE', 'typesense'),
            'port'     => env('TYPESENSE_PORT', '8108'),
            'path'     => '',
            'protocol' => env('TYPESENSE_PROTOCOL', 'http'),
        ],
        'connection_timeout_seconds'   => 2,
        'healthcheck_interval_seconds' => 30,    
        'num_retries'                  => 3,
        'retry_interval_seconds'       => 1,
    ],

from laravel-scout-typesense-driver.

dlogvin avatar dlogvin commented on May 27, 2024

@dlogvin im using docker-compose.yml as an example:

networks:
  appname:

services:
  typsense:
    image: typesense/typesense:0.23.0
    container_name: typesense
    environment:
      TYPESENSE_DATA_DIR: /data
      TYPESENSE_API_KEY: xyz
    volumes:
      - /tmp/typesense-server-data:/data
    ports:
      - "8108:8108"
    restart: "no"
    networks:
      appname:

Here I'm using typesense (container name) as the hostname instead of localhost or 127.0.0.1

also in scout.php, specifically host key part:

    'typesense' => [
        'api_key'         => env('TYPESENSE_ADMIN_API_KEY', 'xyz'),
        'nodes'           => [
            [
                'host'     => env('TYPESENSE_NODE', 'typesense'),
                'port'     => env('TYPESENSE_PORT', '8108'),
                'path'     => '',
                'protocol' => env('TYPESENSE_PROTOCOL', 'http'),
            ],
        ],
        'nearest_node'    => [
            'host'     => env('TYPESENSE_NODE', 'typesense'),
            'port'     => env('TYPESENSE_PORT', '8108'),
            'path'     => '',
            'protocol' => env('TYPESENSE_PROTOCOL', 'http'),
        ],
        'connection_timeout_seconds'   => 2,
        'healthcheck_interval_seconds' => 30,    
        'num_retries'                  => 3,
        'retry_interval_seconds'       => 1,
    ],

@jaeyson I tried this yesterday. Unfortunately doesn't work still 🥲

I'm getting a cURL error 6: Could not resolve host: typesense

from laravel-scout-typesense-driver.

jaeyson avatar jaeyson commented on May 27, 2024

can you show me your setup?

when you curl http://localhost:8108/health, does it return {"ok":true}?

from laravel-scout-typesense-driver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.