部署nexus

1、下载

nexus-3.0.2-02.tar.gz

2、解压

3、修改data路径

vi ./bin/nexus.vmoptions

-Dkaraf.data=/home/user/tools/nexus/data

-Djava.io.tmpdir=/home/user/tools/nexus/data/tmp

4、将原来的data文件全部拷贝到当前文件目录下手

5、vi /usr/lib/systemd/system/nexus.service

[Unit]

Description=kafka

After=network.target remote-fs.target nss-lookup.target zookeeper.service

ConditionPathExists=/home/user/tools/nexus


[Service]

Type=forking

User=user

ExecStart=/home/user/tools/nexus/nexus-3.0.2-02/bin/nexus start

ExecReload=/home/user/tools/nexus/nexus-3.0.2-02/bin/nexus force-reload

ExecStop=/home/user/tools/nexus/nexus-3.0.2-02/bin/nexus stop

PrivateTmp=true


[Install]

WantedBy=multi-user.target

5、配置docker repository,pypi repositry



6、本地配置

## docker repository
### 下载
包含 docker hub的代理和内部的docker repo


服务器:docker.tianrang-inc.com
1. 将 docker.tianrang-inc.com 填入insecure registries
    * [macOS](http://stackoverflow.com/questions/37619277/docker-mac-beta-using-insecure-private-registry)  Preference... -> Daemon tab -> Insecure registries
2. 用docker账号登陆


```bash
$ docker login docker.tianrang-inc.com
username: docker
password: docker
```


### 上传(内部 docker repo)
docker-hub.tianrang-inc.com
配置同下载


### 上传(发布 docker repo)
docker-???.tianrang-inc.com
配置同下载




## pypi repository


### 下载:(包括 douban pypi 源的代理和内部的 pypi)
http://nexus.tianrang-inc.com/repository/pypi/


命令行:
```bash
$ pip install -r requirements.txt -i http://nexus.tianrang-inc.com/repository/pypi/simple/ --trusted-host nexus.tianrang-inc.com
```
全局配置文件:
```
# ~/.pip/pip.conf
[global]
index=http://nexus.tianrang-inc.com/repository/pypi/
index-url=http://nexus.tianrang-inc.com/repository/pypi/simple/
trusted-host=nexus.tianrang-inc.com
```
### 上传:(内部的 pypi )
http://nexus.tianrang-inc.com/repository/pypi-hosted/


1. 配置文件 ~/.pypirc


    ```
    # ~/.pypirc
    [distutils]
    index-servers =
       nexus
    
    [nexus]
    repository = http://nexus.tianrang-inc.com/repository/pypi-hosted/
    username = docker
    password = docker
    ```
2. 用 twine 上传


    ```bash
    $ pip install twine
    $ twine upload -r nexus <filename_to_upload>
    ```


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值