In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the example analysis of HAProxy, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
HAProxy is an agent software that provides high availability, load balancing and applications based on TCP (layer 4) and HTTP (layer 7). It supports virtual hosts. It is a free, fast and reliable solution. HAProxy is especially suitable for heavily loaded web sites, which usually require session persistence or seven-tier processing. HAProxy runs on today's hardware and can support tens of thousands of concurrent connections.
1. Install haproxy
CentOS comes with haproxy, but the version may be older. The latest stable version of haproxy can be found on the IIS source.
Cat / yum.repos.d/ius.repo [ius] name=iusrepobaseurl= https://mirrors.tuna.tsinghua.edu.cn/ius/stable/CentOS/$releasever/\$basearchgpgcheck=0enable=1eofyum-y install haproxy17u
The following is the process of compiling and installing haproxy-1.7.10.
When compiling and installing haproxy, you can rely on the pcre environment, where the compilation speed is much faster with the help of regular expression analysis, but it can be installed without this environment.
Yum-y install pcre pcre-develtar xf haproxy-1.7.10.tar.gzcd haproxy-1.7.10make TARGET=linux2628 ARCH=x86_64 PREFIX=/usr/local/haproxy USE_PCRE=1make install PREFIX=/usr/local/haproxy
When make, you need to use TARGET to specify the kernel and version, which are as follows:
-linux22 for Linux 2.2-linux24 for Linux 2.4 and above (default)-linux24e for Linux 2.4 with support for a working epoll (> 0.21)-linux26 for Linux 2.6 and above- linux2628 for Linux 2.6.283.x And above (enables splice and tproxy)-solaris for Solaris 8 or 10 (others untested)-freebsd for FreeBSD 5 to 10 (others untested)-netbsd for NetBSD- osx for Mac OS/X- openbsd for OpenBSD 5.7 and above- aix51 for AIX 5.1-aix52 for AIX 5.2-cygwin for Cygwin- haiku for Haiku- generic for any other OS or version.- custom to manually adjust every setting
Use ARCH to specify the schema, but the ARCH option is saved. Using USE_PCRE=1 means to compile in a PCRE environment to speed up the compilation.
After the compilation and installation is complete, there are only three directories: doc, share, and sbin,sbin. There is only one haproxy main program, haproxy. To facilitate the management of haproxy services, you can copy / etc/init.d/haproxy from the haproxy installed by yum.
2.haproxy command
Several commonly used ones:
# check the configuration file syntax haproxy-c-f / etc/haproxy/haproxy.cfg# starts in daemon mode, starts haproxy-D-f / etc/haproxy/haproxy.cfg [- p / var/run/haproxy.pid] haproxy-Ds-f / etc/haproxy/haproxy.cfg [- p / var/run/haproxy.pid] # in systemd managed daemon mode, and all connection and processing information will be displayed on the screen haproxy-d-f / etc/haproxy/haproxy.cfg# restart. You need to use the st option to specify the pid list haproxy-f / etc/haproxy.cfg [- p / var/run/haproxy.pid]-st `cat / var/run/ haproxy.pid` # graceful restart, namely reload. You need to use the sf option to specify the pid list haproxy-f / etc/haproxy.cfg [- p / var/run/haproxy.pid]-sf `cat / var/run/ haproxy.pid` # to display the haproxy compilation and startup information haproxy-vv thank you for reading this article carefully. I hope the article "sample Analysis of HAProxy" shared by the editor will be helpful to you. At the same time, I hope you will support it and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.