# 集群聊天服务器实现 **Repository Path**: haojkz/ChatServer ## Basic Information - **Project Name**: 集群聊天服务器实现 - **Description**: 可以工作在nginx tcp负载均衡环境中的集群聊天服务器和客户端源码,基于muduo网络库、json、redis、mysql等第三方工具。 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-08-08 - **Last Updated**: 2021-09-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 集群聊天服务器实现 #### 介绍 可以工作在nginx tcp负载均衡环境中的集群聊天服务器和客户端源码,基于muduo网络库、json、redis、mysql等第三方工具。 #### 安装教程 1. ubuntu系统、vscode 2. Ubuntu系统安装g++/gcc、Cmake 3. ubuntu系统安装mysql、redis、muduo、nginx #### 编译方式 方法1、命令编译: cd build rm -rf * cmake .. make 方法2、执行脚本 bash autobuild.sh 或者 chmod 777 autobuild.sh sh autobuild.sh #### 使用方式 说明1、本工程服务、客户端 ip 地址均使用:127.0.0.1,读者若想使用其他ip自行更改 说明2、本工程nginx默认只配置了两个服务器,端口分别为:6000、6002,权重值都为:1(轮询),nginx代理的监听端口为:8000 使用步骤: 切换到bin文件目录下: 1、开启所有服务器,即在多个终端下分别执行:./ChatServer 127.0.0.1 6000 ./ChatServer 127.0.0.1 6002 2、客户端:./ChatClient 127.0.0.1 8000 然后根据提示信息进行业务操作。