grimoirelab-elk
grimoirelab-elk copied to clipboard
[Sortinghat] The port of database is always `3306` and is not supported to be changed as we want
https://github.com/chaoss/grimoirelab-elk/blob/1b2ccbd2b4bd4760ea884c47795c4defee67d2c6/grimoire_elk/enriched/enrich.py#L119-L133
I deployed my database on my host with other port instead of 3306.
And I couldn't connect my database unless changing the port to 3306 (But for some reason, I couldn't use this port).
From the above code, we can known that the port is always 3306.
What I want
We can change this value as we want.
And currently, I add new parameter db_port to enrich_backend and pass it to xxxEnrich and Enrich (There are too many backends, thus I just modified those backends what I want and use)
https://github.com/chaoss/grimoirelab-elk/blob/1b2ccbd2b4bd4760ea884c47795c4defee67d2c6/grimoire_elk/elk.py#L488-L489
Whether the value of the port would be supported to be changed in the future verson?
Hi @xiao623,
By default, Sortinghat use the port 3306. When ELK connect to the database no port is passed to Sortinghat https://github.com/chaoss/grimoirelab-elk/blob/1b2ccbd2b4bd4760ea884c47795c4defee67d2c6/grimoire_elk/enriched/enrich.py#L131-L132
At first glance, you can add port to:
- https://github.com/chaoss/grimoirelab-elk/blob/master/grimoire_elk/elk.py#L440
- https://github.com/chaoss/grimoirelab-sirmordred/blob/master/sirmordred/task_enrich.py#L177
- https://github.com/chaoss/grimoirelab-sirmordred/blob/master/sirmordred/config.py#L356
Then you can use it in setup.cfg as the host parameter.
I hope it helps you.
Best, Quan
Hi @zhquan,
That was what i had done. And we also need to pass the port to those enrich backends to create the database connector.
But there are too many backends, thus I just modified those backends what I want and use.
Whether the value of the port would be supported to be changed in the future verson? If not, this issue could be closed.
Now we are using a different version of SortingHat and the port can be defined using the configuration from Mordred.