美文网首页
Ubuntu22各种软件安装

Ubuntu22各种软件安装

作者: 板栗炖牛肉 | 来源:发表于2024-05-28 17:59 被阅读0次

配置安装

  • 环境Ubuntu 22
//注释所有
 # vim /etc/apt/sources.list
deb http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
 
deb http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
 
deb http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
 
deb http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
//更新
# apt update
  • 静态IP配置
# vim /etc/netplan/00-installer-config.yaml
  • 额外硬盘挂载
sudo fdisk -l
mount /dev/sdb /d
  • /etc/fstab文件添加
# /dev/sdb /d ext4 defaults 0 0
# mount -a
# df -h
# lsblk
  • 磁盘扩容
# vgdisplay  //看/目录名称
# lvextend -L 10T /dev/mapper/ubuntu--vg-ubuntu--lv    # 增加至 10 G
# lvextend -L +10G /dev/mapper/ubuntu--vg-ubuntu--lv   # 再增加 10 G 
# resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv  

SSH修改

# vim /etc/ssh/sshd_config 

ClientAliveInterval 50
ClientAliveCountMax 3

文件安装

JDK1.8

apt install openjdk-8-jdk
版本验证 
# java -version
# javac -version

MongoDB4.4

# sudo apt-get install gnupg curl
# echo "deb http://security.ubuntu.com/ubuntu focal-security main" | sudo tee /etc/apt/sources.list.d/focal-security.list
# curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | \
   sudo gpg -o /usr/share/keyrings/mongodb-server-4.4.gpg \
   --dearmor
# echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-4.4.gpg ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
# apt update
# apt list | grep mongodb-org
# apt list -a mongodb-org
# apt-get install libssl1.1
# apt install mongodb-org
  • 配置文件/etc/mongod.conf
# mongod.conf

# for documentation of all options, see:
#   http://docs.mongodb.org/manual/reference/configuration-options/

# Where and how to store data.
storage:
  dbPath: /home/mongod/lib/mongodb
  journal:
    enabled: true
#  engine:
#  mmapv1:
  wiredTiger:
    engineConfig:
      cacheSizeGB: 0.3

# where to write logging data.
systemLog:
  destination: file
  logAppend: true
  path: /home/mongod/log/mongodb/mongod.log

# network interfaces
net:
  port: 端口
  bindIp: 0.0.0.0


# how the process runs
processManagement:
  timeZoneInfo: /usr/share/zoneinfo

security:
  authorization: enabled #此处要开启
setParameter:
  enableLocalhostAuthBypass: true
  authenticationMechanisms: SCRAM-SHA-1

#operationProfiling:

#replication:

#sharding:

## Enterprise-Only Options:

#auditLog:

#snmp:

[Unit]
Description=MongoDB Database Server
Documentation=https://docs.mongodb.org/manual
After=network-online.target
Wants=network-online.target

[Service]
User=mongodb
Group=mongodb
EnvironmentFile=-/home/mongod
Environment="MONGODB_CONFIG_OVERRIDE_NOFORK=1"
ExecStart=/usr/bin/mongod --config /home/mongod/mongod.conf
RuntimeDirectory=mongodb
# 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 mongod as specified in
# https://docs.mongodb.com/manual/reference/ulimit/#recommended-ulimit-settings

[Install]
WantedBy=multi-user.target

  • 文件夹权限设定
#  chown -R mongod:mongod mongod
  • 命令配置
# mongo --port 端口
# use admin
# db.createUser({user:"用户",pwd:"密码",roles:["root"]})
# show users;
  • 删除用户
//命令
# use admin
# db.dropUser('username');
  • 权限划分
# use 使用的数据,非admin;
# db.createUser({user:"链接用户",pwd:"链接密码",roles:[{ role: "userAdmin", db: "数据名称" },{ role: "dbAdmin", db: "数据名称" },{ role: "dbOwner", db: "数据名称" }]}) 
# db.createUser({user: "用户",pwd: "密码",roles: ["readWrite"]})
  • 登录
# use admin;
# db.auth("用户","密码")

Redis5

# wget http://download.redis.io/releases/redis-5.0.10.tar.gz
# tar xzf redis-5.0.10.tar.gz
# cd redis-5.0.10
# make && make install
  • make安装
# apt install build-essential tcl
# apt install make
# apt install pkg-config
# make distclean //失败后,清除命令
# make install
  • .serivce配置
[Unit]
Description=Redis In-Memory Data Store
After=network.target
 
[Service]
Type=notify
User=redis
Group=redis
ExecStart=/usr/local/bin/redis-server /home/redis/redis.conf --supervised systemd
ExecStop=/usr/local/bin/redis-cli shutdown
#Restart=always

[Install]
WantedBy=multi-user.target
  • 配置文件

bind 0.0.0.0

protected-mode yes

port 端口

tcp-backlog 511

timeout 0

tcp-keepalive 60

supervised no

pidfile /home/redis/run/redis_6379.pid

loglevel notice

logfile /home/redis/log/redis/redis.log

databases 16


save 900 1
save 300 10
save 60 10000

rdbcompression yes

rdbchecksum yes

dir /home/redis/lib/redis

replica-serve-stale-data yes

replica-read-only yes


repl-diskless-sync no


repl-diskless-sync-delay 5


repl-disable-tcp-nodelay no


replica-priority 100

requirepass 秘钥

lazyfree-lazy-eviction no
lazyfree-lazy-expire no
lazyfree-lazy-server-del no
replica-lazy-flush no

appendonly no

appendfilename "appendonly.aof"

appendfsync everysec

auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb

aof-load-truncated yes

aof-use-rdb-preamble yes

lua-time-limit 5000



slowlog-log-slower-than 10000


slowlog-max-len 128

latency-monitor-threshold 0


notify-keyspace-events ""


hash-max-ziplist-entries 512
hash-max-ziplist-value 64


list-max-ziplist-size -2


list-compress-depth 0


zset-max-ziplist-entries 128
zset-max-ziplist-value 64


hll-sparse-max-bytes 3000


stream-node-max-bytes 4096
stream-node-max-entries 100


activerehashing yes

hz 10


dynamic-hz yes

aof-rewrite-incremental-fsync yes

Nginx

# apt install nginx

Mysql8

# apt install mysql8
  • 文件配置
# vim /etc/mysql/mysql.conf.d/mysqld.cnf
# 端口 bind地址等
# 开启log
server-id= 1
log_bin= /var/log/mysql/mysql-bin.log
max_binlog_size=1G
binlog_format=ROW
# log_bin_trust_function_creators=1 //是否创建函数,有函数不启用会报错
  • 命令配置
# mysql
# show databases;
# use mysql;
# show tables;
# update user set host='%' where host = 'localhost';
# 老版本
# mysql -u root
# ALTER USER 'root'@'%' IDENTIFIED BY '秘钥';
# 8版本
# mysql -u root -p
# ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'new_password';
# FLUSH PRIVILEGES;

rabbitmq

# apt install rabbitmq
# cd /usr/lib/systemd/system
# rabbitmq-plugins enable rabbitmq_management
  • 用户配置
# rabbitmqctl add_user admin 秘钥
# rabbitmqctl set_user_tags admin administrator
# rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"
# rabbitmqctl set_virtual_host_limits / arguments={"rabbitmq_management", [], true}
# rabbitmqctl list_permissions -p /
# rabbitmqctl delete_user guest //删除用户

emqx4.4.15

# curl -s https://assets.emqx.com/scripts/install-emqx-deb.sh | sudo bash
# apt update
# apt-cache madison emqx
# apt install emqx=4.4.15
# 配置文件
# vim /etc/emqx/plugins/emqx_dashboard.conf

nodejs安装v16.14.0

# curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
# apt list -a nodejs
# apt install nodejs=16.14.0
# node -v

mariadb-server

# apt list -a mariadb-server
mariadb-server/jammy-security,jammy-updates 1:10.6.18-0ubuntu0.22.04.1 all
# apt install -y mariadb-server
  • 配置文件cd /etc/mysql/mariadb.conf.d,其中*-server.cnf
  • 修改内容bind-address = 0.0.0.0port = 30000。port没有则新增
  • 是否配置binlog,注意binlog_format=ROW
  • 操作
# mysql
# show databases;
# use mysql;
# show tables;
# GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '秘钥';
# FLUSH PRIVILEGES;

相关文章

  • ubuntu22安装gogs

    安装mysql 2 安装gogs 2.1 安装git 2.2 创建git用户 2.3 下载gogs并解压 2.4 ...

  • 各种软件安装包

    最近发现网站上下载软件大多是付费,还在温饱线上的我表示伤不起啊!有的软件有试用期,但是经常会跳出页面提醒我购买,神...

  • mac安装brew

    命令行 更新 安装各种软件

  • conda 从入门到精通

    conda是最常用的软件安装工具之一。conda能够解决程序依赖问题,可以快速的安装各种软件,把我们从安装软件的大...

  • linux apt-get 出错

    安装一些软件时出错,导致每次更新软件或者安装软件总是提示各种依赖包错误,网上参考了下,解决方案

  • Mac 安装各种软件的注意

    mac 安装xgboost https://blog.csdn.net/muyimo/article/detail...

  • ubuntu下各种软件的安装

    配置Tex中文环境 首先安装texlive编译环境 安装Texmaker在linux下首先要安装qt环境,直接在软...

  • 各种软件的安装过程

    1、go 下载go1.13.3.darwin-amd64.pkg,然后傻瓜式安装 go mod 版本管理形式中,如...

  • 使用conda/bioconda 安装各种生信分析软件

    偶然听得来神器,安装各种生信软件时自动配置所需环境,一键安装,解决各种环境配置烦恼。 一. 安装anaconda或...

  • 快速安装软件

    ?Docker 快速安装软件 直接安装的缺点 安装麻烦,可能有各种依赖,运行报错。例如:WordPress,Ela...

网友评论

      本文标题:Ubuntu22各种软件安装

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