Fabric区块链学习—Centos7服务器环境配置

         

区块链学习必备条件:linux操作基础知识,了解虚拟机,翻墙知识,至少熟悉一门开发语言,中高级以上水平,学习能力强!!!
1、虚拟机安装  建议安装centos7 mini版本
https://blog.csdn.net/u010070703/article/details/78005081?locationNum=9&fps=1
2、记得配独立IP,桥接模式

vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp0s3
UUID=365a9bb3-6d86-4f27-b2d7-fcadb4b6343a
DEVICE=enp0s3
ONBOOT=yes
IPADDR=172.17.200.88
NETMASK=255.255.255.128
GATEWAY=172.17.200.1
#HWADDR=080027710F6C
DNS1=61.128.192.168
DNS2=61.128.128.68

3、配置centos源,设置阿里yum的源

sudo cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
sudo wget/curl -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
其他命令参考
uname -r
uname -a
cat /proc/version
cat /etc/issue
cat /etc/redhat-release
yum -y install wget

yum clean all
rm -rf /var/cache/yum/*
yum makecache
yum update
ip addr
重启网络
systemctl restart network
安装gcc
yum install gcc 
yum install gcc-c++

4、GCC升级

yum -y install epel-release
yum install centos-release-scl-rh centos-release-scl
yum install devtoolset-3-gcc  devtoolset-3-gcc-c++
source /opt/rh/devtoolset-3/enable  
scl enable devtoolset-3 bash
echo "source /opt/rh/devtoolset-3/enable" >>/etc/profile

提示:yum包找不到去这个网站https://centos.pkgs.org
5、Docker安装

wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-17.12.0.ce-1.el7.centos.x86_64.rpm
yum install docker-ce-17.12.0.ce-1.el7.centos.x86_64.rpm
docker --version
systemctl start docker
删除所有带none关键字的镜像
docker rmi $(docker images | grep "none" | awk '{print $3}')
docker rmi -f $(docker images -q)
清空重置网络
docker rm -f $(docker ps -aq)
docker network prune
查看网络
docker network list
Docker镜像地址下载
先修改/etc/docker/daemon.json镜像文件地址 换养猪的地址
{ 
"registry-mirrors": ["http://hub-mirror.c.163.com"] 
}
systemctl daemon-reload
systemctl restart docker

6、安装Docker-Compose

curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose --version

7、安装go语言

wget https://dl.google.com/go/go1.10.1.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.10.1.linux-amd64.tar.gz
环境变量
export PATH=$PATH:/usr/local/go/bin 
默认执行文件夹目录
export GOPATH=/opt/gopath

8、node 安装 注意版本
Python必须的2.7

python -v 
yum install pcre pcre-devel  
yum install zlib zlib-devel 
yum install openssl openssl--devel  
yum install -y readline-devel
wget http://nodejs.org/dist/v7.10.1/node-v7.10.1.tar.gz
tar -zxvf node-v7.10.1.tar.gz
cd node-v7.10.1
./configure && make && make install
node -v

9、npm安装

npm cache clean --force
npm install换
npm install -g cnpm --registry=https://registry.npm.taobao.org
或者 
npm config set registry https://registry.npm.taobao.org 
再
cnpm install 或 npm install
升级版本
npm i npm@latest -g

10、linux内核升级

cat /etc/redhat-release
uname -sr
yum clean all
yum update
reboot
上面操作无效

加入ELRepo 仓库:
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
列出可用的系统内核相关包:
yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
安装最新的主线稳定内核:
yum --enablerepo=elrepo-kernel install kernel-ml
设置默认启动内核
vi /etc/default/grub 并设置 GRUB_DEFAULT=0
重新创建内核配置
grub2-mkconfig -o /boot/grub2/grub.cfg
reboot
uname -a
删除 CentOS 更新后的旧内核
查看系统中全部的内核 RPM 包
rpm -qa | grep kernel
yum remove 
kernel-tools-3.10.0-514.26.2.el7.x86_64 
kernel-devel-3.10.0-514.10.2.el7.x86_64 
kernel-3.10.0-514.26.2.el7.x86_64 
kernel-3.10.0-327.el7.x86_64 
kernel-headers-3.10.0-514.26.2.el7.x86_64 
kernel-devel-3.10.0-514.26.2.el7.x86_64 
kernel-tools-libs-3.10.0-514.26.2.el7.x86_64;
reboot
打赏
         

flying

   

码农

发表评论

电子邮件地址不会被公开。 必填项已用*标注