GVKun编程网logo

Ubuntu 16.04LTS 更新清华源(ubuntu16.04换清华源)

2

这篇文章主要围绕Ubuntu16.04LTS更新清华源和ubuntu16.04换清华源展开,旨在为您提供一份详细的参考资料。我们将全面介绍Ubuntu16.04LTS更新清华源的优缺点,解答ubunt

这篇文章主要围绕Ubuntu 16.04LTS 更新清华源ubuntu16.04换清华源展开,旨在为您提供一份详细的参考资料。我们将全面介绍Ubuntu 16.04LTS 更新清华源的优缺点,解答ubuntu16.04换清华源的相关问题,同时也会为您带来Install Atheros AR8161 Gigabit Ethernet Driver on Ubuntu 12.04LTS、install nginx on ubuntu install ubuntu usb install ubuntu 14.04 ubuntu install jd、Join Ubuntu 14.04LTS to a Windows Domain using PBI、Kubernetes 集群上运行 MongoDB 实践 (Ubuntu 18.04LTS)的实用方法。

本文目录一览:

Ubuntu 16.04LTS 更新清华源(ubuntu16.04换清华源)

Ubuntu 16.04LTS 更新清华源(ubuntu16.04换清华源)

1 备份原来的更新源

cp /etc/apt/sources.list /etc/apt/sources.list.backup

如果提示权限不够就输入下面两行,先进入到超级用户,再备份

sudo -s
cp /etc/apt/sources.list /etc/apt/sources.list.backup

2 修改更新源 

打开sources.list (这就是存放更新源的文件)

gedit /etc/apt/sources.list

将下面所有内容复制,粘贴并覆盖sources.list文件中的所有内容 

# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security multiverse

3 让更新源生效

sudo apt-get update

4 其他问题

*** Error in `appstreamcli: double free or corruption (fasttop): 0x000000000237b000 ***

该问题需要执行如下命令才能解决:
或将源改回来再试删除并重新更换更新源

sudo apt-get purge libappstream3

执行完后再次执行 sudo apt-get update 命令就正常了。

Install Atheros AR8161 Gigabit Ethernet Driver on Ubuntu 12.04LTS

Install Atheros AR8161 Gigabit Ethernet Driver on Ubuntu 12.04LTS

Install Atheros AR8161 Gigabit Ethernet Driver on Ubuntu 12.04LTS

0.Confirm your Gigabit Ethernet verison

root@Alan-dell-14R-Turbo:~# lspci | grep Ethernet
03:00.0 Ethernet controller: Atheros Communications Inc. AR8161 Gigabit Ethernet (rev 10)

1.Download Driver Package.

sudo su -     #input your password

wget http://linuxwireless.org/download/compat-wireless-2.6/compat-wireless-2012-03-12-p.tar.bz2

2.Uncompress files and exec commands.

tar xvf compat-wireless-2012-03-12-p.tar.bz2

cd compat-wireless-2012-03-12-p

./scripts/driver-select alx

make

make install

./scripts/alx-enable atl1c

./scripts/alx-enable alx

modprobe alx

install nginx on ubuntu install ubuntu usb install ubuntu 14.04 ubuntu install jd

install nginx on ubuntu install ubuntu usb install ubuntu 14.04 ubuntu install jd

Join Ubuntu 14.04LTS to a Windows Domain using PBI

Join Ubuntu 14.04LTS to a Windows Domain using PBI

The following instructions will guide you through the process of joining an Ubuntu 14.04 client to a Windows Domain using Power Broker Identity Services Open Edition version 8.0.1.2029 64bit.

(This process should also work for Lubuntu 14.04)

Environment: 
Windows Server 2012 Standard Domain Controller 
Ubuntu 14.04 LTS and Lubuntu 14.04 Client PCs

1.

Download the most current stable version of Power Broker Identity Services Open Edition

Go to the following address and download the most current version of PBIS:

http://download1.beyondtrust.com/Technical-Support/Downloads/PowerBroker-Identity-Services-Open-Edition/?Pass=True

Or, from a terminal type the following commands:

cd ~ 
sudo wget http://download.beyondtrust.com/PBISO/8.0.1/linux.deb.x64/pbis-open-8.0.1.2029.linux.x86_64.deb.sh


2.

Make the pbis installation script executable

In the terminal navigate to the directory where pbis-open-8.0.1.2029.linux.x86_64.deb.sh is located and execute the following command:

sudo chmod +x pbis-open-8.0.1.2029.linux.x86_64.deb.sh


3.

Run the pbis installation script

From the terminal type the following command to install pbis open:

sudo ./pbis-open-8.0.1.2029.linux.x86_64.deb.sh


4.

Use PBIS Open to join your PC to the Windows Domain

From the terminal:

cd /opt/pbis/bin/ 
sudo domainjoin-cli join --disable ssh $domainname $domainaccount

*where domainname = the name of your domain and domainaccount = user@domainname.###

EXAMPLE: sudo domainjoin-cli --disable ssh frijoles.com fadmin@frijoles.com

When prompted for a password supply the appropriate credentials and you should receive a "SUCCESS" prompt when finished.


5.

Set-up default configuration for domain users

Use PBIS to pre-configure the user environment for all domain users that log into the newly added system.

From the terminal:

sudo /opt/pbis/bin/config UserDomainPrefix $domain 
sudo /opt/pbis/bin/config AssumeDefaultDomain true 
sudo /opt/pbis/bin/config LoginShellTemplate /bin/bash 
sudo /opt/pbis/bin/config HomeDirTemplate %H/%U 
sudo /opt/pbis/bin/config RequireMembershipOf "$domain\\$securitygroup"


6.

Edit the pamd.d common-session file

From a terminal: 
sudo vi /etc/pam.d/common-session

Find the line that states the following: 
session sufficient pam_lsass.so

Replace it with: 
session [success=ok default=ignore] pam_lsass.so


7.

Edit the lightdm configuration file

Edit the lightdm configuration file and append the following lines:

sudo vi /usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf

allow-guest=false 
greeter-show-manual-login=true

*If you are using Lubuntu 14.04 your lightdm configuration file will be: 60-lightdm-gtk-greeter.conf


8.

Give sudo access to users/groups

Add any necessary administrative users and/or groups from your domain to the sudoers file to give them sudo privileges.

From a terminal:

sudo vi /etc/sudoers

*using the file''s configuration examples add users/groups appropriately.

EXAMPLE:

fadmin ALL=(ALL:ALL) ALL


9.

Reboot and Log-in

Reboot your PC and log-in using an appropriate domain user account.


Conclusion

These instructions have only been tested on Lubuntu 14.04 and Ubuntu 14.04 LTS Distributions. With minimal tweaking these steps should also work for other distributions. Older and now deprecated versions of Likewise-Open should work in a similar fashion as PBIS-Open, and may be required on older distributions.


Kubernetes 集群上运行 MongoDB 实践 (Ubuntu 18.04LTS)

Kubernetes 集群上运行 MongoDB 实践 (Ubuntu 18.04LTS)

MongoDB 可以支持裸机运行、容器运行和 Kubernetes 集群运行等多种方式,其中 Kubernetes 上可以采用 yaml 部署容器、Helm Chart 部署和 Operator 等方式,运行的动态伸缩能力有所不同。我在 Kubernetes 上部署 MongoDB 采用 helm chart,还是有一些问题(非授权模式部分功能无法使用),Operator 还在开发之中。部署完成后,可以使用 mongo shell 或者 mongodb compass(如下图)来进行管理。

1、裸机部署 mongodb

安装 MongoDB 服务,参考:

  • MongoDB 官方文档,https://docs.mongodb.com/manual/installation/
  • Ubuntu 安装,https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/

首先,添加 apt 源的 key:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4

添加 apt source,如下:

echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list

安装 mongdb 软件,执行:

sudo apt-get update
sudo apt-get install -y mongodb-org

sudo apt install mongodb-org-tools mongodb-org-shell mongodb-server-core

设置版本保持(为固定的版本),执行:

echo "mongodb-org hold" | sudo dpkg --set-selections
echo "mongodb-org-server hold" | sudo dpkg --set-selections
echo "mongodb-org-shell hold" | sudo dpkg --set-selections
echo "mongodb-org-mongos hold" | sudo dpkg --set-selections
echo "mongodb-org-tools hold" | sudo dpkg --set-selections

安装完毕。

2、启动 MongoDB 服务

2.1 启动服务进程

直接启动为命令行任务,执行:

mongod --port 27017 --dbpath /home/supermap/gvzr00/mongodb/mongodbx --bind_ip 10.1.1.203

作为服务,启动 mongod,执行:

sudo service mongod start

2.2 确认 MongoDB 启动成功

检查 mongod 集成成功启动,检查 log 文件,位于 /var/log/mongodb/mongod.log ,是否出现:

[initandlisten] waiting for connections on port 27017

27017 是独立模式下的缺省 mongod 服务端口。

你可以看到一些非致命的 mongod 警告输出信息,在初始的评估 MongoDB 阶段,可以安全地忽略掉这些警告信息。

2.3 停止 MongoDB 服务

停止 mongod 服务,使用命令:

sudo service mongod stop

2.4 重新启动 MongoDB

执行下面的命令:

sudo service mongod restart

2.5 使用 MongoDB

启动 mongo shell 在与 mongod同一个主机上,运行 mongo shell,不带任何命令行参数连接到 mongod服务,缺省主机为 localhost,端口 27017:

mongo

使用 mongo shell 的更多连接参数,如使用不同的主机和端口,参阅 The mongo Shell。

MongoDB 提供了 Getting Started Guides,参阅 Getting Started 获取不同的版本信息。

3、Docker 部署 MongoDB

只需要一个命令即可启动 MongoDB 服务,具体操作和使用方法与裸机方式基本相同。如下:

$ docker run -d --name mongo --restart=always -p 27017:27017 mongo:4.1

通过 compose 来运行,示例 stack.yml 部署 mongo 如下:

# Use root/example as user/password credentials
version: ''3.1''

services:

  mongo:
    image: mongo
    restart: always
    environment:
      MONGO_INITDB_ROOT_USERNAME: root
      MONGO_INITDB_ROOT_PASSWORD: example

  mongo-express:
    image: mongo-express
    restart: always
    ports:
      - 8081:8081
    environment:
      ME_CONFIG_MONGODB_ADMINUSERNAME: root
      ME_CONFIG_MONGODB_ADMINPASSWORD: example
  • 详细的参考:https://hub.docker.com/_/mongo

4、Helm Chart 部署 MongoDB

使用 Helm Chart 可以快速部署 MongoDB 到 Kubernetes 集群中。但是,由于 Helm Chart 开发和 MongoDB 版本变化的原因,一些部署参数需要根据实际情况调整才能正常运行起来。

helm install --namespace mongodb --name mongodb ./mongo-helm

4.1 固定节点

作为服务,需要固定的 IP 主地址或者通过 Ingress 作为访问入口进行服务的重定向。作为最为简单的入门,我将其部署到固定节点,通过修改 helm chart 的 values.yaml 文件,然后更新 helm 部署即可。添加如下的信息:

nodeSelector: 
  kubernetes.io/hostname: podc02

4.2 存储使用

可以使用本地存储(需要固定运行的节点)或者网络存储(我这里用 GlusterFS)。当然,也可以使用 NSF/Ceph/iSCSI 等存储系统(我没有测试过)。

  • Hostpath 存储

创建本地存储卷,如下:

PV - 物理卷创建 yaml:

apiVersion: v1
kind: PersistentVolume
metadata:
  name: mongodb
  namespace: mongodb
spec:
  capacity:
    storage: 80Gi
  accessModes:
    - ReadWriteMany
  hostPath:
    path: /home/supermap/mongodb/mongodb

PVC - 卷声明创建 yaml::

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: mongodb
  namespace: mongodb
spec:
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 80Gi
  • GlusterFS

创建相应的卷即可,如下:

endpoint 创建 yaml:

apiVersion: v1
kind: Endpoints
metadata:
  name: glusterfs-gvzr00
  namespace: mongodb
subsets:
- addresses:
  - ip: 10.1.1.193
  - ip: 10.1.1.234
  - ip: 10.1.1.205
  - ip: 10.1.1.112
  ports:
  - port: 10000
    protocol: TCP

pv - 物理卷创建 yaml:

apiVersion: v1
kind: PersistentVolume
metadata:
  name: mongodb
  namespace: mongodb
spec:
  capacity:
    storage: 800Gi
  accessModes:
    - ReadWriteMany
  glusterfs:
    endpoints: "glusterfs-gvzr00"
    path: "gvzr00/mongodb/mongodb"
    readOnly: false

pvc - 卷请求创建 yaml:

 kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: mongodb
  namespace: mongodb
spec:
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 800Gi

4.3 权限控制

在裸机部署下,可以按照官方文档的方式使用。

  • 缺省情况下,不需要账号密码即可访问。
  • 然后创建账号数据库,再将 mongod 添加 -auth 参数启动,即可启用认证访问模式。

但在 Kubernetes 部署中,缺省部署未使用授权模式。出现的一些问题包括:

  • 但是 db.tables 等命令提示需要授权才能使用。
  • 对 admin 数据库调用 createUser 时也提示需要授权才能使用。
  • 因为无法创建账户数据库,因此无法启用授权模式。
  • 需要进一步调整 helm chart 的参数,待续。

5、Operator 部署

Operator 是 Kubernetes 的一种应用管理自定义资源。

通过 Kubernetes 的操作器(Operator),可以管理 mongdb 集群多个实例的动态运行情况。获取关于 mongodb operator 的信息,参考:

  • https://www.mongodb.com/blog/post/introducing-mongodb-enterprise-operator-for-kubernetes-openshift

或者,访问最新的 https://www.operatorhub.io/ 获取版本,使用参考:

  • https://www.operatorhub.io/operator/mongodboperator.v0.3.2。

目前,该 Operator 还在开发之中,仅用于评估。

6、更多参考

  • 管理 GUI。
    • https://www.mongodb.com/download-center/compass?jmp=hero
  • Bitnami 的容器镜像。
    • https://hub.docker.com/r/bitnami/mongodb
    • https://github.com/bitnami/charts/tree/master/upstreamed/mongodb
  • 启用 Auth 权限控制。
    • https://docs.mongodb.com/manual/tutorial/enable-authentication/
  • Kubernetes Operator。
    • https://www.mongodb.com/blog/post/introducing-mongodb-enterprise-operator-for-kubernetes-openshift

今天关于Ubuntu 16.04LTS 更新清华源ubuntu16.04换清华源的讲解已经结束,谢谢您的阅读,如果想了解更多关于Install Atheros AR8161 Gigabit Ethernet Driver on Ubuntu 12.04LTS、install nginx on ubuntu install ubuntu usb install ubuntu 14.04 ubuntu install jd、Join Ubuntu 14.04LTS to a Windows Domain using PBI、Kubernetes 集群上运行 MongoDB 实践 (Ubuntu 18.04LTS)的相关知识,请在本站搜索。

本文标签: