标签:upd ystemd create 官方 开机 end work 包管理 get
将下载后的文件传输到服务器上
#修改配置文件
vi /etc/security/limits.conf
#添加
* soft nofile 65536
#修改服务配置
vi /etc/systemd/system.conf
#修改
DefaultLimitNOFILE=65536
#重启
reboot
#查看结果
ulimit -n
#将当前目标下的文件上传到目标服务器的指定路径
scp nexus-3.23.0-03-unix.tar root@192.168.0.5:/opt/
#解压
tar -xvf nexus-3.23.0-03-unix.tar
#做一个软链接方便访问和更新
ln -s /opt/nexus-3.23.0-03/ /nexus
#修改运行用户
vi /nexus/bin/nexus.rc
#修改运行用户,除非自己个人使用否则不要用root用户
run_as_user="root"
ln -s /nexus/bin/nexus /etc/init.d/nexus
#init.d设置
cd /etc/init.d
chkconfig --add nexus
chkconfig --levels 345 nexus on
service nexus start
#创建Nexus服务
vi /etc/systemd/system/nexus.service
[Unit]
Description=nexus service
After=network.target
[Service]
Type=forking
LimitNOFILE=65536
ExecStart=/nexus/bin/nexus start
ExecStop=/nexus/bin/nexus stop
User=root
Restart=on-abort
TimeoutSec=600
[Install]
WantedBy=multi-user.target
如果没有安装JAVA,请看:
安装Java1.8
#重新加载服务
systemctl daemon-reload
#开机启动
systemctl enable nexus.service
#运行服务
systemctl start nexus.service
#查看日志
tail -f /opt/sonatype-work/nexus3/log/nexus.log
访问http://192.168.0.5:8081 进入管理界面。
Nexus服务器域名和端口:repo.bluersw.com:8081
Proxy仓库:
Group仓库:
客户端配置:
#备份
cd /etc/yum.repos.d/
mkdir bak
cp *.repo bak/
vi /etc/yum.repos.d/CentOS-Base.repo
修改CentOS-Base文件内容:
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=http://repo.bluersw.com:8081/repository/repo-bluersw/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
baseurl=http://repo.bluersw.com:8081/repository/repo-bluersw/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
baseurl=http://repo.bluersw.com:8081/repository/repo-bluersw/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
baseurl=http://repo.bluersw.com:8081/repository/repo-bluersw/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
yum clean all
yum makecache
#更新系统第一次会比较慢
yum update -y
下载的RPM包都存储在Nexus服务器上,以后其他服务器照此配置就不用从外网下载了。
Proxy仓库:
Hosted仓库:
Group仓库:
group类型的Docker仓库只能pull不能push。
在Security中打开Realms界面,激活Docker Bearer Token Realm 选项。
客户端配置:
vi /etc/docker/daemon.json
修改Docker的daemon配置文件,添加上述两个Docker私服地址。
{
"insecure-registries": ["http://repo.bluersw.com:8082","http://repo.bluersw.com:8083"]
}
#重启服务
systemctl restart docker
#登录
docker login http://repo.bluersw.com:8082
docker login http://repo.bluersw.com:8083
#使用代理服务器下载镜像,镜像会存在代理服务器上供其他人下载
docker pull repo.bluersw.com:8083/hello-world
[root@ops docker]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
repo.bluersw.com:8083/hello-world latest bf756fb1ae65 4 months ago 13.3kB
#改名
docker tag repo.bluersw.com:8083/hello-world repo.bluersw.com:8082/hello-world
#上传到Docker私有仓库
docker push repo.bluersw.com:8082/hello-world
标签:upd ystemd create 官方 开机 end work 包管理 get
原文地址:https://www.cnblogs.com/bluersw/p/12990744.html