centos7安装nexus3

centos7安装nexus3

2018年05月24日 16:20:34

阅读数:257

1、下载nexus
wget https://sonatype-download.global.ssl.fastly.net/repository/repositoryManager/3/nexus-3.12.0-01-unix.tar.gz


2、解压
tar -zxvf nexus-3.12.0-01-unix.tar.gz -C /usr/local/nexus/


3、启动
cd /usr/local/nexus/nexus-3.12.0-01/bin
./nexus run &


看到“Started Sonatype Nexus OSS 3.12.0-01”启动成功
http://192.168.1.121:8081
默认端口:8081
默认用户名:admin
默认密码:admin123


4、设置开机自启动
vim /usr/lib/systemd/system/nexus.service


[Unit]
Description=nexus service


[Service]
Type=forking
LimitNOFILE=65536
ExecStart=/usr/local/nexus/nexus-3.12.0-01/bin/nexus start
ExecReload=/usr/local/nexus/nexus-3.12.0-01/bin/nexus restart
ExecStop=/usr/local/nexus/nexus-3.12.0-01/bin/nexus stop
Restart=on-failure


[Install]
WantedBy=multi-user.target


服务加入开机启动 systemctl enable nexus.service
重新加载配置文件 systemctl daemon-reload


5、修改nexus用户root
vim bin/nexus.rc  =>  run_as_user="root"


6、修改jdk
vim bin/nexus  =>  INSTALL4J_JAVA_HOME_OVERRIDE=/usr/local/java/jdk1.8.0_91


7、修改默认端口
vim etc/nexus-default.properties  =>  application-port=8081


8、修改数据、日志存储位置
vim bin/nexus.vmoptions


9、nexus手动更新索引
从http://repo.maven.apache.org/maven2/.index/ 找到需要下载的索引文件,下面几个文件下载到同一目录
http://repo.maven.apache.org/maven2/.index/nexus-maven-repository-index.gz
http://repo.maven.apache.org/maven2/.index/nexus-maven-repository-index.properties
indexer-cli下载地址:http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.apache.maven.indexer%22%20AND%20a%3A%22indexer-cli%22


执行
java -jar indexer-cli-6.0.0.jar -u nexus-maven-repository-index.gz -d indexer
等待程序运行完成之后可以发现indexer文件夹下出现了很多文件,将这些文件放置到{nexus-home}/sonatype-work/nexus3/indexer/central-ctx目录下
重新启动nexus

转载于:https://my.oschina.net/u/3367404/blog/1927796

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值