美文网首页
CentOS | 配置2019新版 CentOS8.0

CentOS | 配置2019新版 CentOS8.0

作者: Ricsy | 来源:发表于2019-09-29 16:31 被阅读0次


说明

  • CentOS8.0使用VM15进行安装,安装过程中选择是基础服务器版本
  • CentOS8.0在教程开始前属于刚安装完成的状态
  • CentOS8.0默认支持SSH远程连接
  • CentOS8.0默认开启22、9090端口

参阅:


配置过程

1.1 安装由Fedora社区提供包括额外的软件包的epel源

提示:

  • epel
    Extra Packages for Enterprise Linux
  • 安装epel源
    yum install epel-release -y

  • 生成cache缓存
    yum clean all && yum makecache

1.2 安装oh-my-zsh

步骤 命令
1 yum install git zsh -y
2 sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
3 cd ~/.oh-my-zsh/themes
4 wget https://raw.githubusercontent.com/zakaziko99/agnosterzak-ohmyzsh-theme/master/agnosterzak.zsh-theme
5 vim ~/.zshrc

agnosterzak

6 source ~/.zshrc

1.3 安装Python3

会附带安装pip3

  • 安装python3并创建符号链接
    yum install python3 -y
    ln -s python3 python
    ln -s pip3 pip

  • 配置国内源
    mkdir ~/.pip -p
    vim ~/.pip/pip.conf

[global]
index-url = http://mirrors.aliyun.com/pypi/simple
[install]
trusted-host = mirrors.aliyun.com
  • 查看版本
    python --version
    pip -V

1.4 安装Java

  • 安装JDK8
    yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel -y
  • 查看版本
    java -version

1.5 安装Nodejs

  • 安装nodejs
    yum install nodejs -y
  • 配置淘宝源
    npm config set registry https://registry.npm.taobao.org
  • 查看版本
    node -v
    npm -v

参阅:

1.6 安装MySQL 8.0

  • 安装最新版mysql 8.0
    yum install mysql-server -y
  • 启动mysql服务
    systemctl start mysqld
  • 查看mysqld服务状态
    systemctl status mysqld
  • 进入数据库
    首次没有密码

mysql -uroot

mysql -uroot -p

  • 修改root密码
    alter user 'root'@'localhost' identified by 'root123456';

  • 允许远程登录
    create user 'root'@'%' identified by 'root123456';

  • 赋予权限
    grant all on *.* to root@'%';;

  • 刷新数据库
    flush privileges;

  • 退出
    exit;

  • 重启服务
    systemctl restart mysqld

  • 开启端口
    firewall-cmd --zone=public --add-port=3306/tcp --permanent

  • 重启防火墙
    firewall-cmd --reload


  • 启动web控制台
    Cockpit 是一个交互式 Linux 服务器管理接口

systemctl enable --now cockpit.socket

  • 浏览器访问
    ip:9090

更新日志

【2019-11-14】==>

1.7 安装Redis

  • yum安装最新版redis
    yum install -y https://mirrors.aliyun.com/remi/enterprise/remi-release-8.rpm
    yum install redis -y
  • 查看redis版本
    redis-cli -v

参阅:

1.8 安装Mongo

  • 编辑配置文件
    vim /etc/yum.repos.d/mongodb-org-4.2.repo
[mongodb-org-4.2]
name=MongoDB 4.2 Repository
baseurl=https://mirrors.aliyun.com/mongodb/yum/redhat/$releasever/mongodb-org/4.2/$basearch/
gpgcheck=0
enabled=1
  • 安装mongodb
    有点慢,稍安勿躁
    yum install mongodb-org -y
  • 查看mongod安装位置
    whereis mongod
  • 启动mongod
    systemctl start mongod
  • 查看mongod状态
    systemctl status mongod

参阅:

1.9 安装Docker

  • 安装docker
    curl -fsSL https://get.docker.com | sh -s docker --mirror Aliyun
  • 查看docker版本
    docker -v
  • 启动docker
    systemctl enable docker
    systemctl status docker
    systemctl start docker
    systemctl status docker
  • 配置docker

mkdir -p /etc/docker

提示:

  • docker默认安装后就会创建该目录

tee /etc/docker/daemon.json <<-'EOF'

{
  "registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"]
}

EOF

  • 重新载入加速器
    systemctl daemon-reload
  • 重启docker
    systemctl restart docker

<==【2019-11-14】


更新中......


相关文章

网友评论

      本文标题:CentOS | 配置2019新版 CentOS8.0

      本文链接:https://www.haomeiwen.com/subject/dhcfpctx.html