控制节点环境准备

1. 部署说明

部署地点: 控制节点(ip: 192.168.0.142)。

2. hostname主机名配置

hostnamectl set-hostname controller
exec bash

添加host:

controller_ip="192.168.0.142"
computer_ip="192.168.0.184"
echo "$controller_ip controller" >> /etc/hosts
echo "$computer_ip computer" >> /etc/hosts

设置完主机名后需要重启,否则在rabbitmq-server启动时会出错。

重启:

reboot

3. 免密登录(可选)

ssh-keygen

选取默认路径存储:/root/.ssh/id_rsa。

ssh-copy-id -i /root/.ssh/id_rsa.pub root@192.168.0.184

4. 禁用防火墙

4.1. 关闭防火墙

systemctl stop firewalld
systemctl disable firewalld

4.2. 关闭SELinux

setenforce 0
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config

4.3. 关闭swap分区

swapoff -a
sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab

5. 设置内核

modprobe bridge
modprobe br_netfilter
cat > /etc/sysconfig/modules/neutron.modules <<EOF
#!/bin/bash
modprobe -- bridge
modprobe -- br_netfilter
EOF
chmod 755 /etc/sysconfig/modules/neutron.modules && bash /etc/sysconfig/modules/neutron.modules
echo "vm.max_map_count=262144" >> /etc/sysctl.conf
echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
echo "net.bridge.bridge-nf-call-iptables=1" >> /etc/sysctl.conf
echo "net.bridge.bridge-nf-call-ip6tables=1" >> /etc/sysctl.conf
sysctl -p

6. yum源配置

配置openstack及虚拟化相关源。

loongnix-server 23平台openstack-wallaby源对应的包是loongnix-release-openstack-wallaby。

安装openstack-wallaby源:

yum install loongnix-release-openstack-wallaby -y

其它平台需安装该平台提供的openstack-wallaby源对应的包。

此处需要注意openstack-w的源优先级设置为最高 priority=1。

配置完成后,通常需要清除yum中原有的cache,并重新生成cache。清除yum陈旧cache的命令如下:

yum clean all
yum makecache

7. 系统基础软件工具安装与配置

7.1. NTP时间同步

yum install -y chrony  autoremove
sed -i '/^pool/d' /etc/chrony.conf
sed -i '/^server/d' /etc/chrony.conf
echo "pool ntp.aliyun.com iburst" >> /etc/chrony.conf
systemctl start chronyd.service && systemctl enable chronyd.service

7.2. Openstack配置工具安装

yum install -y python3-crudini

7.3. OpenStack客户端相关软件

yum install -y python3-openstackclient

7.4. 基础服务:数据库SQL database

安装sql。

yum install -y mariadb mariadb-server python3-PyMySQL

创建/etc/my.cnf.d/openstack.cnf并进行配置。

sudo tee /etc/my.cnf.d/openstack.cnf <<-'EOF'
[mysqld]
default-storage-engine = innodb
innodb_file_per_table = on
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
EOF
systemctl enable mariadb.service
systemctl start mariadb.service

7.5. 基础服务:消息队列Message queue

rabbitmq-serevr安装

方法一:本地安装

安装rabbitmq-server。

yum install rabbitmq-server -y

启动消息队列并将其配置为随系统启动。

systemctl enable rabbitmq-server.service
systemctl start rabbitmq-server.service
systemctl status rabbitmq-server.service

增加guest用户,并设置密码为loongson。

rabbitmqctl add_user guest loongson
rabbitmqctl change_password guest loongson

guest用户配置权限。

rabbitmqctl set_permissions guest ".*" ".*" ".*"

方法二、容器方式安装

安装docker-engine。

yum install -y docker-engine
mkdir -p /etc/docker/
tee /etc/docker/daemon.json <<-'EOF'
{
  "insecure-registries":["lcr.loongnix.cn"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl enable docker
sudo systemctl restart docker

使用龙芯harbor帐号密码登录。

docker login -u loongsoncloud -p loongson@SYS3 lcr.loongnix.cn

安装消息队列服务。

注意,需要手动配置远程访问功能。

docker run --restart=always -dit --name Myrabbitmq -e RABBITMQ_DEFAULT_USER=guest -e RABBITMQ_DEFAULT_PASS=loongson -p 15672:15672 -p 5672:5672 lcr.loongnix.cn/library/rabbitmq:3.8.18

给guest赋予远程访问权限。

docker exec -it Myrabbitmq /bin/sh

查看用户。

rabbitmqctl list_users

赋予远程访问权限。

rabbitmqctl set_permissions -p "/" guest ".*" ".*" ".*"

进行简单验证。

lsof -i:15672

7.6. 基础服务:Memcached

yum install -y memcached python3-memcached
sed -i '/OPTIONS/d' /etc/sysconfig/memcached
echo 'OPTIONS="-l 127.0.0.1,::1,controller"' >> /etc/sysconfig/memcached
systemctl enable memcached.service
systemctl start memcached.service
systemctl status memcached.service
©龙芯开源社区 all right reserved,powered by Gitbook文档更新时间: 2025-01-15 10:59:56

results matching ""

    No results matching ""

    results matching ""

      No results matching ""