侧边栏壁纸
博主头像
平凡的运维之路博主等级

行动起来,活在当下

  • 累计撰写 49 篇文章
  • 累计创建 25 个标签
  • 累计收到 3 条评论

目 录CONTENT

文章目录
DB

Mongodb 3.4.22 arm64版本安装

平凡的运维之路
2024-08-15 / 0 评论 / 0 点赞 / 73 阅读 / 3926 字

Mongodb 3.4.22 arm64版本安装

  • 安装mongodb
[db@ecs-6040 ~]$ rz -be ---> mongodb_arm64.tar.gz 
[db@ecs-6040 ~]$ tar xf mongodb_arm64.tar.gz 
  • 添加环境变量
[db@ecs-6040 ~]$ more .bash_profile 
# Source /root/.bashrc if user has one
[ -f ~/.bashrc ] && . ~/.bashrc
export LD_LIBRARY_PATH=/home/db/mongodb/lib
export MONGO_HOME=/home/db/mongodb
export PATH=$PATH:$MONGO_HOME/bin
  • 查看是否缺少依赖库
[db@ecs-6040 bin]$ cd /home/db/mongodb/bin
[db@ecs-6040 bin]$ ldd  mongo  mongod  mongodump  mongoexport   mongoimport  mongooplog  mongos  mongostat  mongotop|grep   fnot
  • 初始化配置文件
[db@ecs-6040 mongodb]$ mkdir config
[db@ecs-6040 mongodb]$ cd config/
[db@ecs-6040 mongodb]$ vim mongod.conf
logpath=/home/db/mongodb/log/mongodb.log
pidfilepath=/home/db/mongodb/log/mongodb.pid
directoryperdb=true
logappend=true
port=20000
fork=true
dbpath=/home/db/mongodb/data
oplogSize=512

[db@ecs-6040 config]$ mkdir  /home/db/mongodb/log/  /home/db/mongodb/data
  • 启动mongodb服务
[db@ecs-6040 config]$ mongod -f /home/db/mongodb/config/mongod.conf 
about to fork child process, waiting until server is ready for connections.
forked process: 3769469
child process started successfully, parent exiting
  • 创建集合
[db@ecs-6040 config]$ ps -ef|grep mongo
db       3769469       1  0 17:08 ?        00:00:00 mongod -f /home/db/mongodb/config/mongod.conf

[db@ecs-6040 config]$ mongo --port 20000
MongoDB shell version v3.4.22
connecting to: mongodb://127.0.0.1:20000/
MongoDB server version: 3.4.22
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
	http://docs.mongodb.org/
Questions? Try the support group
	http://groups.google.com/group/mongodb-user
Server has startup warnings: 
2024-08-15T17:08:43.572+0800 I STORAGE  [initandlisten] 
2024-08-15T17:08:43.572+0800 I STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2024-08-15T17:08:43.572+0800 I STORAGE  [initandlisten] **          See http://dochub.mongodb.org/core/prodnotes-filesystem
2024-08-15T17:08:43.615+0800 I CONTROL  [initandlisten] 
2024-08-15T17:08:43.615+0800 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2024-08-15T17:08:43.615+0800 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2024-08-15T17:08:43.615+0800 I CONTROL  [initandlisten] 
2024-08-15T17:08:43.615+0800 I CONTROL  [initandlisten] 
2024-08-15T17:08:43.615+0800 I CONTROL  [initandlisten] ** WARNING: soft rlimits too low. The locked memory size is 65536 bytes, it should be at least 1048576 bytes
> use test22
switched to db test22
> db.test3.insert({"age":2})
WriteResult({ "nInserted" : 1 })
> db.test3.find()
{ "_id" : ObjectId("66bdc5c85dc2e45dea4e459f"), "age" : 2 }
  • 下载地址
wget https://zhao138969.com/LinuxPackage/Linux/mongodb_arm64.tar.gz
0

评论区