apisix 单机部署 linux

安装etcd:

cd /home/app
rz 
tar -zxvf etcd-v3.5.4-linux-amd64.tar.gz
cd etcd-v3.5.4-linux-amd64
vim start.sh

内容:
#!/bin/sh
nohup etcd --name infra0 --initial-advertise-peer-urls http://127.0.0.1:2380 \
  --listen-peer-urls http://127.0.0.1:2380 \
  --listen-client-urls http://127.0.0.1:2379\
  --advertise-client-urls http://127.0.0.1:2379 \
  --initial-cluster-token etcd-cluster-1 \
  --initial-cluster infra0=http://127.0.0.1:2380\
  --initial-cluster-state new >./logs/etcd.log 2>&1 &
  

chmod 755 start.sh
mkdir logs

sudo cp -a etcd etcdctl /usr/bin/

sh start.sh

tail -f logs/etcd.log

etcdctl member list
etcdctl put key value
etcdctl get key

#安装apisix

cd /home/app
sudo yum install -y https://repos.apiseven.com/packages/centos/apache-apisix-repo-1.0-1.noarch.rpm
sudo yum -y install yum-utils
sudo yum-config-manager --add-repo https://repos.apiseven.com/packages/centos/apache-apisix.repo
sudo yum install -y apisix 3.2

cd /usr/local/apisix/conf

rm -rf config-default.yaml

#上传config-default.yaml
rz   
chmod 755 config-default.yaml

cd /usr/local/apisix

#启动apisix
apisix start

#安装dashboard

cd /home/app

sudo yum install -y https://github.com/apache/apisix-dashboard/releases/download/v3.0.0/apisix-dashboard-3.0.0-0.el7.x86_64.rpm

vim  /usr/local/apisix/dashboard/conf/conf.yaml
修改内容:
  #allow_list:             # If we don't set any IP list, then any IP access is allowed by default.
    #- 0.0.0.0           # The rules are checked in sequence until the first match is found.
    #- ::1 

启动:
sudo systemctl start apisix-dashboard

停止:
sudo systemctl stop apisix-dashboard

查看状态:
sudo systemctl status apisix-dashboard

你可能感兴趣的:(linux,运维)