CentOS下安装DevStack执行./stack.sh报错,求解决方案
./stack.sh Hey there, sorry to hear you hit a snag getting DevStack up and running on CentOS—let’s walk through the most common issues that cause this and how to fix them. Since you didn’t share the exact error message, I’ll cover the top culprits that trip up most folks in this scenario:
1. Missing System Dependencies
CentOS’s default package set is missing some tools DevStack needs to run. Double-check you’ve installed all required base packages first:
sudo yum install -y epel-release sudo yum groupinstall -y "Development Tools" sudo yum install -y python3 python3-devel git
Also, DevStack plays nicer with SELinux in permissive mode (or disabled entirely). Temporarily switch it off for the installation:
sudo setenforce 0 sudo sed -i 's/^SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config
2. Incorrect User Permissions
DevStack must be run as a non-root user with passwordless sudo access—running it as root will cause errors. If you skipped this step, set up the stack user properly:
sudo useradd -s /bin/bash -d /opt/stack -m stack echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack sudo su - stack
Also, make sure your stack user has git configured (this prevents checkout errors):
git config --global user.name "Your Name" git config --global user.email "your.email@example.com"
3. Network Service Conflicts
CentOS’s firewalld and NetworkManager frequently interfere with DevStack’s network setup. Temporarily disable them to rule out conflicts:
# Stop and disable firewalld sudo systemctl stop firewalld sudo systemctl disable firewalld # Switch to legacy network service instead of NetworkManager sudo systemctl stop NetworkManager sudo systemctl disable NetworkManager sudo systemctl start network sudo systemctl enable network
4. Insufficient System Resources
DevStack requires a minimum of 8GB of RAM (official recommendation). If your machine has less, you’ll run into service startup failures. Check your available memory:
free -h
If memory is tight, add a swap file as a temporary fix:
sudo fallocate -l 8G /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile
5. Corrupted Code Checkout or Bad local.conf
Sometimes incomplete git checkouts or misconfigured local.conf files break the installation. Refresh your DevStack repo:
cd /opt/stack/devstack git pull git submodule update --init --recursive
Also, verify your local.conf has the correct basic settings—make sure HOST_IP is set to your machine’s public/private IP (not 127.0.0.1), and ADMIN_PASSWORD is a valid string.
If none of these fixes work, grab the relevant error lines from /opt/stack/logs/stack.sh.log and share them—this will help pinpoint the exact issue!
内容的提问来源于stack exchange,提问作者Steven

