Open michaelroyzen opened 4 years ago
@supportudevoffice
I have just extended my premium support.
Hi, @michaelroyzen! I've looked over your question and we can help you by giving you some tutorials about how to make this setup. Please see this links:
I hope this will help you!
Regards, Dragos
Hi Dragos,
The project comes pre-configured with haproxy. Using docker-compose up
creates a haproxy server, but it says that: haproxy_1 | [WARNING] 078/143244 (6) : Server server/argon-1 is DOWN, reason: Layer4 connection problem, info: "Connection refused", check duration: 145ms. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
haproxy_1 | [ALERT] 078/143244 (6) : backend 'server' has no server available!
The provided server in haproxy.cfg is 157.230.124.2, but there seems to be nothing there.
I look forward to hearing from you.
I am asking this question because it seems that the provided haproxy deployment in this project is broken and needs fixing, or at least needs some sort of documentation.
Hi @michaelroyzen, In the haproxy.cfg file found in the project root directory, please edit line 12 and change the "157.230.124.2:8000" address with the IP and port of the server that you run your backend on.
Haproxy checks wether the server it tries to proxy is available and errors out if it is not.
A more important note would be to not use the docker images for the provided services [Postgres, Redis and HAProxy] in production unless you know how to properly configure them. The ones added are meant to be as an example and should be configured accordingly to suit your needs.
Hi @spanciu, thank you for your response. I would appreciate a more detailed guide on how to run this in production. To run in development, I simply call "yarn dev" to launch the development server at http://localhost:8000. However, how do I run the server in a production environment? I need guidance on this so I can know what to put into the haproxy configuration. Thank you.
First of all @michaelroyzen , I would like to know what you have tried to do and what did not work, in order to guide you more. Also, some more information would be nice. What server are you trying to load the app on? How are you building the app? What OS is the server using? Are you using the haproxy docker image or have you installed haproxy directly onto the server machine? Do you have a server for the frontend and one for the backend? Have you tried using any information found in the articles suggested by @dragosct10 ? You could also find more information regarding haproxy on the following links: https://www.digitalocean.com/community/tutorials/an-introduction-to-haproxy-and-load-balancing-concepts https://www.haproxy.com/blog/the-four-essential-sections-of-an-haproxy-configuration/ Thanks!
@spanciu I have tried running node app.js
and then changing the haproxy.cfg file to localhost:8000 (the port specified in the ENV file, and making sure to restart the docker container). I am trying to load the app on Ubuntu 18.04 and I am using the provided docker images in Argon. However, what matters more than what I have tried is how to run your company's project properly.
Other than the haproxy.cfg change (per your advice), I am using the default configurations that were given to me when I purchased a $160 product from your company. Instructions for running in production is something that should have been provided out of the box. Please give me instructions on how to run the Argon Dashboard Node.js Pro in production properly, similar to how instructions were provided in the docs to run it in development properly. Given how much money I spent, I would appreciate specific instructions and not a generic tutorial. Thank you.
Hi @michaelroyzen ,
Even though nowhere in the app it mentions that the app should be ran using node app.js
command, here are the step by step instructions to have the production environment up and running on your server.
frontend localnodes
bind *:80
mode http
default_backend server
backend server
mode http
balance roundrobin
option forwardfor
http-request set-header X-Forwarded-Port %[dst_port]
http-request add-header X-Forwarded-Proto https if { ssl_fc }
option httpchk HEAD / HTTP/1.1\r\nHost:your.server.ip.address
server node1 your.server.ip.address:your.defined.port check
where obviously your.server.ip.address and your.defined.port are the ones that you're using.
npm install
npm run gulp build
npm run start:staging
Thank you, Florin.
Thank you @spanciu. This is all I was asking for, and it would be great if this could be added to the documentation as I am sure it will help others as well. Additionally, it would be great if you could address my issue with charts as well, available at #6. Thanks!
How should this project be deployed to haproxy in production?