go远程开发环境配置

go远程开发环境配置

创建服务器

登陆Openstack创建一台虚拟机作为远程开发环境

Centos版本为7.9 镜像可从清华源 https://mirrors.tuna.tsinghua.edu.cn/centos-vault/7.9.2009/ 下载

虚拟机配置为8c 12g
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

配置虚拟机

使用远程连接软件连接虚拟机进行配置
在这里插入图片描述
在这里插入图片描述

修改镜像源

修改默认的centos源为清华大学源
https://mirrors.tuna.tsinghua.edu.cn/help/centos/
在这里插入图片描述

[root@go-dev ~]# sed -e 's|^mirrorlist=|#mirrorlist=|g' \
>          -e 's|^#baseurl=http://mirror.centos.org/centos|baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos|g' \
>          -i.bak \
>          /etc/yum.repos.d/CentOS-*.repo
[root@go-dev ~]#  yum makecache

安装常用包

[root@go-dev ~]# yum install vim bash-completion -y

关闭selinux

#临时关闭,重启不生效
[root@go-dev ~]# setenforce 0
#永久关闭
[root@go-dev ~]# sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config

关闭防火墙

[root@go-dev ~]# systemctl stop firewalld
[root@go-dev ~]# systemctl disable firewalld

时间同步

[root@go-dev ~]# vim /etc/chrony.conf 
#删除
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst

#同步阿里的时间服务器
server ntp.aliyun.com iburst

#重启时间服务
[root@go-dev ~]# systemctl restart chronyd
[root@go-dev ~]# chronyc sources
210 Number of sources = 1
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
^* 203.107.6.88                  2   6     7     0    -20us[  -11ms] +/-   25ms

#设置时区为上海
[root@go-dev ~]# timedatectl set-timezone Asia/Shanghai

[root@go-dev ~]# timedatectl 
      Local time: Sun 2023-04-16 07:38:57 CST
  Universal time: Sat 2023-04-15 23:38:57 UTC
        RTC time: Sat 2023-04-15 23:38:56
       Time zone: Asia/Shanghai (CST, +0800)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: n/a
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

河南的王

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值