I come back on a subject already discuss with no real solution on a system approach.
I start a docker stack with a yb-master and a yb-tserver. This stack must be use by an other application but this one can’t start because it miss a table and a piece of sql code is given to create this table.
I thought “nice, yugabytedb is postgres compatible, I could the a initdb start to inject my sql”. After a while I read this subject who said in sumary that this feature is not implemented.
Well , searching again I found this one where @FranckPachot propose to use a third docker service to inject the code. Right , I’m not so bad because I thought to the same thing. But When I’m trying this way, it does’nt work. My yb-tserve refuse the connection with this message :
LOG: invalid length of startup packet
Is t here someone who have an idea to soluce this situation ?
PS > I’m an sysadmin, not a dev
yugabytedb-init-tserver-1 | Connection error: (‘Unable to connect to any servers’, {‘192.168.176.2’: ConnectionShutdown(‘Connection to 192.168.176.2 was closed’,)})
yugabytedb-init-tserver-1 exited with code 1
The log from yb-tserver is :
yugabytedb-yb-tserver-1 | 2023-08-03 11:05:29.255 UTC [110] LOG: invalid length of startup packet
I think I got it. In your docker compose, I see bin/ycqlsh -f ./initdb.sql and CQLSH variables. Note that the PostgreSQL API is YSQL (and the command line is ysqlsh. YCQL is the cassandra like API. invalid length of startup packet may come from sending to the PostgreSQL endpoint (5433) from with the Cassandra protocol.
I’m not sure to understand.
Do you mean I can launch my services yb-master and yb-tserver with a starting sql script who will initialise my database ?
If yes, how can I do that ? I try a lot of things without success.
( I note you’re Swiss, may be you speak french ? )
Oui
En fait yugabyted (d pour daemon) est un utilitaire qui lance les yb-master et yb-tserver et fait des choses en plus, comme lancer un script d’init: yugabyted reference | YugabyteDB Docs
Merci beaucoup, je vais regarder tout cela, n’ayant pas réussi a lancé yugabyted pour créer un cluster je n’étais pas aller plus loin. Je me suis raté quelque part de toute évidence.
Merci pour ces liens je vais regarder de plus près.
Et navré @FranckPachot , de retour avec une question. J’ai tenté d’utiliser le flag --config dans le lancement du conteneur avec bin/yugabyted mais il me dit :
yugadb-yugabyte-1 | ERROR:root: | 0.0s | Failed to read config file /home/yugabyte/yugabyte.conf: Expecting value: line 1 column 1 (char 0)
yugadb-yugabyte-1 | Failed to read config file /home/yugabyte/yugabyte.conf: Expecting value: line 1 column 1 (char 0)
Ah oui, ce fichier de config est en format JSON.
Mais je ne pense pas que ce soit possible de passer des paramètres. C’est yugabyted qui y met les paramètres pour le prochain restart
La doc devrait le préciser, merci pour le feedback