mongodb的安装和配置需要学多久
mongodb模块怎么安装?
mongodb模块怎么安装?
php mongodb扩展模块安装方法如下:
1、下载源码包
2、编译安装
#tar -zxvf
#cd mongo-1.2.6
#/usr/local/php/bin/phpize
#./configure --enable-mongoshare --with-php-config/usr/local/php/bin/php-config
#make ampamp make install
3、将生成的“” 添加到里面去
4、检测下模块是否安装成功
#/usr/local/php/bin/php -mv
5、成功了就可以重启apache
2022-02-10:k8s安装mongo,yaml如何写?
2022-02-10:k8s安装mongo,yaml如何写?
vi mongodb.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: asmongo
name: mongodb
labels:
app: mongodb
spec:
replicas: 1
selector:
matchLabels:
app: mongodb
template:
metadata:
labels:
app: mongodb
spec:
nodeName: k8s-node1 # 固定在 k8s-node1 节点
containers:
- name: mongodb
image: mongo:4.2.9
resources:
limits: # 限定资源
cpu: 2000m
memory: 8Gi
requests:
cpu: 100m
memory: 8Gi
env:
- name: MONGO_INITDB_ROOT_USERNAME # 设置用户名
value: root
- name: MONGO_INITDB_ROOT_PASSWORD # 设置密码
value:
volumeMounts:
- mountPath: /data/db
name: mongodb-volume
volumes:
- name: mongodb-volume
hostPath: path: /data/mongodb-volume # 映射的宿主机目录
type: DirectoryOrCreate
---
apiVersion: v1
kind: Service
metadata:
namespace: asmongo
name: mongodb
spec:
type: ClusterIP
selector:
app: mongodb
ports:
- port: 27018
targetPort: 27018