User Tools

Site Tools


coreosuclv

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
coreosuclv [2016/11/02 10:24]
moliver created
coreosuclv [2016/11/11 16:18] (current)
moliver
Line 11: Line 11:
 Desde alli se debe escalar en privilecios con un sudo y depsues lanzar el instalador: Desde alli se debe escalar en privilecios con un sudo y depsues lanzar el instalador:
  
-coreos-install -d /dev/sda+coreos-install -d /​dev/​sda ​-c cloud-config.yaml
  
-se le puede pasar alguna informacion ​de configuracion ​de ser necesario ​asi:+Es muy importante pasar el cloudconfig para no enrredarse ​ despues con la autentificacion. 
 + 
 +Aqui se muestra como: https://​linuxconfig.org/​how-to-perform-a-bare-metal-installation-of-coreos-linux 
 + 
 +Y para poder poner una ip fija se puede mirar aqui: 
 +https://​coreos.com/​os/​docs/​latest/​network-config-with-networkd.html 
 + 
 +Un ejemplo ​de cloud-config.yaml 
 +<​code>​ 
 +#​cloud-config 
 +hostname: coreos1-node 
 +ssh_authorized_keys:​ 
 +  - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDaF6E4c9jqL9cF1+XbfHAaGZTIDWn78grUmLbt+BkJVVQhQZ1rdkB40BbpZH31OlCVbg59qbCkYgT4NMRF/​WzIVyEZWOTdc4Vn1lwHYSCnbR3aTAUVWeut+rHUn9SIxcZ+yOW5WLByTGHs+vCK478rkoMGA70IcvxWBUQu/​KccJpK9RTGtuBPZ23YcBjSJyM2aO1uxNP1VZJqS52PDZN6rC+H0NSbYphrIPjtGNhocBHK9WT9mUUrevK8NflzHtS41MLsGkOd/​RgHsIxPG9bbZ4mdS2vkJfKZDk72l2G90mOGSZh2/​gH0NiEmrxsepfyRL13wPp3clerTkTY4DgG7P taqchi@Manuels-MacBook-Pro.local 
 +  - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7FeXra7tZNkjrDMhi1N+Aebjo5SvPXIY4Wc3KZZ7F8eEzdYaXenuV9LWarzwd/​cxTyWmZT5HSUK+KcVa/​k+RgM6JMUhEGh+nbfxqeZIOFOUF91cKXW6w6tSS+PBdWszlFv0hhoZb/​tJgnXZLBzHICJ+Mz0Gio0BeBMX1fNAtyL7vE9NcuCoq73hDPYf3Zc1UMNx6PH+xvWN1AT+oonUk0w73J3emMldN5/​5zJvmKlFOM1ygkj5lpfwPZY2jjkC+p7Ka+wus/​2nnIz89MkQqX8RA7jSVfvH7B3NLxcd9qBRextvANl0bVMgEDShSJLnHBRUC+6pEEdyoyaMXmNaq95 root@pm01.sustam.com 
 +users: 
 +  - name: core 
 +    passwd: $1$Y9OJDrE3$Bv4veLMp1fo6P8jN1/​L1g0 
 +coreos: 
 +  units: 
 +    - name: systemd-networkd.service 
 +      command: stop 
 +    - name: 00-ens18.network 
 +      runtime: true 
 +      content: | 
 +        [Match] 
 +        Name=ens18 
 + 
 +        [Network] 
 +        DNS=8.8.8.8 
 +        Address=10.0.0.11/​24 
 +        Gateway=10.0.0.1 
 +    - name: down-interfaces.service 
 +      command: start 
 +      content: | 
 +        [Service] 
 +        Type=oneshot 
 +        ExecStart=/​usr/​bin/​ip link set ens18 down 
 +        ExecStart=/​usr/​bin/​ip addr flush dev ens18 
 +    - name: systemd-networkd.service 
 +      command: restart 
 +    - name: etcd2.service 
 +      command: start 
 +    - name: fleet.service 
 +      command: start 
 +  etcd2: 
 +    # generate a new token for each unique cluster from https://​discovery.etcd.io/​new?​size=3 
 +    # specify the initial size of your cluster with ?size=X 
 +    discovery: https://​discovery.etcd.io/​8133f8b97fd5988b9a25627014f2e6f7 
 +    advertise-client-urls:​ http://​10.0.0.11:​2379,​http://​10.0.0.11:​4001 
 +    initial-advertise-peer-urls:​ http://​10.0.0.11:​2380 
 +    # listen on the official ports 2379, 2380 and one legacy port 4001: 
 +    listen-client-urls:​ http://​0.0.0.0:​2379,​http://​0.0.0.0:​4001 
 +    listen-peer-urls:​ http://​10.0.0.11:​2380 
 +  fleet: 
 +    public-ip: 10.0.0.11 ​  # used for fleetctl ssh command 
 + 
 +</​code>​ 
 + 
 +Al terminar el proceso ​de instalacion debe verse algo como: 
 +{{:​wiki:​screen_shot_2016-11-02_at_10.18.36_am.png?​direct&​200|}} 
 + 
 + 
 +Reiniciar todos los nodos y comprobar que no se vean errores. 
 + 
 +Para ver si el servicio etcd2 esta ok en todos se puede usar: 
 + 
 +systemctl status etcd2 
 + 
 +La salida debe ser asi mas o menos 
 +<​code>​ 
 +● etcd2.service - etcd2 
 +   ​Loaded:​ loaded (/​usr/​lib/​systemd/​system/​etcd2.service;​ disabled; vendor preset: disabled) 
 +  Drop-In: /​run/​systemd/​system/​etcd2.service.d 
 +           ​└─20-cloudinit.conf 
 +   ​Active:​ active (running) since Thu 2016-11-03 20:19:39 UTC; 8min ago 
 + Main PID: 1414 (etcd2) 
 +    Tasks: 10 
 +   ​Memory:​ 35.4M 
 +      CPU: 3.930s 
 +   ​CGroup:​ /​system.slice/​etcd2.service 
 +           ​└─1414 /​usr/​bin/​etcd2 
 + 
 +Nov 03 20:19:39 coreos1-node etcd2[1414]:​ 29b777c31723e490 [logterm: 1, index: 3, vote: 29b777c31723e490] rejected vote from 46b0f4bd80d1424d [logterm: 1, index: 3] at term 2 
 +Nov 03 20:19:39 coreos1-node etcd2[1414]:​ the connection with 50499cd27cdbe30d became active 
 +Nov 03 20:19:39 coreos1-node etcd2[1414]:​ 29b777c31723e490 received vote rejection from 46b0f4bd80d1424d at term 2 
 +Nov 03 20:19:39 coreos1-node etcd2[1414]:​ 29b777c31723e490 [quorum:2] has received 1 votes and 1 vote rejections 
 +Nov 03 20:19:39 coreos1-node etcd2[1414]:​ 29b777c31723e490 received vote rejection from 50499cd27cdbe30d at term 2 
 +Nov 03 20:19:39 coreos1-node etcd2[1414]:​ 29b777c31723e490 [quorum:2] has received 1 votes and 2 vote rejections 
 +Nov 03 20:19:39 coreos1-node etcd2[1414]:​ 29b777c31723e490 became follower at term 2 
 +Nov 03 20:19:39 coreos1-node etcd2[1414]:​ raft.node: 29b777c31723e490 elected leader 46b0f4bd80d1424d at term 2 
 +Nov 03 20:19:40 coreos1-node etcd2[1414]:​ published {Name:​69436ca671524a17acedcf93c541e8d3 ClientURLs:​[http://​10.0.0.11:​2379 http://​10.0.0.11:​4001]} to cluster f7a76f3a444892c0 
 +Nov 03 20:19:40 coreos1-node etcd2[1414]:​ set the initial cluster version to 2.3 
 +</​code>​ 
 + 
 + 
 +Para saber si el cluster de etcd2 esta trabajado correctamente que es la idea de todo esto se puede ejecutar en un nodo algo como: 
 + 
 +etcdctl set /message "​Hola"​ 
 + 
 +y en otro pedir el valor  
 + 
 +etcdctl get /message y deberia devolver Hola
  
-coreos-install -d /dev/sda -c cloud-config.yaml 
  
  
 +[[Probando fleet]]
  
coreosuclv.1478096670.txt.gz · Last modified: 2016/11/02 10:24 by moliver