How to add server dynamically in HA proxy backend? - tcp

I am using HA proxy version 1.6.6 for load balancing rabbitmq server, and it works fine but i want to add server dynamically in ha proxy backend in ubuntu using script. can anyone please tell me how can i done it?

HAProxy OSS v1.8 does not include add/remove commands in Runtime API, but you can achieve similar functionality by using ready/disabled state commands.
Add server(s) config in haproxy.cfg in disabled state: server-template websrv 1-100 192.168.122.1:8080 check disabled //This adds 100 servers (websrv1...websrv100) in disabled state
Enable server (similar to add feature): set server be_template/websrv1 state ready
Disable server (similar to remove feature): set server be_template/websrv1 state maint
Address and port can be changed using Runtime API as usual: set server be_template/websrv1 addr 192.168.50.112 port 8000
Reference(s):
https://www.haproxy.com/blog/dynamic-configuration-haproxy-runtime-api/
https://www.haproxy.com/blog/dynamic-scaling-for-microservices-with-runtime-api/

As far as I know haproxy api ( stats socket ) does not support dynamic adding/removing servers to backend.
One of the solution to use consul, the cost - reload service after some change.
https://www.hashicorp.com/blog/haproxy-with-consul.html

I think there is not this kind of features with HAProxy Open Source.
If you use their ALOHA Load Balancer, there is an API to do this actions here :
https://www.haproxy.com/resources/documentation/

Related

How can I use TCP instead of UDP for WebRTC publish/play in Ant Media Server?

I'm using Ant Media Server on AWS and it works perfectly fine. However, some of our users have blocked UDP ports and therefore I want to know if it is possible to use TCP instead of UDP for WebRTC.
And with this in your User data in AWS you'll get the current instance public IP inserted automatically on boot:
sed -i "s/server.name=.*/server.name=$(curl -s http://169.254.169.254/latest/meta-data/public-ipv4)/g" /usr/local/antmedia/conf/red5.properties
Yes, we can make use of TCP ports for WebRTC.
Please open TCP Port range 50000-60000 on the AWS Security group (for AMS v2.4.2.1 and above, for older version use port range 5000-65000).
Go to the Application settings:
/usr/local/antmedia/webapps/<AppName>/WEB-INF/red5-web.properties
Edit the red5-web.properties file and set
settings.webrtc.tcpCandidateEnabled=true
Restart Ant Media Server
sudo service antmedia restart
If you are using a cloud service like OVH or if there is pubic IP directly associated with the instance, then webrtc should work.
If you are using a cloud service like AWS with private/public IP, then some additional settings are required to be configured.
Go to server configuration settings
/usr/local/antmedia/conf/red5.properties
Edit the red5.properties file and set
server.name=Instance_Public_IP
Go to the application settings again and edit the red5-web.properties
/usr/local/antmedia/webapps/<AppName>/WEB-INF/red5-web.properties
set
settings.replaceCandidateAddrWithServerAddr=true
Save the settings and restart Ant Media server
sudo service antmedia restart
Webrtc should work fine afterwards.
Thank you.
antmedia.io

When I run my daemon the service is a http proxy instead off http

I am currently running a service with systemctl, and it is running as an http proxy, not normal http. Is this something that Google does? I am using port 8080 and I can't connect to it via http. My daemon is using port 8080, while using the type http-proxy (I am seeing this with the command nmap -sV -sC -p 8080 35.208.25.61 -vvvv -Pn). Instead, I want the daemon I'm running (wings.service) to use http, so it can use that type of connection to connect to my panel.
The panel is part of a piece of software along with the daemon, it's called pterodactyl. Anyways, I have tried everything on what to do, and I think this problem that I am addressing is the problem that causes dysfunction on my panel. I might just have to move to a different service to host my bots for discord.
Let me know if there's anything I can do to fix this.
As per I can understand you are unable to access the panel via web URL.
Pterodactyl web server can be installed using NGINX or Apache web servers, and both web servers by default listed on port 80 based on Pterodactyl web server installation guide, so you must enable HTTP port 80 traffic on your Compute Engine VM instance
The default firewall rules on GCP do not allow HTTP or HTTPS connections to your instances. However, it is fairly simple to add a rule that does allow them following this steps:
1.-Go to the VM instances page.
2.- Click the name of the desired instance.
3.- Click Edit button at the top of the page.
4.- Scroll down to the Firewalls section.
5.- Check the Allow HTTP or Allow HTTPS options under your desired VPC network.
6.- Click Save.
Note: The Pterodactyl panel and Daemon installation are not the same for each operating system, if after checking the VPC firewall rules on the VM settings and also the status of the web server in the instance (NGINX or Apache) you still cannot access your panel, please provide a step by step list with all commands you followed to complete the installation, including the OS version you used.

IMAP Proxy that can connect to multiple IMAP servers

What I am trying to achieve is to have a central Webmail client that I can use in a ISP envioroment but has the capability to connect to multiple mail servers.
I have now been looking at Perdition, NGINX and Dovecot.
But most of the articles have not been updated for a very long time.
The one that I am realy looking at is NGINX imap proxy as it can almost do everything i require.
http://wiki.nginx.org/ImapAuthenticateWithEmbeddedPerlScript
But firstly the issue I have is you can no longer compile NGINX from source with those flags.
And secondly the GitRepo for this project https://github.com/falcacibar/nginx_auth_imap_perl
Does not give detailed information about the updated project.
So all I am trying to achieve is to have one webmail server that can connect to any one of my mailservers where my location is residing in a database. But the location is a hostname and not a IP.
You can tell Nginx to do auth_http with any http URL you set up.
You don't need an embedded perl script specifically.
See http://nginx.org/en/docs/mail/ngx_mail_auth_http_module.html to get an idea of the header based protocol Nginx uses.
You can implement the protocol described above in any language - CGI script with apache if you like.
You do the auth and database query and return the appropriate backend servers in this script.
(Personally, I use a python + WSGI server setup.)
Say you set up your script on apache at http://localhost:9000/cgi-bin/nginx_auth.py
In your Nginx config, you use:
auth_http http://localhost:9000/cgi-bin/nginx_auth.py

Coherence cache for.net client

I am trying to access a coherence cache using .net client.The cluster is already set up , all I have to do is to access the coherence cache from the client side and get the objects from the cacheservice . As of now I have the coherence dll and the client config .what else should I do ?
You should check the 'Developing Remote Clients for Oracle Coherence' guide,
specifically client side configuration:
http://docs.oracle.com/middleware/1212/coherence/COHCG/gs_configextend.htm#BEBEGIAE
The link included in the other answer is a great start. Basically:
You run at least one "proxy" in the cluster
You configure the client to point to the proxy or proxies (or a load balancer in front of the proxies)
You use the Coherence C# API in .NET and it finds the configuration and connects to proxy

Configuring LCDS HTTPProxy service behind a firewall

I have an LCDS server sitting behind a corporate proxy/firewall.
I need to use a configured HTTPProxyService on the LCDS server to make requests out to beyond the firewall (can't go directly from the client because of crossdomain.xml issues)
How do I configure LCDS to use the corporate proxy on it's outbound requests?
Docs ftw:
http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/lcds/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=rpc_config_4.html
Use the <external-proxy /> tag.
LCDS is using Apache HTTP client in order to establish a connection through an external proxy. All the parameters from the tag are going to be used in order to initialize an org.apache.commons.httpclient.UsernamePasswordCredentials instance (or NTCredentials).
I think that first it's easier if you build a standalone java application using HTTP client to use your corporate proxy (easier from a testing point of view), and after you succeed to find all the settings you can add them into proxy-service.xml (I can help you with that).

Resources