1Epoch GisServer 支持高并发大数据量的应用场景,具有很强的可扩展性,以下为 Linux 环境下集群部署的基本步骤。
1. 服务器准备#
2. 系统参数配置#
2.2. 修改系统内核参数#
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.icmp_ignore_bogus_error_responses = 1
net.ipv4.ip_forward = 0net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.send_redirects = 0
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
net.ipv4.tcp_max_tw_buckets = 6000
net.ipv4.tcp_sack = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_rmem = 4096 87380 4194304
net.ipv4.tcp_wmem = 4096 16384 4194304
net.core.wmem_default = 8388608
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.core.netdev_max_backlog = 262144
net.ipv4.tcp_max_orphans = 3276800
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_synack_retries = 1
net.ipv4.tcp_syn_retries = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_mem = 94500000 915000000 927000000
net.ipv4.tcp_fin_timeout = 1
net.ipv4.tcp_keepalive_time = 30
net.ipv4.ip_local_port_range = 1024 65000
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.default.accept_redirects = 0
net.ipv4.conf.all.secure_redirects = 0
net.ipv4.conf.default.secure_redirects = 0
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=262144
net.core.rmem_max=9194304
net.core.wmem_default=262144
net.core.wmem_max=1811048586
2.3. 修改机器资源限制配置#
* soft nproc 2047
* hard nproc 65536
* soft nofile 65536
* hard nofile 65536
* soft stack 65536
2.4. 防火墙设置#
2.5. 系统依赖包安装#
2.6. 重新启动系统#
3. GisServer 配置#
3.1. 上传安装包#
使用 xftp 等工具将 gisserver-xxxx.tar.gz 安装包上传到 gisserver 服务器的 /usr/local 目录下解压(每个节点都要安装)3.2. 启动 GisServer#
如要停止服务,可输入./gisserver stop
3.3. 验证测试#
http://localhost:8080/gisserver/如果不能打开页面请检查防火墙是否正常关闭,多节点的情况下请注意数据库的jdbc配置是否正确
4. NFS 文件共享配置#
4.1. NFS 服务端配置#
/giserver/services *(rw,sync,insecure,no_root_squash)
4.2. NFS客户端配置#
5. 服务状态同步开启#
打开每个 gisserver 集群节点的 Web 应用文件 gisserver/tomcat/webapps/gisserver/WEB-INF/web.xml配置参数。CONFIG_MONITOR_PERIOD: 同步间隔时间,建议默认设置2000ms<context-param>
<param-name>CONFIG_MONITOR_PERIOD</param-name>
<param-value>2000</param-value>
</context-param>
6. Nginx 负载均衡配置#
6.1. 下载nginx#
https://nginx.org/en/download.html6.2. 安装nginx#
使用 xftp 等工具将 nginx 安装包上传到负载均衡服务器的 /usr/local 目录下并解压,文件包名称具体以实际下载版本为准。如提示 PCRE、OpenSSL 库错误,输入以下命令安装缺失库,安装完成后再运行 configure:6.3. 配置nginx#
6.4. 启动nginx#