Hi guys, i am beginning my journey with typesense ...
# community-help
e
Hi guys, i am beginning my journey with typesense and i am having a very hard time right at the start. I installed the RPM package and checked that the service is running with sudo systemctl status typesense-server.service which returns:
โ— typesense-server.service - Typesense Server
Loaded: loaded (/etc/systemd/system/typesense-server.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2022-01-14 20:05:34 -03; 46s ago
Docs: <https://typesense.org>
Main PID: 32021 (typesense-serve)
Tasks: 1 (limit: 9354)
Memory: 7.5M
CPU: 36ms
CGroup: /system.slice/typesense-server.service
โ””โ”€32021 /usr/bin/typesense-server --config=/etc/typesense/typesense-server.ini
Jan 14 20:05:34 localhost.localdomain systemd[1]: Started Typesense Server.
The problem is that i can't check even it's health with
Copy code
curl <http://localhost:8108/health>
because it returns:
curl: (7) Failed to connect to localhost port 7700 after 0 ms: Connection refused
here is what i have at my .ini:
api-address = 0.0.0.0
api-port = 7700
data-dir = /var/lib/typesense
api-key = H9cEaPyq1PxEz0BwvITWPV51oObTmOoVYyDpu5x3JcfOsgVU
log-dir = /var/log/typesense
one last observation is that when i try sudo lsof -i -P -n | grep LISTEN ,i can't see typesense running at any port:
systemd-r   815 systemd-resolve   11u  IPv4  29709      0t0  TCP *:5355 (LISTEN)
systemd-r   815 systemd-resolve   13u  IPv6  29712      0t0  TCP *:5355 (LISTEN)
systemd-r   815 systemd-resolve   17u  IPv4  29715      0t0  TCP 127.0.0.53:53 (LISTEN)
mongod      962          mongod   11u  IPv4  23132      0t0  TCP 127.0.0.1:27017 (LISTEN)
cupsd      1019            root    7u  IPv6  23292      0t0  TCP [::1]:631 (LISTEN)
cupsd      1019            root    8u  IPv4  23293      0t0  TCP 127.0.0.1:631 (LISTEN)
mariadbd   1085           mysql   20u  IPv6  20119      0t0  TCP *:3306 (LISTEN)
teamviewe  1286            root   12u  IPv4  30254      0t0  TCP 127.0.0.1:5939 (LISTEN)
dnsmasq    1423         dnsmasq    6u  IPv4  30506      0t0  TCP 192.168.122.1:53 (LISTEN)
node       4430        feimberg   21u  IPv4  50799      0t0  TCP 127.0.0.1:3000 (LISTEN)
code      28384        feimberg   50u  IPv4 292232      0t0  TCP 127.0.0.1:34691 (LISTEN)
code      28384        feimberg  187u  IPv4 316081      0t0  TCP 127.0.0.1:8828 (LISTEN)
j
@Edson Feimberg May I know what OS and version you're running?
e
i am running fedora 35
j
Looks like Fedora 35 was also released in the Nov / Dec timeframe. Could you try with the RC build on that thread?
e
i am trying to have a look. i am stucket at Launching Typesense Community in the moment
j
e
i will try now
Copy code
export TYPESENSE_API_KEY=xyz
mkdir /tmp/typesense-data
./typesense-server --data-dir=/tmp/typesense-data --api-key=$TYPESENSE_API_KEY
i whould this command after downloading it, right?
j
Yup
This will start it on port 8108
e
ยป export TYPESENSE_API_KEY=xyz feimberg@localhost mkdir /tmp/typesense-data ./typesense-server --data-dir=/tmp/typesense-data --api-key=$TYPESENSE_API_KEY zsh: no such file or directory: ./typesense-server
j
Oh you also have to extract the downloaded file first:
tar -xf <downloaded file>
e
message has been deleted
is this it?
j
Hang on
Wrong link again ๐Ÿคฆโ€โ™‚๏ธ
e
haha, no problem. i am happy that you're trying to help. very kind from you
๐Ÿ˜€ 1
j
Same process as above, download, extract and then that snippet to start Typesense server should work now ๐Ÿคž
e
I guess it worked
/typesense-server-0.23.0.rc5-linux-amd64 ยป export TYPESENSE_API_KEY=xyz                                                                             feimberg@localhost
mkdir /tmp/typesense-data
./typesense-server --data-dir=/tmp/typesense-data --api-key=$TYPESENSE_API_KEY
I20220114 20:43:29.778288 35000 typesense_server_utils.cpp:309] Starting Typesense 0.23.0.rc5
I20220114 20:43:29.778337 35000 typesense_server_utils.cpp:312] Typesense is using jemalloc.
I20220114 20:43:29.778604 35000 typesense_server_utils.cpp:361] Thread pool size: 64
I20220114 20:43:29.783207 35000 store.h:61] Initializing DB by opening state dir: /tmp/typesense-data/db
I20220114 20:43:29.787039 35000 store.h:61] Initializing DB by opening state dir: /tmp/typesense-data/meta
I20220114 20:43:29.791628 35000 typesense_server_utils.cpp:440] Starting API service...
I20220114 20:43:29.791741 35186 typesense_server_utils.cpp:212] Since no --nodes argument is provided, starting a single node Typesense cluster.
I20220114 20:43:29.791766 35000 http_server.cpp:172] Typesense has started listening on port 8108
I20220114 20:43:29.791785 35187 batched_indexer.cpp:120] Starting batch indexer with 64 threads.
I20220114 20:43:29.793962 35187 batched_indexer.cpp:126] BatchedIndexer skip_index: -9999
I20220114 20:43:29.795977 35186 server.cpp:1045] Server[braft::RaftStatImpl+braft::FileServiceImpl+braft::RaftServiceImpl+braft::CliServiceImpl] is serving on port=8107.
I20220114 20:43:29.795994 35186 server.cpp:1048] Check out <http://localhost.localdomain:8107> in web browser.
I20220114 20:43:29.796392 35186 raft_server.cpp:65] Nodes configuration: 192.168.0.19:8107:8108
I20220114 20:43:29.796422 35186 raft_server.cpp:104] Snapshot does not exist. We will remove db dir and init db fresh.
I20220114 20:43:29.797003 35186 store.h:283] rm /tmp/typesense-data/db success
I20220114 20:43:29.797029 35186 store.h:61] Initializing DB by opening state dir: /tmp/typesense-data/db
I20220114 20:43:29.800000 35186 store.h:307] DB open success!
I20220114 20:43:29.800010 35186 raft_server.cpp:469] Loading collections from disk...
I20220114 20:43:29.800024 35186 collection_manager.cpp:117] CollectionManager::load()
I20220114 20:43:29.800041 35186 auth_manager.cpp:32] Indexing 0 API key(s) found on disk.
I20220114 20:43:29.800046 35186 collection_manager.cpp:137] Loading 32 collections in parallel, 1000 documents at a time.
I20220114 20:43:29.800052 35186 collection_manager.cpp:144] Found 0 collection(s) on disk.
I20220114 20:43:29.800730 35186 collection_manager.cpp:206] Loaded 0 collection(s).
I20220114 20:43:29.801347 35186 collection_manager.cpp:210] Initializing batched indexer from snapshot state...
I20220114 20:43:29.801362 35186 raft_server.cpp:476] Finished loading collections from disk.
I20220114 20:43:29.801625 35186 log.cpp:674] Use crc32c as the checksum type of appending entries
W20220114 20:43:29.801651 35186 protobuf_file.cpp:91] open file failed, path: /tmp/typesense-data/state/log/log_meta: FILE_ERROR_NOT_FOUND
W20220114 20:43:29.801656 35186 log.cpp:685] /tmp/typesense-data/state/log is empty
I20220114 20:43:29.801712 35186 log.cpp:1136] log save_meta /tmp/typesense-data/state/log/log_meta first_log_index: 1 time: 40
W20220114 20:43:29.801738 35186 protobuf_file.cpp:91] open file failed, path: /tmp/typesense-data/state/meta/raft_meta: FILE_ERROR_NOT_FOUND
I20220114 20:43:29.801749 35186 raft_meta.cpp:521] Loaded single stable meta, path /tmp/typesense-data/state/meta term 1 votedfor 0.0.0.0:0:0 time: 10
W20220114 20:43:29.801792 35186 protobuf_file.cpp:91] open file failed, path: /tmp/typesense-data/state/meta/raft_meta: FILE_ERROR_NOT_FOUND
I20220114 20:43:29.801800 35186 raft_meta.cpp:521] Loaded single stable meta, path /tmp/typesense-data/state/meta term 1 votedfor 0.0.0.0:0:0 time: 8
I20220114 20:43:29.801807 35186 node.cpp:576] node default_group:192.168.0.19:8107:8108 init, term: 1 last_log_id: (index=0,term=0) conf: 192.168.0.19:8107:8108 old_conf:
I20220114 20:43:29.801826 35186 node.cpp:1549] node default_group:192.168.0.19:8107:8108 term 1 start vote and grant vote self
I20220114 20:43:29.801856 35186 raft_meta.cpp:546] Saved single stable meta, path /tmp/typesense-data/state/meta term 2 votedfor 192.168.0.19:8107:8108 time: 19
I20220114 20:43:29.801863 35186 node.cpp:1783] node default_group:192.168.0.19:8107:8108 term 2 become leader of group 192.168.0.19:8107:8108
I20220114 20:43:29.802163 35186 raft_server.cpp:127] Node last_index: 0
I20220114 20:43:29.802172 35186 typesense_server_utils.cpp:263] Typesense peering service is running on 192.168.0.19:8107
I20220114 20:43:29.802178 35186 typesense_server_utils.cpp:264] Snapshot interval configured as: 3600s
W20220114 20:43:29.802186 35186 controller.cpp:1454] SIGINT was installed with 1
I20220114 20:43:29.802199 35186 raft_server.cpp:524] Term: 2, last_index index: 0, committed_index: 0, known_applied_index: 0, applying_index: 0, queued_writes: 0, pending_queue_size: 1, local_sequence: 0
W20220114 20:43:29.802206 35186 node.cpp:811] [default_group:192.168.0.19:8107:8108 ] Refusing concurrent configuration changing
`I20220114 204329.802217 35219 log.cpp:108] Created new segment
/tmp/typesense-data/state/log/log_inprogress_00000000000000000001' with fd=23
E20220114 20:43:29.802227 35186 raft_server.cpp:578] Node not ready yet (known_applied_index is 0).
I20220114 20:43:29.802286 35219 raft_server.h:251] Configuration of this group is 192.168.0.19:8107:8108
I20220114 20:43:29.802299 35219 node.cpp:3142] node default_group:192.168.0.19:8107:8108 reset ConfigurationCtx, new_peers: 192.168.0.19:8107:8108, old_peers: 192.168.0.19:8107:8108
I20220114 20:43:29.802310 35219 raft_server.h:234] Node becomes leader, term: 2
E20220114 20:43:29.802330 35215 raft_server.h:61] Peer refresh failed, error: Doing another configuration change
I20220114 20:43:39.803575 35186 raft_server.cpp:524] Term: 2, last_index index: 1, committed_index: 1, known_applied_index: 1, applying_index: 0, queued_writes: 0, pending_queue_size: 0, local_sequence: 0
I20220114 20:43:39.803764 35219 raft_server.h:59] Peer refresh succeeded!
j
Peer refresh succeeded!
You're all set!
e
thank you SO MUCH. Health check worked. Can i have a hint at what was happening? some kind of incompatibility between the rpm package and this version of fedora?
j
e
I lost to much time trying to figure it mysef ๐Ÿ˜ญ๐Ÿ˜ญ. Maybe we should try to update the docs? i can help with the docs. Only problem is that my english is not perfect
j
So sorry about that ๐Ÿ˜ž I'm in the process of updating the docs for something else, so I'll just update it along with the other changes
e
I discovered your work at the hyperstack interview and i was amazed but what you guys showed. I am trying to drop our algolia dependency because of their CRAZY price model that charges both by requests and for indexations. I also experimented with Meilisearch and to be honest i had an easier time quickly installing and testing their product at my local machine, but they have some limitations regarding functionalities that was important for us like multi-index searching. Anyway, very hyped to work with typesense now, specially after this very kind and precise help!
j
Thank you for the context and the feedback! ๐Ÿ™ If I had a dollar for every time I've heard about Algolia's pricing... Besides the installation issue and the lack of documentation around it, any other things we can improve with Typesense?
e
tomorrow i will try to migrate our indexes to typesense https://github.com/typesense/laravel-scout-typesense-driver. I will try to keep generating some usefull feedback for you guys!
j
Thanks @Edson Feimberg!
โค๏ธ 1
Added a note to the docs about using the latest RC build on latest versions of Linux distros: https://typesense.org/docs/guide/install-typesense.html#rpm-package-on-centos-rhel
๐Ÿ™Œ 1