linux 常用程序包,Linux常用安装包

前言

记录一些常用安装包

解决方案

mongodb4.0

# cd /etc/yum.repos.d

# vim mongodb-org-4.0.repo

# vim /etc/yum.repos.d/mongodb-org-4.0.repo

[mongodb-org-4.0]

name=MongoDB Repository

baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/

gpgcheck=1

enabled=1

gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc

# yum list |grep mongodb

# yum install -y mongodb-org

# systemctl start mongod.service

# vim /etc/mongod.conf

使用秘钥

security:

authorization: enabled

创建用户

# mongo --port 27000

# use admin

# db.createUser({user:"root",pwd:"root",roles:[{ role: "root", db: "admin" }]})

//其他数据库

# db.createUser({user:"root",pwd:"root",roles:[{ role: "userAdmin", db: "yapi" },{ role: "dbAdmin", db: "yapi" },{ role: "dbOwner", db: "yapi" }]})

docker systemctl 中无法启动问题

[Unit]

Description=MongoDB Database Server

Documentation=https://docs.mongodb.org/manual

After=network.target

[Service]

#User=mongod //注释

#Group=mongod //注释

Type=forking

Environment="OPTIONS=-f /etc/mongod.conf"

EnvironmentFile=-/etc/sysconfig/mongod

ExecStart=/usr/bin/mongod $OPTIONS

ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb

ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb

ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb

#PermissionsStartOnly=true //注释

#PIDFile=/var/run/mongodb/mongod.pid //注释

# file size

LimitFSIZE=infinity

# cpu time

LimitCPU=infinity

# virtual memory size

LimitAS=infinity

# open files

LimitNOFILE=64000

# processes/threads

LimitNPROC=64000

# locked memory

LimitMEMLOCK=infinity

# total threads (user+kernel)

TasksMax=infinity

TasksAccounting=false

# Recommended limits for for mongod as specified in

# http://docs.mongodb.org/manual/reference/ulimit/#recommended-settings

[Install]

WantedBy=multi-user.target

redis

# yum install -y redis

# systemctl start redis

# vim /etc/redis.conf

mysql

# yum install -y mariadb-server

# systemctl start mariadb.service

#vim /etc/my.cnf

根目录移动无权限问题

# chown -R mysql:mysql /package

端口配置

[client-server]

port=30000

minio

export MINIO_ACCESS_KEY=账户

export MINIO_SECRET_KEY=秘钥

chmod +x minio

./minio server --address 0.0.0.0:31000 /存放路径

sh

#!/bin/sh

export MINIO_ACCESS_KEY=账户

export MINIO_SECRET_KEY=秘钥

./minio server --address 0.0.0.0:31000 /home/zmj/minio/storage

systemctl管理 /usr/lib/systemd/system

#!/bin/sh

cd /路径

./minio server --address 0.0.0.0:31000

systemctl servcie

[Unit]

Description=minio

After=network.target

[Service]

#Type=sample

#User=root

ExecStart=/home/路径/minio.sh

#ExecReload=/bin/kill -s HUP $MAINPID

ExecStop=/bin/kill -s QUIT $MAINPID

[Install]

WantedBy=multi-user.target

nignx

yum源安装

# systemctl start nginx

# systemctl reload nginx

路径

# cd /etc/nignx

重要配置

try_files $uri $uri/ /index.html; #这句很重要

docker

# curl https://download.docker.com/linux/centos/docker-ce.repo -o /etc/yum.repos.d/docker.repo

# yum list | grep docker

# yum install -y docker-ce

# systemctl start docker

使用

//启动容器

# docker run --privileged=true -tid -p 28000:28000 镜像ID /usr/sbin/init

//进入容器

# docker exec -it centos01 /bin/bash

wget docker中的centos没有wget功能

yum -y install wget

ncurses docker中的centos没有clear之类的相关功能

# yum install -y ncurses

net-tools docker中的centos没有netstat功能

# yum install -y net-tools

openssh链接

# yum install -y openssh-server

# vim /etc/ssg/sshd_config

# systemctl start sshd

# systemctl start sshd

passwd秘钥

# yum install -y passwd

# echo “123456” |passwd --stdin root

nodejs

# yum install -y nodejs

npm私有库

# npm i -g verdaccio@4.12.0

# verdaccio

私有库配置

#

# This is the default config file. It allows all users to do anything,

# so don't use it on production systems.

#

# Look here for more config file examples:

# https://github.com/verdaccio/verdaccio/tree/master/conf

#

# path to a directory with all packages

storage: ./storage

# path to a directory with plugins to include

plugins: ./plugins

web:

title: Klzy

# comment out to disable gravatar support

# gravatar: false

# by default packages are ordercer ascendant (asc|desc)

# sort_packages: asc

# convert your UI to the dark side

# darkMode: true

# translate your registry, api i18n not available yet

# i18n:

# list of the available translations https://github.com/verdaccio/ui/tree/master/i18n/translations

# web: en-US

auth:

htpasswd:

file: ./htpasswd

max_users: 1

# Maximum amount of users allowed to register, defaults to "+inf".

# You can set this to -1 to disable registration.

# max_users: 1000

# a list of other known repositories we can talk to

uplinks:

npmjs:

url: https://registry.npm.taobao.org/

agent_options:

keepAlive: true

maxSockets: 40

maxFreeSockets: 10

packages:

'@*/*':

# scoped packages

access: $all

publish: $authenticated

unpublish: $authenticated

proxy: npmjs

'**':

# allow all users (including non-authenticated users) to read and

# publish all packages

#

# you can specify usernames/groupnames (depending on your auth plugin)

# and three keywords: "$all", "$anonymous", "$authenticated"

access: $all

# allow all known users to publish/publish packages

# (anyone can register by default, remember?)

publish: $authenticated

unpublish: $authenticated

# if package is not available locally, proxy requests to 'npmjs' registry

proxy: npmjs

# You can specify HTTP/1.1 server keep alive timeout in seconds for incoming connections.

# A value of 0 makes the http server behave similarly to Node.js versions prior to 8.0.0, which did not have a keep-alive timeout.

# WORKAROUND: Through given configuration you can workaround following issue https://github.com/verdaccio/verdaccio/issues/301. Set to 0 in case 60 is not enough.

server:

keepAliveTimeout: 60

middlewares:

audit:

enabled: true

listen: 0.0.0.0:7000

# log settings

logs:

- { type: stdout, format: pretty, level: http }

#- {type: file, path: verdaccio.log, level: info}

#experiments:

# # support for npm token command

# token: false

# # support for the new v1 search endpoint, functional by incomplete read more on ticket 1732

# search: false

# # disable writing body size to logs, read more on ticket 1912

# bytesin_off: false

# This affect the web and api (not developed yet)

#i18n:

#web: en-US

私有库运行

# chmod 755

#!/bin/sh

cd /home/zmj

nohup verdaccio > verdaccio/verdacco.out

yapi

# npm i -g yapi-cli

# yapi server

//步骤执行--无密码跳过此步骤

# mongo --port 端口

# use admin

# db.auth("账户","密码")

# use yapi

# db.createUser({user:"账户",pwd:"密码",roles:[{ role: "userAdmin", db: "yapi" },{ role: "dbAdmin", db: "yapi" },{ role: "dbOwner", db: "yapi" }]})

//切换到部署目录

# node vendors/server/app.js

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值