Ubuntu22各種軟件安裝

配置安裝

  • 環(huán)境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
  • 靜態(tài)IP配置
# vim /etc/netplan/00-installer-config.yaml
  • 額外硬盤(pán)掛載
sudo fdisk -l
mount /dev/sdb /d
  • /etc/fstab文件添加
# /dev/sdb /d ext4 defaults 0 0
# mount -a
# df -h
# lsblk
  • 磁盤(pán)擴(kuò)容
# vgdisplay  //看/目錄名稱(chēng)
# 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
版本驗(yàn)證 
# 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 #此處要開(kāi)啟
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

  • 文件夾權(quán)限設(shè)定
#  chown -R mongod:mongod mongod
  • 命令配置
# mongo --port 端口
# use admin
# db.createUser({user:"用戶(hù)",pwd:"密碼",roles:["root"]})
# show users;
  • 刪除用戶(hù)
//命令
# use admin
# db.dropUser('username');
  • 權(quán)限劃分
# use 使用的數(shù)據(jù),非admin;
# db.createUser({user:"鏈接用戶(hù)",pwd:"鏈接密碼",roles:[{ role: "userAdmin", db: "數(shù)據(jù)名稱(chēng)" },{ role: "dbAdmin", db: "數(shù)據(jù)名稱(chēng)" },{ role: "dbOwner", db: "數(shù)據(jù)名稱(chēng)" }]}) 
# db.createUser({user: "用戶(hù)",pwd: "密碼",roles: ["readWrite"]})
  • 登錄
# use admin;
# db.auth("用戶(hù)","密碼")

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地址等
# 開(kāi)啟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 //是否創(chuàng)建函數(shù)腥例,有函數(shù)不啟用會(huì)報(bào)錯(cuò)
  • 命令配置
# 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
  • 用戶(hù)配置
# 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 //刪除用戶(hù)

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
  • 修改內(nèi)容bind-address = 0.0.0.0址芯,port = 30000灾茁。port沒(méi)有則新增
  • 是否配置binlog,注意binlog_format=ROW
  • 操作
# mysql
# show databases;
# use mysql;
# show tables;
# GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '秘鑰';
# FLUSH PRIVILEGES;
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末谷炸,一起剝皮案震驚了整個(gè)濱河市北专,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌旬陡,老刑警劉巖拓颓,帶你破解...
    沈念sama閱讀 211,376評(píng)論 6 491
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異描孟,居然都是意外死亡驶睦,警方通過(guò)查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 90,126評(píng)論 2 385
  • 文/潘曉璐 我一進(jìn)店門(mén)匿醒,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)场航,“玉大人,你說(shuō)我怎么就攤上這事廉羔「攘。” “怎么了?”我有些...
    開(kāi)封第一講書(shū)人閱讀 156,966評(píng)論 0 347
  • 文/不壞的土叔 我叫張陵憋他,是天一觀的道長(zhǎng)孩饼。 經(jīng)常有香客問(wèn)我,道長(zhǎng)举瑰,這世上最難降的妖魔是什么捣辆? 我笑而不...
    開(kāi)封第一講書(shū)人閱讀 56,432評(píng)論 1 283
  • 正文 為了忘掉前任,我火速辦了婚禮此迅,結(jié)果婚禮上汽畴,老公的妹妹穿的比我還像新娘。我一直安慰自己耸序,他們只是感情好忍些,可當(dāng)我...
    茶點(diǎn)故事閱讀 65,519評(píng)論 6 385
  • 文/花漫 我一把揭開(kāi)白布。 她就那樣靜靜地躺著坎怪,像睡著了一般罢坝。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上搅窿,一...
    開(kāi)封第一講書(shū)人閱讀 49,792評(píng)論 1 290
  • 那天嘁酿,我揣著相機(jī)與錄音隙券,去河邊找鬼。 笑死闹司,一個(gè)胖子當(dāng)著我的面吹牛娱仔,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播游桩,決...
    沈念sama閱讀 38,933評(píng)論 3 406
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼牲迫,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來(lái)了借卧?” 一聲冷哼從身側(cè)響起盹憎,我...
    開(kāi)封第一講書(shū)人閱讀 37,701評(píng)論 0 266
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎铐刘,沒(méi)想到半個(gè)月后陪每,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 44,143評(píng)論 1 303
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡镰吵,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 36,488評(píng)論 2 327
  • 正文 我和宋清朗相戀三年奶稠,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片捡遍。...
    茶點(diǎn)故事閱讀 38,626評(píng)論 1 340
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖竹握,靈堂內(nèi)的尸體忽然破棺而出画株,到底是詐尸還是另有隱情,我是刑警寧澤啦辐,帶...
    沈念sama閱讀 34,292評(píng)論 4 329
  • 正文 年R本政府宣布谓传,位于F島的核電站,受9級(jí)特大地震影響芹关,放射性物質(zhì)發(fā)生泄漏续挟。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 39,896評(píng)論 3 313
  • 文/蒙蒙 一侥衬、第九天 我趴在偏房一處隱蔽的房頂上張望诗祸。 院中可真熱鬧,春花似錦轴总、人聲如沸直颅。這莊子的主人今日做“春日...
    開(kāi)封第一講書(shū)人閱讀 30,742評(píng)論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)功偿。三九已至,卻和暖如春往堡,著一層夾襖步出監(jiān)牢的瞬間械荷,已是汗流浹背共耍。 一陣腳步聲響...
    開(kāi)封第一講書(shū)人閱讀 31,977評(píng)論 1 265
  • 我被黑心中介騙來(lái)泰國(guó)打工, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留吨瞎,地道東北人痹兜。 一個(gè)月前我還...
    沈念sama閱讀 46,324評(píng)論 2 360
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像关拒,于是被迫代替她去往敵國(guó)和親佃蚜。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 43,494評(píng)論 2 348

推薦閱讀更多精彩內(nèi)容