如何在Windows系统中mysql主从配置windowsMysql群集

如何在Windows系统中配置Mysql群集_百度知道
如何在Windows系统中配置Mysql群集
提问者采纳
管理节点(也可以称管理服务器)主要负责管理数据节点和SQL节点,能够启动,当数据节点有新事件时就把事件信息发送给管理节点并写入群集日志。3,每台计算机的角色可能是不一样的。SQL节点跟一般的MySQL服务器是一样的,可以通过它进行SQL操作。它监控其他节点的工作状态1, MySQL群集需要有一组计算机。这三种节点只是在逻辑上的划分,还有群集配置文件和群集日志文件,也可能是两种或三种节点的集合:管理节点、数据节点和SQL节点。2,所以它们不一定和物理计算机是一一对应的关系。群集中的某计算机可能是某一种节点、关闭或重启某个节点。
下图中画出了三种群集节点及应用程序间的关系。其他节点从管理节点检索配置数据, 数据节点用于存储数据。MySQL群集中有三种节点
来自团队:
其他类似问题
为您推荐:
群集的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁windows下tomcat集群配置(两种方法)
发布时间: 11:12:02
两种方法只是在配置上不同原理一样,因为2.X后其自身集成了mod_jk功能,相对于1.3版本,不需要再进行繁琐的worker.properties配置,配置过程大幅简化。
一、软件需求  操作系统:Windows XP   JDK:jdk1.6.0_16,下载地址:/technetwork/java/javase/downloads/index.html 。  Apache :httpd-2.2.17 (一个),下载地址:http://httpd.apache.org/ 。   Tomcat:tomcat-7.0.2 (两个),下载地址:http://tomcat.apache.org/download-70.cgi 。   mod_jk:mod_jk-apache-2.0.55.so (1个),下载地址:http://tomcat.apache.org/download-70.cgi 。
二、环境搭建
  安照上篇中的方法安装jdk/apache/tomcat
三、环境配置(两种配置)
  1. &原始配置
    (1)apache配置
       1&mod_jk.conf(apache/conf)
mod_jk.conf&
1 # 加载mod_jk模块,此处的mod_jk.so为你复制到modules/下的mod_jk名
2 LoadModule jk_module modules/mod_jk-apache-2.2.2.so
3 # 指定 workers.properties文件路径(指定tomcat监听配置文件地址
4 JkWorkersFile conf/workers.properties
5 # 设置日志存放路径
6 JkLogFile logs/mod_jk.log
7 # 设置日志级别 [debug/error/info]
8 JkLogLevel info
9 # 设置日志格式
10 JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
11 # JkOptions indicate to send SSL KEY SIZE,
12 JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
13 # JkRequestLogFormat set the request format
14 JkRequestLogFormat "%w %V %T"
16 #设置虚拟主机
17 #&VirtualHost localhost&
18 #如果非虚拟主机,将&VirtualHost localhost&和最后的&/VirtualHost&注释或者删除掉即可
19 #ServerAdmin localhost
20 #DocumentRoot E:/wwwroot
21 #&Directory "E:/wwwroot"&
22 #您的站点项目所在路径,应与tomcat中的目录设置相同,据说以上两个必须同时设置才可以生效,没有试过不同的时候会有什么情况
23 #ServerName localhost
24 #DirectoryIndex index.html index.htm index.jsp
25 #ErrorLog logs/shsc-error_log.txt
26 #CustomLog logs/shsc-access_log.txt common
27 #JkMount /servlet/* ajp13
28 #让Apache支持对servlet传送,用以Tomcat解析
29 #JkMount /*.jsp ajp13
30 #让Apache支持对jsp传送,用以Tomcat解析
31 #JkMount /*.do ajp13
32 #让Apache支持对.do传送,用以Tomcat解析
33 #&/VirtualHost&
35 #Send servlet for context /examples to worker named #ajp13,指定那些请求交给tomcat处理,"controller"为在workers.propertise里指定的负载分配控制器(让Apache支持对jsp传送,用以Tomcat解析)
36 JkMount /*.jsp controller
37 JkMount /*.do controller
38 JkMount /*.dd controller
39 JkMount /*.ee controller
40 JkMount /servlet/* controller
41 JkMount /gwyhr* controller
&&&&&&&&&&&&&&&&&&2&httpd.conf(apache/conf)
httpd.conf
2 # This is the main
configuration file.
It contains the
3 # configuration directives that give the server its instructions.
4 # See &URL:http://httpd.apache.org/docs/2.2& for detailed information.
5 # In particular, see
6 # &URL:http://httpd.apache.org/docs/2.2/mod/directives.html&
7 # for a discussion of each configuration directive.
9 # Do NOT simply read the instructions in here without understanding
10 # what they do.
They're here only as hints or reminders.
If you are unsure
11 # consult the online docs. You have been warned.
13 # Configuration and logfile names: If the filenames you specify for many
14 # of the server's control files begin with "/" (or "drive:/" for Win32), the
15 # server will use that explicit path.
If the filenames do *not* begin
16 # with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
17 # with ServerRoot set to "D:/Program Files/Apache Software Foundation/Apache2.2" will be interpreted by the
18 # server as "D:/Program Files/Apache Software Foundation/Apache2.2/logs/foo.log".
20 # NOTE: Where filenames are specified, you must use forward slashes
21 # instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
22 # If a drive letter is omitted, the drive on which httpd.exe is located
23 # will be used by default.
It is recommended that you always supply
24 # an explicit drive letter in absolute paths to avoid confusion.
27 # ServerRoot: The top of the directory tree under which the server's
28 # configuration, error, and log files are kept.
30 # Do not add a slash at the end of the directory path.
If you point
31 # ServerRoot at a non-local disk, be sure to point the LockFile directive
32 # at a local disk.
If you wish to share the same ServerRoot for multiple
33 # httpd daemons, you will need to change at least LockFile and PidFile.
35 ServerRoot "D:/Program Files/Apache Software Foundation/Apache2.2"
38 # Listen: Allows you to bind Apache to specific IP addresses and/or
39 # ports, instead of the default. See also the &VirtualHost&
40 # directive.
42 # Change this to Listen on specific IP addresses as shown below to
43 # prevent Apache from glomming onto all bound IP addresses.
45 #Listen 12.34.56.78:80
46 Listen 80
49 # Dynamic Shared Object (DSO) Support
51 # To be able to use the functionality of a module which was built as a DSO you
52 # have to place corresponding `LoadModule' lines at this location so the
53 # directives contained in it are actually available _before_ they are used.
54 # Statically compiled modules (those listed by `httpd -l') do not need
55 # to be loaded here.
57 # Example:
58 # LoadModule foo_module modules/mod_foo.so
60 LoadModule actions_module modules/mod_actions.so
61 LoadModule alias_module modules/mod_alias.so
62 LoadModule asis_module modules/mod_asis.so
63 LoadModule auth_basic_module modules/mod_auth_basic.so
64 #LoadModule auth_digest_module modules/mod_auth_digest.so
65 #LoadModule authn_alias_module modules/mod_authn_alias.so
66 #LoadModule authn_anon_module modules/mod_authn_anon.so
67 #LoadModule authn_dbd_module modules/mod_authn_dbd.so
68 #LoadModule authn_dbm_module modules/mod_authn_dbm.so
69 LoadModule authn_default_module modules/mod_authn_default.so
70 LoadModule authn_file_module modules/mod_authn_file.so
71 #LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
72 #LoadModule authz_dbm_module modules/mod_authz_dbm.so
73 LoadModule authz_default_module modules/mod_authz_default.so
74 LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
75 LoadModule authz_host_module modules/mod_authz_host.so
76 #LoadModule authz_owner_module modules/mod_authz_owner.so
77 LoadModule authz_user_module modules/mod_authz_user.so
78 LoadModule autoindex_module modules/mod_autoindex.so
79 #LoadModule cache_module modules/mod_cache.so
80 #LoadModule cern_meta_module modules/mod_cern_meta.so
81 LoadModule cgi_module modules/mod_cgi.so
82 #LoadModule charset_lite_module modules/mod_charset_lite.so
83 #LoadModule dav_module modules/mod_dav.so
84 #LoadModule dav_fs_module modules/mod_dav_fs.so
85 #LoadModule dav_lock_module modules/mod_dav_lock.so
86 #LoadModule dbd_module modules/mod_dbd.so
88 ######apache启用gzip压缩######
89 #加载mod_deflate.so模块
90 LoadModule deflate_module modules/mod_deflate.so
91 #对text/html text/php text/png text/jpg text/plain text/css text/xml text/javascript启用GZIP压缩
92 AddOutputFilterByType DEFLATE text/html text/php text/png text/jpg text/plain text/css text/xml text/javascript
93 #压缩级别 9 性能最佳
94 DeflateCompressionLevel 9
95 #启用deflate模块对本站点的所有输出进行GZIP压缩
96 SetOutputFilter DEFLATE
97 #############################
99 LoadModule dir_module modules/mod_dir.so
100 #LoadModule disk_cache_module modules/mod_disk_cache.so
101 #LoadModule dumpio_module modules/mod_dumpio.so
102 LoadModule env_module modules/mod_env.so
103 #LoadModule expires_module modules/mod_expires.so
104 #LoadModule ext_filter_module modules/mod_ext_filter.so
105 #LoadModule file_cache_module modules/mod_file_cache.so
106 #LoadModule filter_module modules/mod_filter.so
107 #LoadModule headers_module modules/mod_headers.so
108 #LoadModule ident_module modules/mod_ident.so
109 #LoadModule imagemap_module modules/mod_imagemap.so
110 LoadModule include_module modules/mod_include.so
111 #LoadModule info_module modules/mod_info.so
112 LoadModule isapi_module modules/mod_isapi.so
113 #LoadModule ldap_module modules/mod_ldap.so
114 #LoadModule logio_module modules/mod_logio.so
115 LoadModule log_config_module modules/mod_log_config.so
116 #LoadModule log_forensic_module modules/mod_log_forensic.so
117 #LoadModule mem_cache_module modules/mod_mem_cache.so
118 LoadModule mime_module modules/mod_mime.so
119 #LoadModule mime_magic_module modules/mod_mime_magic.so
120 LoadModule negotiation_module modules/mod_negotiation.so
121 #LoadModule proxy_module modules/mod_proxy.so
122 #LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
123 #LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
124 #LoadModule proxy_connect_module modules/mod_proxy_connect.so
125 #LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
126 #LoadModule proxy_http_module modules/mod_proxy_http.so
127 #LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
128 #LoadModule reqtimeout_module modules/mod_reqtimeout.so
129 #LoadModule rewrite_module modules/mod_rewrite.so
130 LoadModule setenvif_module modules/mod_setenvif.so
131 #LoadModule speling_module modules/mod_speling.so
132 #LoadModule ssl_module modules/mod_ssl.so
133 #LoadModule status_module modules/mod_status.so
134 #LoadModule substitute_module modules/mod_substitute.so
135 #LoadModule unique_id_module modules/mod_unique_id.so
136 #LoadModule userdir_module modules/mod_userdir.so
137 #LoadModule usertrack_module modules/mod_usertrack.so
138 #LoadModule version_module modules/mod_version.so
139 #LoadModule vhost_alias_module modules/mod_vhost_alias.so
141 &IfModule !mpm_netware_module&
142 &IfModule !mpm_winnt_module&
144 # If you wish httpd to run as a different user or group, you must run
145 # httpd as root initially and it will switch.
147 # User/Group: The name (or #number) of the user/group to run httpd as.
148 # It is usually good practice to create a dedicated user and group for
149 # running httpd, as with most system services.
151 User daemon
152 Group daemon
154 &/IfModule&
155 &/IfModule&
157 # 'Main' server configuration
159 # The directives in this section set up the values used by the 'main'
160 # server, which responds to any requests that aren't handled by a
161 # &VirtualHost& definition.
These values also provide defaults for
162 # any &VirtualHost& containers you may define later in the file.
164 # All of these directives may appear inside &VirtualHost& containers,
165 # in which case these default settings will be overridden for the
166 # virtual host being defined.
170 # ServerAdmin: Your address, where problems with the server should be
171 # e-mailed.
This address appears on some server-generated pages, such
172 # as error documents.
e.g. admin@
174 ServerAdmin
177 # ServerName gives the name and port that the server uses to identify itself.
178 # This can often be determined automatically, but we recommend you specify
179 # it explicitly to prevent problems during startup.
181 # If your host doesn't have a registered DNS name, enter its IP address here.
183 #ServerName localhost:80
186 # DocumentRoot: The directory out of which you will serve your
187 # documents. By default, all requests are taken from this directory, but
188 # symbolic links and aliases may be used to point to other locations.
190 DocumentRoot "D:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
193 # Each directory to which Apache has access can be configured with respect
194 # to which services and features are allowed and/or disabled in that
195 # directory (and its subdirectories).
197 # First, we configure the "default" to be a very restrictive set of
198 # features.
200 &Directory /&
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
205 &/Directory&
208 # Note that from this point forward you must specifically allow
209 # particular features to be enabled - so if something's not working as
210 # you might expect, make sure that you have specifically enabled it
211 # below.
215 # This should be changed to whatever you set DocumentRoot to.
217 &Directory "D:/Program Files/Apache Software Foundation/Apache2.2/htdocs"&
# Possible values for the Options directive are "None", "All",
# or any combination of:
Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
# The Options directive is both complicated and important.
Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
Options Indexes FollowSymLinks
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
Options FileInfo AuthConfig Limit
AllowOverride None
# Controls who can get stuff from this server.
Order allow,deny
Allow from all
245 &/Directory&
248 # DirectoryIndex: sets the file that Apache will serve if a directory
249 # is requested.
250 # 此处加上index.jsp是为了配置完tomcat后若apache中的index.html不存在则能看到tomcat的首页(可以不加,则看到的是it works)
252 &IfModule dir_module&
DirectoryIndex index.html index.jsp
254 &/IfModule&
257 # The following lines prevent .htaccess and .htpasswd files from being
258 # viewed by Web clients.
260 &FilesMatch "^\.ht"&
Order allow,deny
Deny from all
Satisfy All
264 &/FilesMatch&
267 # ErrorLog: The location of the error log file.
268 # If you do not specify an ErrorLog directive within a &VirtualHost&
269 # container, error messages relating to that virtual host will be
270 # logged here.
If you *do* define an error logfile for a &VirtualHost&
271 # container, that host's errors will be logged there and not here.
273 ErrorLog "logs/error.log"
276 # LogLevel: Control the number of messages logged to the error_log.
277 # Possible values include: debug, info, notice, warn, error, crit,
278 # alert, emerg.
280 LogLevel warn
282 &IfModule log_config_module&
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
LogFormat "%h %l %u %t \"%r\" %&s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %&s %b" common
&IfModule logio_module&
# You need to enable mod_logio.c to use %I and %O
LogFormat "%h %l %u %t \"%r\" %&s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
&/IfModule&
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a &VirtualHost&
# container, they will be logged here.
Contrariwise, if you *do*
# define per-&VirtualHost& access logfiles, transactions will be
# logged therein and *not* in this file.
CustomLog "logs/access.log" common
# If you prefer a logfile with access, agent, and referer information
# (Combined Logfile Format) you can use the following directive.
#CustomLog "logs/access.log" combined
309 &/IfModule&
311 &IfModule alias_module&
# Redirect: Allows you to tell clients about documents that used to
# exist in your server's namespace, but do not anymore. The client
# will make a new request for the document at its new location.
# Example:
# Redirect permanent /foo http://localhost/bar
# Alias: Maps web paths into filesystem paths and is used to
# access content that does not live under the DocumentRoot.
# Example:
# Alias /webpath /full/filesystem/path
# If you include a trailing / on /webpath then the server will
# require it to be present in the URL.
You will also likely
# need to provide a &Directory& section to allow access to
# the filesystem path.
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the target directory are treated as applications and
# run by the server when requested rather than as documents sent to the
The same rules about trailing "/" apply to ScriptAlias
# directives as to Alias.
ScriptAlias /cgi-bin/ "D:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/"
340 &/IfModule&
342 &IfModule cgid_module&
# ScriptSock: On threaded servers, designate the path to the UNIX
# socket used to communicate with the CGI daemon of mod_cgid.
#Scriptsock logs/cgisock
348 &/IfModule&
351 # "D:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin" should be changed to whatever your ScriptAliased
352 # CGI directory exists, if you have that configured.
354 &Directory "D:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin"&
AllowOverride None
Options None
Order allow,deny
Allow from all
359 &/Directory&
362 # DefaultType: the default MIME type the server will use for a document
363 # if it cannot otherwise determine one, such as from filename extensions.
364 # If your server contains mostly text or HTML documents, "text/plain" is
365 # a good value.
If most of your content is binary, such as applications
366 # or images, you may want to use "application/octet-stream" instead to
367 # keep browsers from trying to display binary files as though they are
368 # text.
370 DefaultType text/plain
372 &IfModule mime_module&
# TypesConfig points to the file containing the list of mappings from
# filename extension to MIME-type.
TypesConfig conf/mime.types
# AddType allows you to add to or override the MIME configuration
# file specified in TypesConfig for specific file types.
#AddType application/x-gzip .tgz
# AddEncoding allows you to have certain browsers uncompress
# information on the fly. Note: Not all browsers support this.
#AddEncoding x-compress .Z
#AddEncoding x-gzip .gz .tgz
# If the AddEncoding directives above are commented-out, then you
# probably should define those extensions to indicate media types:
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#AddHandler cgi-script .cgi
# For type maps (negotiated resources):
#AddHandler type-map var
# Filters allow you to process content before it is sent to the client.
# To parse .shtml files for server-side includes (SSI):
# (You will also need to add "Includes" to the "Options" directive.)
#AddType text/html .shtml
#AddOutputFilter INCLUDES .shtml
418 &/IfModule&
421 # The mod_mime_magic module allows the server to use various hints from the
422 # contents of the file itself to determine its type.
The MIMEMagicFile
423 # directive tells the module where the hint definitions are located.
425 #MIMEMagicFile conf/magic
428 # Customizable error responses come in three flavors:
429 # 1) plain text 2) local redirects 3) external redirects
431 # Some examples:
432 #ErrorDocument 500 "The server made a boo boo."
433 #ErrorDocument 404 /missing.html
434 #ErrorDocument 404 "/cgi-bin/missing_handler.pl"
435 #ErrorDocument 402 http://localhost/subscription_info.html
439 # MaxRanges: Maximum number of Ranges in a request before
440 # returning the entire resource, or one of the special
441 # values 'default', 'none' or 'unlimited'.
442 # Default setting is to accept 200 Ranges.
443 #MaxRanges unlimited
446 # EnableMMAP and EnableSendfile: On systems that support it,
447 # memory-mapping or the sendfile syscall is used to deliver
448 # files.
This usually improves server performance, but must
449 # be turned off when serving from networked-mounted
450 # filesystems or if support for these functions is otherwise
451 # broken on your system.
453 #EnableMMAP off
454 #EnableSendfile off
456 # Supplemental configuration
458 # The configuration files in the conf/extra/ directory can be
459 # included to add extra features or to modify the default configuration of
460 # the server, or you may simply copy their contents here and change as
461 # necessary.
463 # Server-pool management (MPM specific)
464 #Include conf/extra/httpd-mpm.conf
466 # Multi-language error messages
467 #Include conf/extra/httpd-multilang-errordoc.conf
469 # Fancy directory listings
470 #Include conf/extra/httpd-autoindex.conf
472 # Language settings
473 #Include conf/extra/httpd-languages.conf
475 # User home directories
476 #Include conf/extra/httpd-userdir.conf
478 # Real-time info on requests and configuration
479 #Include conf/extra/httpd-info.conf
481 # Virtual hosts
482 #Include conf/extra/httpd-vhosts.conf
484 # Local access to the Apache HTTP Server Manual
485 #Include conf/extra/httpd-manual.conf
487 # Distributed authoring and versioning (WebDAV)
488 #Include conf/extra/httpd-dav.conf
490 # Various default settings
491 #Include conf/extra/httpd-default.conf
493 # Secure (SSL/TLS) connections
494 #Include conf/extra/httpd-ssl.conf
496 # Note: The following must must be present to support
starting without SSL on platforms with no /dev/random equivalent
but a statically compiled-in mod_ssl.
500 &IfModule ssl_module&
501 SSLRandomSeed startup builtin
502 SSLRandomSeed connect builtin
503 &/IfModule&
504 include conf/mod_jk.conf
&&&&&&&&&&&&&&&&& 3&workers.properties(apache/conf)
workers.properties
1 #workers.tomcat_home=D:\software\apache-tomcat-6.0.20\apache-tomcat-6.0.20
2 #workers.java_home=C:\Program Files\Java\jdk1.6.0_18\jre
4 #worker.list=ajp13
5 #worker.ajp13.port=8009
6 #worker.ajp13.host=localhost
7 #worker.ajp13.type=ajp13
8 #worker.ajp13.lbfactor=1
9 #tomcat的路径,让mod_jk模块知道
10 workers.tomcat1_home=D:\Program Files\Apache Software Foundation\tomcat1
11 workers.tomcat2_home=D:\Program Files\Apache Software Foundation\tomcat2
12 workers.tomcat3_home=D:\Program Files\Apache Software Foundation\tomcat3
13 #jdk的路径,让mod_jk模块知道jre的位置
14 workers.java_home=C:\Program Files\Java\jdk1.6.0_18\jre
15 #路径分隔符
17 #server 列表(tomcat1,tomcat2,tomcat3为别名)
18 worker.list = controller #模块版本
19 #========tomcat1========
20 worker.tomcat1.port=8009 #ajp13 端口号,在tomcat下server.xml配置,默认8009(工作端口,若没占用则不用修改)
21 worker.tomcat1.host=localhost #tomcat的主机地址,如不为本机,请填写ip地址
22 worker.tomcat1.type=ajp13 #类型
23 worker.tomcat1.lbfactor = 1 #server的加权比重,值越高,分得的请求越多(代理数,不用修改)
24 #========tomcat2========
25 worker.tomcat2.port=9009 #ajp13 端口号,在tomcat下server.xml配置,默认8009
26 worker.tomcat2.host=localhost #tomcat的主机地址,如不为本机,请填写ip地址
27 worker.tomcat2.type=ajp13
28 worker.tomcat2.lbfactor = 1 #server的加权比重,值越高,分得的请求越多
29 #========tomcat3========
30 worker.tomcat3.port=9010 #ajp13 端口号,在tomcat下server.xml配置,默认8009
31 worker.tomcat3.host=localhost #tomcat的主机地址,如不为本机,请填写ip地址
32 worker.tomcat3.type=ajp13
33 worker.tomcat3.lbfactor = 1 #server的加权比重,值越高,分得的请求越多
34 #========controller,负载均衡控制器========
35 worker.controller.type=lb
36 worker.controller.balanced_workers=tomcat1,tomcat2,tomcat3 #指定分担请求的tomcat
37 worker.controller.sticky_session=False #粘性会话设置
 &&&&&&&&&(2)tomcat配置
      1&server.xml(tomcat/conf)
server.xml
1 &?xml version='1.0' encoding='utf-8'?&
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.
See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
18 &!-- Note:
A "Server" is not itself a "Container", so you may not
define subcomponents such as "Valves" at this level.
Documentation at /docs/config/server.html
22 &Server port="8005" shutdown="SHUTDOWN"&
&!--APR library loader. Documentation at /docs/apr.html --&
&Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /&
&!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html --&
&Listener className="org.apache.catalina.core.JasperListener" /&
&!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html --&
&Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" /&
&Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /&
&!-- Global JNDI resources
Documentation at /docs/jndi-resources-howto.html
&GlobalNamingResources&
&!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
&Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" /&
&/GlobalNamingResources&
&!-- A "Service" is a collection of one or more "Connectors" that share
a single "Container" Note:
A "Service" is not itself a "Container",
so you may not define subcomponents such as "Valves" at this level.
Documentation at /docs/config/service.html
&Service name="Catalina"&
&!--The connectors can use a shared executor, you can define one or more named thread pools--&
&!--executor--&
&Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
maxThreads="1000" minSpareThreads="350"/&
&!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Documentation at :
Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
Connector: /docs/config/ajp.html
APR (HTTP/AJP) Connector: /docs/apr.html
Define a non-SSL HTTP/1.1 Connector on port 8080
&!--type1--&
&Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="30000"
redirectPort="8443"
enableLookups="false"
maxThreads="1000"
minSpareThreads="25"
maxSpareThreads="75"
acceptCount="1000"
compression="on"
compressionMinSize="2048"
noCompressionUserAgents="gozilla, traviata"
compressableMimeType="text/html,text/xml,text/css,text/javascript,image/gif,image/jpg"
URIEncoding="utf-8" /&
&!--type2--&
&!--openNIO/executor/gzip--&
&Connector executor="tomcatThreadPool" port="8080" protocol="org.apache.coyote.http11.Http11NioProtocol"
connectionTimeout="30000"
redirectPort="8443"
enableLookups="false"
acceptCount="1000"
compression="on"
compressionMinSize="2048"
noCompressionUserAgents="gozilla, traviata"
compressableMimeType="text/html,text/xml,text/css,text/javascript,text/plain,image/gif,image/jpg"
URIEncoding="utf-8" /&
&!-- A "Connector" using the shared thread pool--&
&Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" /&
&!-- Define a SSL HTTP/1.1 Connector on port 8443
This connector uses the JSSE configuration, when using APR, the
connector should be using the OpenSSL style configuration
described in the APR documentation --&
&Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" /&
&!-- Define an AJP 1.3 Connector on port 8009 --&
&Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /&
&!-- An Engine represents the entry point (within Catalina) that processes
every request.
The Engine implementation for Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them
on to the appropriate Host (virtual host).
Documentation at /docs/config/engine.html --&
&!-- You should set jvmRoute to support load-balancing via AJP ie :
&Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1"&
&Engine name="Catalina"
jvmRoute="tomcat1" defaultHost="localhost"&
&!--For clustering, please take a look at documentation at:
/docs/cluster-howto.html
(simple how to)
/docs/config/cluster.html (reference documentation) --&
&Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
channelSendOptions="6"&
&Manager className="org.apache.catalina.ha.session.BackupManager"
expireSessionsOnShutdown="false"
notifyListenersOnReplication="true"
mapSendOptions="6"/&
&Manager className="org.apache.catalina.ha.session.DeltaManager"
expireSessionsOnShutdown="false"
notifyListenersOnReplication="true"/&
&Channel className="org.apache.catalina.tribes.group.GroupChannel"&
&Membership className="org.apache.catalina.tribes.membership.McastService"
address="228.0.0.4"
port="45564"
frequency="500"
dropTime="3000"/&
&Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver"
address="auto"
port="5000"
selectorTimeout="100"
maxThreads="6"/&
&Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter"&
&Transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/&
&Interceptor className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/&
&Interceptor className="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor"/&
&Interceptor className="org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor"/&
&/Channel&
&Valve className="org.apache.catalina.ha.tcp.ReplicationValve"
filter=".*\..*\..*\..*\..*\..*\..*\..*\."/&
&Deployer className="org.apache.catalina.ha.deploy.FarmWarDeployer"
tempDir="/tmp/war-temp/"
deployDir="/tmp/war-deploy/"
watchDir="/tmp/war-listen/"
watchEnabled="false"/&
&ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener"/&
&/Cluster&
&!-- The request dumper valve dumps useful debugging information about
the request and response data received and sent by Tomcat.
Documentation at: /docs/config/valve.html --&
&Valve className="org.apache.catalina.valves.RequestDumperValve"/&
&!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase".
that are performed against this UserDatabase are immediately
available for use by the Realm.
&Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/&
&!-- Define the default virtual host
Note: XML Schema validation will not work with Xerces 2.2.
&Host name="localhost"
appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false"&
&!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html --&
&Valve className="org.apache.catalina.authenticator.SingleSignOn" /&
来源:/jice/archive//2410417.html

我要回帖

更多关于 mysql主从配置windows 的文章

 

随机推荐