ubuntu安装skynet服务端环境(ubuntu 18.04.3服务器版)

不讲skynet文件结构和详细配置,只是特此记录以后使用。

备注:skynet采用编译安装,gcc套件版本选择7.0+,lua5.3+(在安装运行中有提示)。 其它ubuntu版本可能适用此方法。 我用的是root账号,普通用户权限不够需要使用sudo

一、前期工作

1.安照惯例修改成阿里源

cp /etc/apt/sources.list /etc/apt/source.list.bak
vi /etc/apt/sources.list

清空文件粘贴以下内容:

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
apt update                                               --更新一下

2.安装git

apt install git

3.克隆skynet和jemalloc

git clone https://github.com/cloudwu/skynet.git          --skynet源码
git clone https://github.com/jemalloc/jemalloc.git       --会使用到的内存管理
cp -r jemalloc/* skynet/3rd/jemalloc/					 --脚本会克隆jemalloc,但是太慢了,手动克隆放进skynet的对应目录。

二、安装编译环境

1.安装工具

apt install make autoconf libreadline-dev gcc            --注意gcc套件需要7.0+,我这里默认7.5

2.编译安装lua5.3.5

wget http://www.lua.org/ftp/lua-5.3.5.tar.gz
tar -zxf lua-5.3.5.tar.gz
cd lua-5.3.5
make linux test
make install

3.使用skynet自带编译好的lua

cd ~/skynet/3rd/lua             --习惯使用上面自行编译的

3.编译skynet

cd ~/skynet
make linux

编译完成界面
在/root/skynet下面生成了一个skynet可执行文件
服务端测试结果:

./skynet examples/config

运行成功
客户端测试结果:
运行成功
出现问题,一般是缺少组件,根据报错提示install相关功能组件。

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值