You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在CentOS7中修改MemSQL端口以解决9000端口占用问题

Fixing MemSQL Port 9000 Conflict on CentOS 7

Hey there, let's get that MemSQL installation sorted out—port conflicts are super common, so no worries! Here are a couple of straightforward ways to fix this:

Option 1: Specify a Custom Port Directly in the Install Command

The easiest fix is to just tell the installer to use a different port right off the bat. Add the --port flag to your existing command with your preferred port number (I'll use 9001 as an example):

sudo ./install.sh --simple-cluster --host=127.0.0.1 --port=9001

This will configure the entire simple cluster (aggregator and leaf node) to use the new port instead of the default 9000.

Option 2: Update Config Files If Installation Was Partially Done

If you already ran the install command and it failed mid-process, you can tweak the existing config files to switch ports:

  • First, locate MemSQL's default config directory—this is usually /var/lib/memsql or /opt/memsql depending on your setup.
  • For the aggregator node, open the memsql.cnf file in a text editor (like vi or nano):
    sudo nano /var/lib/memsql/memsql.cnf
    
  • Find the line starting with port = and change the value to your desired port, e.g.:
    port = 9001
    
  • If you have a leaf node (the simple cluster includes one by default), navigate to its subdirectory (something like /var/lib/memsql/leaf-<random-id>) and edit its memsql.cnf file the same way.
  • Finally, restart the MemSQL services to apply the changes:
    sudo systemctl restart memsql
    # Or use the MemSQL Ops command if that's what you're using
    memsql-ops restart-all
    

Quick Check: See What's Using Port 9000

If you're curious which process is hogging port 9000 (maybe you can just stop it instead of switching ports), run one of these commands:

# Using lsof
sudo lsof -i :9000
# Using netstat
sudo netstat -tulpn | grep 9000

This will show you the process ID and name—if it's a service you don't need, you can stop it with sudo systemctl stop <service-name> or kill <pid>.

内容的提问来源于stack exchange,提问作者user3399495

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 08:56:43