openSUSE下安装TARS
基本上都是依照官方提供的文档来安装:
https://doc.tarsyun.com/#/installation/source.md
有几个地方,需要注意一下:
1. 文档中不支持openSUSE,那么在安装依赖库时,需要注意都安装上,可参考CentOS版的说明:
sudo zypper install glibc-devel gcc gcc-c++ bison flex cmake which psmisc ncurses-devel zlib-devel telnet iproute2 wget unzip
2. 下载TarsFramework时注意修改git配置
git config --global http.version HTTP/1.1
git clone https://github.com/TarsCloud/TarsFramework.git --recursive
3. 下载TarsWeb时,github访问不了,可用gitee代替:
git clone https://gitee.com/TarsCloud/TarsWeb.git
4. 在make install后(到/usr/local/tars目录)部署到本地主节点时,注意修改linux-install.sh脚本,否则会提示“OS not support:"
先是在判断OS类型时,加openSUSE判断:
elif [[ "$OS" =~ "openSUSE" ]]; then
OS=5
然后在 get_host_ip()函数处,增加代码:
elif [ $OS == 5 ]; then
IP=`ip addr | grep $1 -A 1 | grep 'inet' | awk '{print $2}' | cut -d '/' -f 1`
修改后再执行linux-install命令执行部署过程。
============================
在WSL2下,与此类似,但是有两个问题不同:
1. 由于不能用systemd启动mysql服务,所以要在安装mariadb后,执行下列命令来初始化:
/usr/lib/mysql/mysql-systemd-helper install
/usr/lib/mysql/mysql-systemd-helper upgrade
然后执行下列命令来启动:
/usr/lib/mysql/mysql-systemd-helper start
2. 由于WSL2每次启动时IP都会变化,所以需要先解决这个IP变化的问题(请参考WSL2固定IP相关的内容)
评论