1. Virtual machine preparation
(Mainly because the last time I installed the tutorial I found in a daze, there was a problem later haha, this time I carefully read the YouTube tutorial and the official website tutorial, and recorded it later if there is a problem, it will be convenient to reinstall haha)
Configuration:
1. Enter the root account
sudo passwd root #设置初始密码
su root
2. Edit the network card configuration file
vim /etc/netplan/01-network-manager-all.yaml
Here vim is not installed (the fixed ip is not connected to the Internet), and there is a problem with the vi command, so the editing is done by adding file write permissions and editing with an editor. Gateway4 has been deprecated in ubuntu, and the gateway is configured using routes
chmod a+w /etc/netplan/01-network-manager-all.yaml #添加写权限
#这里编辑文件要注意冒号后面加空格,缩进也要注意
network:
version: 2
renderer: NetworkManager
ethernets:
ens33:
addresses: [192.168.100.20/24]
dhcp4: no
dhcp6: no
routes:
- to: default
via: 192.168.100.2
nameservers:
addresses: [192.168.100.2,8.8.8.8]
netplan apply #完成编辑后控制台命令,使配置生效
Test the network and successfully access the external network
3. Remote connection
Install vim (obsession)
Set up ssh access permissions
(1) The remote cannot connect
Reason: missing openssh-server
Solution: apt-get install openssh-server
Try to connect again and find that no matter how you enter the password, it will report an error and deny access
(2) Remote access denied
Reason: The ubuntu system prohibits remote login to the root user by default
Solution: edit the configuration file
vim /etc/ssh/sshd_config
Enter /PermitRootLogin to search for a match, press Enter to end the search, and then press i to edit (of course, you can also find it yourself)
Change #PermitRootLogin prohibit-password to PermitRootLogin yes
Restart ssh: service sshd restart
Try again and connect successfully after entering the password
Two, devstack deployment
Official website: https://docs.openstack.org/devstack/latest/
1. Install git
apt-get install git
2. Set the stack user
useradd -s /bin/bash -d /opt/stack -m stack
chmod +x /opt/stack
echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack
sudo -u stack -i
3. Clone devstack
git clone https://opendev.org/openstack/devstack
4. Create a local.conf
NOTE: Use only alphanumeric characters in the password, as some services will not work when special characters are used
cd devstack
#local.conf在 devstack git repo 的根目录下创建一个带有四个预设密码的文件
vim local.conf
#文件内容
[[local|localrc]]
ADMIN_PASSWORD=密码
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
5. Start the installation
./stack.sh
#中间可能出现各种错误,完成相关解决后重新运行脚本前,建议先清除上一次的残留,避免出现错误
./clean.sh
Some debug blogs:
https://blog.csdn.net/bai0324lin/article/details/87783180
https://www.cnblogs.com/jay763190097/p/15600949.html
It is finally installed, and we will start to study and use it later~